17 #ifndef FALAISE_SNEMO_DATAMODELS_TIMESTAMP_H 18 #define FALAISE_SNEMO_DATAMODELS_TIMESTAMP_H 1 22 #include <boost/cstdint.hpp> 23 #include <boost/serialization/access.hpp> 57 timestamp(int64_t sec_, int64_t picosec_);
93 int64_t _picoseconds_;
102 #include <boost/serialization/version.hpp> 105 #endif // FALAISE_SNEMO_DATAMODELS_TIMESTAMP_H int compare(const timestamp &) const
Compare with another timestamp.
static const char IO_FORMAT_INVALID
Definition: timestamp.h:39
friend std::istream & operator>>(std::istream &, timestamp &)
static const char IO_FORMAT_SEP
Definition: timestamp.h:37
friend bool operator>(const timestamp &, const timestamp &)
virtual ~timestamp()
Destructor.
static const int64_t INVALID_PICOSECONDS
Definition: timestamp.h:35
void set_picoseconds(int64_t)
Set the number of picoseconds.
static const char IO_FORMAT_OPEN
Definition: timestamp.h:36
friend bool operator>=(const timestamp &, const timestamp &)
#define DATATOOLS_SERIALIZATION_DECLARATION()
A class to handle time stamp.
Definition: timestamp.h:32
friend bool operator==(const timestamp &, const timestamp &)
int64_t get_picoseconds() const
Return the number of picoseconds.
std::string to_string() const
Format time stamp as string object and return it.
int64_t get_seconds() const
Return the number of seconds.
static const int64_t INVALID_SECONDS
Definition: timestamp.h:34
Definition: calo_tapered_scin_box_model.h:54
friend std::ostream & operator<<(std::ostream &, const timestamp &)
friend bool operator<(const timestamp &, const timestamp &)
bool is_valid() const
Check if the timestamp object is valid.
void from_string(const std::string &)
Parse time from string object and set the timestamp object accordingly.
static const char IO_FORMAT_CLOSE
Definition: timestamp.h:38
void invalidate()
Invalidate the timestamp object.
friend bool operator<=(const timestamp &, const timestamp &)
double to_real() const
Convert timestamp to real value (explicit time unit)
void set_seconds(int64_t)
Set the number of seconds.