Falaise  4.0.1
SuperNEMO Software Toolkit
Public Member Functions | Static Public Attributes | Friends | List of all members
snemo::datamodel::timestamp Class Reference

A class to handle time stamp. More...

#include <falaise/snemo/datamodels/timestamp.h>

Inheritance diagram for snemo::datamodel::timestamp:
datatools::i_serializable

Public Member Functions

int64_t get_seconds () const
 Return the number of seconds. More...
 
void set_seconds (int64_t)
 Set the number of seconds. More...
 
int64_t get_picoseconds () const
 Return the number of picoseconds. More...
 
void set_picoseconds (int64_t)
 Set the number of picoseconds. More...
 
 timestamp ()
 Constructor. More...
 
 timestamp (int64_t sec_, int64_t picosec_)
 Overloaded constructor. More...
 
virtual ~timestamp ()
 Destructor. More...
 
bool is_valid () const
 Check if the timestamp object is valid. More...
 
void invalidate ()
 Invalidate the timestamp object. More...
 
int compare (const timestamp &) const
 Compare with another timestamp. More...
 
double to_real () const
 Convert timestamp to real value (explicit time unit) More...
 
std::string to_string () const
 Format time stamp as string object and return it. More...
 
void to_string (std::string &) const
 Format time stamp as string object and return it as reference. More...
 
void from_string (const std::string &)
 Parse time from string object and set the timestamp object accordingly. More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 
virtual ~i_serializable ()
 
virtual const std::string & get_serial_tag () const=0
 

Static Public Attributes

static const int64_t INVALID_SECONDS
 
static const int64_t INVALID_PICOSECONDS
 
static const char IO_FORMAT_OPEN
 
static const char IO_FORMAT_SEP
 
static const char IO_FORMAT_CLOSE
 
static const char IO_FORMAT_INVALID
 

Friends

bool operator== (const timestamp &, const timestamp &)
 
bool operator< (const timestamp &, const timestamp &)
 
bool operator> (const timestamp &, const timestamp &)
 
bool operator<= (const timestamp &, const timestamp &)
 
bool operator>= (const timestamp &, const timestamp &)
 
std::ostream & operator<< (std::ostream &, const timestamp &)
 
std::istream & operator>> (std::istream &, timestamp &)
 

Detailed Description

A class to handle time stamp.

Constructor & Destructor Documentation

◆ timestamp() [1/2]

snemo::datamodel::timestamp::timestamp ( )

Constructor.

◆ timestamp() [2/2]

snemo::datamodel::timestamp::timestamp ( int64_t  sec_,
int64_t  picosec_ 
)

Overloaded constructor.

◆ ~timestamp()

virtual snemo::datamodel::timestamp::~timestamp ( )
virtual

Destructor.

Member Function Documentation

◆ compare()

int snemo::datamodel::timestamp::compare ( const timestamp ) const

Compare with another timestamp.

◆ from_string()

void snemo::datamodel::timestamp::from_string ( const std::string &  )

Parse time from string object and set the timestamp object accordingly.

◆ get_picoseconds()

int64_t snemo::datamodel::timestamp::get_picoseconds ( ) const

Return the number of picoseconds.

◆ get_seconds()

int64_t snemo::datamodel::timestamp::get_seconds ( ) const

Return the number of seconds.

◆ invalidate()

void snemo::datamodel::timestamp::invalidate ( )

Invalidate the timestamp object.

◆ is_valid()

bool snemo::datamodel::timestamp::is_valid ( ) const

Check if the timestamp object is valid.

◆ set_picoseconds()

void snemo::datamodel::timestamp::set_picoseconds ( int64_t  )

Set the number of picoseconds.

◆ set_seconds()

void snemo::datamodel::timestamp::set_seconds ( int64_t  )

Set the number of seconds.

◆ to_real()

double snemo::datamodel::timestamp::to_real ( ) const

Convert timestamp to real value (explicit time unit)

◆ to_string() [1/2]

std::string snemo::datamodel::timestamp::to_string ( ) const

Format time stamp as string object and return it.

◆ to_string() [2/2]

void snemo::datamodel::timestamp::to_string ( std::string &  ) const

Format time stamp as string object and return it as reference.

Friends And Related Function Documentation

◆ operator<

bool operator< ( const timestamp ,
const timestamp  
)
friend

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
const timestamp  
)
friend

◆ operator<=

bool operator<= ( const timestamp ,
const timestamp  
)
friend

◆ operator==

bool operator== ( const timestamp ,
const timestamp  
)
friend

◆ operator>

bool operator> ( const timestamp ,
const timestamp  
)
friend

◆ operator>=

bool operator>= ( const timestamp ,
const timestamp  
)
friend

◆ operator>>

std::istream& operator>> ( std::istream &  ,
timestamp  
)
friend

Member Data Documentation

◆ INVALID_PICOSECONDS

const int64_t snemo::datamodel::timestamp::INVALID_PICOSECONDS
static

◆ INVALID_SECONDS

const int64_t snemo::datamodel::timestamp::INVALID_SECONDS
static

◆ IO_FORMAT_CLOSE

const char snemo::datamodel::timestamp::IO_FORMAT_CLOSE
static

◆ IO_FORMAT_INVALID

const char snemo::datamodel::timestamp::IO_FORMAT_INVALID
static

◆ IO_FORMAT_OPEN

const char snemo::datamodel::timestamp::IO_FORMAT_OPEN
static

◆ IO_FORMAT_SEP

const char snemo::datamodel::timestamp::IO_FORMAT_SEP
static

The documentation for this class was generated from the following file: