LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
IOVTimeStamp.h
Go to the documentation of this file.
1 
14 #ifndef IOVDATA_IOVTIMESTAMP_H
15 #define IOVDATA_IOVTIMESTAMP_H
16 
17 #include <string>
18 
19 namespace lariov {
24  class IOVTimeStamp {
25 
26  public:
28  IOVTimeStamp(unsigned long stamp, unsigned int substamp = 0)
29  : fStamp(stamp), fSubStamp(substamp)
30  {
31  this->CalcDBStamp();
32  }
33 
35  virtual ~IOVTimeStamp() {}
36 
37  unsigned long Stamp() const { return fStamp; }
38  unsigned long SubStamp() const { return fSubStamp; }
39  const std::string& DBStamp() const { return fDBStamp; }
40 
41  void SetStamp(unsigned long stamp, unsigned int substamp = 0)
42  {
43  fStamp = stamp;
44  fSubStamp = substamp;
45  this->CalcDBStamp();
46  }
47 
52  void CalcDBStamp();
53 
54  static IOVTimeStamp GetFromString(const std::string& ts);
55  static IOVTimeStamp MinTimeStamp();
56  static IOVTimeStamp MaxTimeStamp();
57 
59  bool operator<(const IOVTimeStamp& ts) const;
60  bool operator<=(const IOVTimeStamp& ts) const;
61  bool operator>=(const IOVTimeStamp& ts) const;
62  bool operator>(const IOVTimeStamp& ts) const;
63 
64  bool operator==(const IOVTimeStamp& ts) const;
65  bool operator!=(const IOVTimeStamp& ts) const;
66 
69 
70  protected:
71  unsigned long fStamp;
72  unsigned int fSubStamp;
73 
74  std::string fDBStamp;
75  };
76 }
77 #endif
static IOVTimeStamp MinTimeStamp()
bool operator==(const IOVTimeStamp &ts) const
implementation of equality operator
void SetStamp(unsigned long stamp, unsigned int substamp=0)
Definition: IOVTimeStamp.h:41
IOVTimeStamp(unsigned long stamp, unsigned int substamp=0)
Constructor.
Definition: IOVTimeStamp.h:28
virtual ~IOVTimeStamp()
Default destructor.
Definition: IOVTimeStamp.h:35
bool operator>=(const IOVTimeStamp &ts) const
bool operator<(const IOVTimeStamp &ts) const
comparison operators
const std::string & DBStamp() const
Definition: IOVTimeStamp.h:39
bool operator<=(const IOVTimeStamp &ts) const
unsigned long SubStamp() const
Definition: IOVTimeStamp.h:38
bool operator>(const IOVTimeStamp &ts) const
bool operator!=(const IOVTimeStamp &ts) const
remaining comparison operators implemented in terms of == and <
unsigned int fSubStamp
Definition: IOVTimeStamp.h:72
Filters for channels, events, etc.
unsigned long fStamp
Definition: IOVTimeStamp.h:71
unsigned long Stamp() const
Definition: IOVTimeStamp.h:37
IOVTimeStamp & operator=(const IOVTimeStamp &ts)
assignment operator
static IOVTimeStamp GetFromString(const std::string &ts)
static IOVTimeStamp MaxTimeStamp()
std::string fDBStamp
Definition: IOVTimeStamp.h:74