A class to represent time period. More...
#include <TimePeriod.h>
Public Member Functions | |
AbstractData * | clone () const |
It returns a clone of this object. More... | |
DateTimeType | getDateTimeType () const |
It returns the subtype of the date and time type. More... | |
DateTimeInstant * | getFinalInstant () const |
It gets the final date time instant. More... | |
TimeInstant | getFinalTimeInstant () const |
It gets the final time instant. More... | |
DateTimeInstant * | getInitialInstant () const |
It gets the initial date time instant. More... | |
TimeInstant | getInitialTimeInstant () const |
It gets the initial time instant. More... | |
const boost::posix_time::time_period & | getTimePeriod () const |
Assignment operator. More... | |
boost::posix_time::time_period & | getTimePeriod () |
It returns the boost time period type. More... | |
int | getTypeCode () const |
It returns the data type code associated to date and time values: DATETIME_TYPE. More... | |
bool | operator!= (const DateTime &rhs) const |
Operator !=. More... | |
bool | operator< (const DateTime &rhs) const |
Operator <. More... | |
bool | operator== (const DateTime &rhs) const |
Operator ==. More... | |
bool | operator> (const DateTime &rhs) const |
Operator > More... | |
TimePeriod () | |
Constructor. More... | |
TimePeriod (const TimeInstant &initialTime, const TimeInstant &finalTime) | |
Constructor. More... | |
TimePeriod (const boost::posix_time::time_period &t) | |
Constructor. More... | |
std::string | toString () const |
It returns the time period in the ISO textual format (YYYYMMDDThhmmss/YYYYMMDDThhmmss). More... | |
virtual | ~TimePeriod () |
Destructor. More... | |
Protected Attributes | |
boost::posix_time::time_period | m_timePeriod |
Time period information. More... | |
A class to represent time period.
A time period is a part of the continous time axis limited by two time instants or points. Each time instant is composed of a date that uses the Gregorian calendar and of a local time. Internally, it uses the datetime boost library to represent time period, by using the data type boost::posix_time::time_period.
Definition at line 54 of file TimePeriod.h.
te::dt::TimePeriod::TimePeriod | ( | ) |
Constructor.
te::dt::TimePeriod::TimePeriod | ( | const TimeInstant & | initialTime, |
const TimeInstant & | finalTime | ||
) |
Constructor.
initialTime | A initial time instant. |
finalTime | A final time instant. |
te::dt::TimePeriod::TimePeriod | ( | const boost::posix_time::time_period & | t | ) |
Constructor.
t | A time period. |
|
virtual |
Destructor.
|
virtual |
|
inlinevirtual |
It returns the subtype of the date and time type.
Implements te::dt::DateTime.
Definition at line 182 of file TimePeriod.h.
References te::dt::TIME_PERIOD.
|
virtual |
It gets the final date time instant.
Implements te::dt::DateTimePeriod.
TimeInstant te::dt::TimePeriod::getFinalTimeInstant | ( | ) | const |
It gets the final time instant.
|
virtual |
It gets the initial date time instant.
Implements te::dt::DateTimePeriod.
TimeInstant te::dt::TimePeriod::getInitialTimeInstant | ( | ) | const |
It gets the initial time instant.
|
inline |
Assignment operator.
It returns the boost time period type.
Definition at line 86 of file TimePeriod.h.
|
inline |
It returns the boost time period type.
Definition at line 93 of file TimePeriod.h.
References operator!=(), operator<(), operator==(), and operator>().
|
inlinevirtualinherited |
It returns the data type code associated to date and time values: DATETIME_TYPE.
Implements te::dt::AbstractData.
Definition at line 103 of file DateTime.h.
References te::dt::DATETIME_TYPE.
|
virtual |
Operator !=.
rhs | The time period to be compared. |
Implements te::dt::DateTime.
|
virtual |
Operator <.
rhs | The right-hand-side time period to be compared. |
Implements te::dt::DateTime.
|
virtual |
Operator ==.
rhs | The time period to be compared. |
Implements te::dt::DateTime.
|
virtual |
Operator >
rhs | The right-hand-side time period to be compared. |
Implements te::dt::DateTime.
|
virtual |
It returns the time period in the ISO textual format (YYYYMMDDThhmmss/YYYYMMDDThhmmss).
Implements te::dt::AbstractData.
|
protected |
Time period information.
Definition at line 191 of file TimePeriod.h.