OpenDaVINCI  4.15.3
odcore::data::TimeStamp Class Reference

#include <TimeStamp.h>

Inheritance diagram for odcore::data::TimeStamp:
Inheritance graph

Public Member Functions

 TimeStamp ()
 
 TimeStamp (const int32_t &seconds, const int32_t &microseconds)
 
virtual ~TimeStamp ()
 
 TimeStamp (const string &ddmmyyyyhhmmss)
 
 TimeStamp (const TimeStamp &obj)
 
 TimeStamp (const TimePoint &obj)
 
TimeStampoperator= (const TimeStamp &obj)
 
TimeStamp operator+ (const TimeStamp &t) const
 
TimeStamp operator- (const TimeStamp &t) const
 
bool operator== (const TimeStamp &t) const
 
bool operator!= (const TimeStamp &t) const
 
bool operator< (const TimeStamp &t) const
 
bool operator> (const TimeStamp &t) const
 
bool operator<= (const TimeStamp &t) const
 
bool operator>= (const TimeStamp &t) const
 
int64_t toMicroseconds () const
 
int32_t getFractionalMicroseconds () const
 
uint32_t getHour () const
 
uint32_t getMinute () const
 
uint32_t getSecond () const
 
uint32_t getDay () const
 
uint32_t getMonth () const
 
uint32_t getYear () const
 
const string getYYYYMMDD_HHMMSS () const
 
const string getYYYYMMDD_HHMMSS_noBlank () const
 
const string getYYYYMMDD_HHMMSS_noBlankNoColons () const
 
const string getYYYYMMDD_HHMMSSms () const
 

Friends

class Container
 

Detailed Description

This class can be used for time computations.

Constructor & Destructor Documentation

odcore::data::TimeStamp::TimeStamp ( )
odcore::data::TimeStamp::TimeStamp ( const int32_t &  seconds,
const int32_t &  microseconds 
)

Constructor.

Parameters
secondsSeconds.
microsecondsMicroseconds.
odcore::data::TimeStamp::~TimeStamp ( )
virtual
odcore::data::TimeStamp::TimeStamp ( const string &  ddmmyyyyhhmmss)

Constructor.

Parameters
ddmmyyyyhhmmssDDMMYYYYHHMMSS.
odcore::data::TimeStamp::TimeStamp ( const TimeStamp obj)

Copy constructor.

Parameters
objReference to an object of this class.
odcore::data::TimeStamp::TimeStamp ( const TimePoint obj)

Copy constructor.

Parameters
objReference to an object of this class.

Member Function Documentation

uint32_t odcore::data::TimeStamp::getDay ( ) const

This method returns the day for today since 01.01.1970.

Returns
Day for today.

Referenced by getYYYYMMDD_HHMMSS(), getYYYYMMDD_HHMMSS_noBlank(), and getYYYYMMDD_HHMMSS_noBlankNoColons().

int32_t odcore::data::TimeStamp::getFractionalMicroseconds ( ) const

This method returns the fractional microseconds to the next full second.

Returns
microseconds.

Referenced by operator+(), operator-(), toMicroseconds(), and odcore::base::Thread::usleepUntil().

uint32_t odcore::data::TimeStamp::getHour ( ) const

This method returns the hour for today since 01.01.1970.

Returns
Hour for today.

Referenced by getYYYYMMDD_HHMMSS(), getYYYYMMDD_HHMMSS_noBlank(), and getYYYYMMDD_HHMMSS_noBlankNoColons().

uint32_t odcore::data::TimeStamp::getMinute ( ) const

This method returns the minute for today since 01.01.1970.

Returns
Minute for today.

Referenced by getYYYYMMDD_HHMMSS(), getYYYYMMDD_HHMMSS_noBlank(), and getYYYYMMDD_HHMMSS_noBlankNoColons().

uint32_t odcore::data::TimeStamp::getMonth ( ) const

This method returns the minute for today since 01.01.1970.

Returns
Month for today.

Referenced by getYYYYMMDD_HHMMSS(), getYYYYMMDD_HHMMSS_noBlank(), and getYYYYMMDD_HHMMSS_noBlankNoColons().

uint32_t odcore::data::TimeStamp::getSecond ( ) const

This method returns the seconds for today since 01.01.1970.

Returns
Seconds for today.

Referenced by getYYYYMMDD_HHMMSS(), getYYYYMMDD_HHMMSS_noBlank(), and getYYYYMMDD_HHMMSS_noBlankNoColons().

uint32_t odcore::data::TimeStamp::getYear ( ) const

This method returns the seconds for today since 01.01.1970.

Returns
Year for today.

Referenced by getYYYYMMDD_HHMMSS(), getYYYYMMDD_HHMMSS_noBlank(), and getYYYYMMDD_HHMMSS_noBlankNoColons().

const string odcore::data::TimeStamp::getYYYYMMDD_HHMMSS ( ) const

This method returns this time in the following format: YYYY-MM-DD HH:MM:SS

Returns
Time in the given specified format.

References getDay(), getHour(), getMinute(), getMonth(), getSecond(), and getYear().

Referenced by getYYYYMMDD_HHMMSSms().

const string odcore::data::TimeStamp::getYYYYMMDD_HHMMSS_noBlank ( ) const

This method returns this time in the following format: YYYY-MM-DD_HH:MM:SS

Returns
Time in the given specified format.

References getDay(), getHour(), getMinute(), getMonth(), getSecond(), and getYear().

const string odcore::data::TimeStamp::getYYYYMMDD_HHMMSS_noBlankNoColons ( ) const

This method returns this time in the following format: YYYY-MM-DD_HHMMSS

Returns
Time in the given specified format.

References getDay(), getHour(), getMinute(), getMonth(), getSecond(), and getYear().

const string odcore::data::TimeStamp::getYYYYMMDD_HHMMSSms ( ) const

This method returns this time in the following format: YYYY-MM-DD HH:MM:SS.ms

Returns
Time in the given specified format.

References getYYYYMMDD_HHMMSS().

bool odcore::data::TimeStamp::operator!= ( const TimeStamp t) const

References toMicroseconds().

TimeStamp odcore::data::TimeStamp::operator+ ( const TimeStamp t) const

Add operator.

Parameters
objReference to an object of this class.
Returns
Reference to this instance.

References getFractionalMicroseconds(), and TimeStamp().

TimeStamp odcore::data::TimeStamp::operator- ( const TimeStamp t) const

Subtract operator.

Parameters
objReference to an object of this class.
Returns
Reference to this instance.

References getFractionalMicroseconds(), and TimeStamp().

bool odcore::data::TimeStamp::operator< ( const TimeStamp t) const

References toMicroseconds().

bool odcore::data::TimeStamp::operator<= ( const TimeStamp t) const

References toMicroseconds().

TimeStamp & odcore::data::TimeStamp::operator= ( const TimeStamp obj)

Assignment operator.

Parameters
objReference to an object of this class.
Returns
Reference to this instance.
bool odcore::data::TimeStamp::operator== ( const TimeStamp t) const

References toMicroseconds().

bool odcore::data::TimeStamp::operator> ( const TimeStamp t) const

References toMicroseconds().

bool odcore::data::TimeStamp::operator>= ( const TimeStamp t) const

References toMicroseconds().

Friends And Related Function Documentation

friend class Container
friend