A class to represent time instant. More...
#include <TimeInstant.h>
Public Member Functions | |
| AbstractData * | clone () const |
| It returns a clone of this object. | |
| Date | getDate () const |
| It returns the date associated to time instant. | |
| DateTimeType | getDateTimeType () const |
| It returns the subtype of the date and time type. | |
| TimeDuration | getTime () const |
| It returns the time duration associated to time instant. | |
| boost::posix_time::ptime & | getTimeInstant () |
| It returns the boost time instant type. | |
| const boost::posix_time::ptime & | getTimeInstant () const |
| It returns the boost time instant type. | |
| int | getTypeCode () const |
| It returns the data type code associated to date and time values: DATETIME_TYPE. | |
| bool | operator!= (const DateTime &rhs) const |
| Operator !=. | |
| long | operator- (const TimeInstant &rhs) const |
| Operator -. | |
| bool | operator< (const DateTime &rhs) const |
| Operator <. | |
| bool | operator== (const DateTime &rhs) const |
| Operator ==. | |
| bool | operator> (const DateTime &rhs) const |
| Operator > | |
| TimeInstant () | |
| Constructor. | |
| TimeInstant (const boost::posix_time::ptime &t) | |
| Constructor. | |
| TimeInstant (const Date &d, const TimeDuration &td) | |
| Constructor from a date and time offset. | |
| TimeInstant (const std::string &dtime) | |
| Constructor. | |
| std::string | toString () const |
| It returns the time instant in the ISO textual format (YYYYMMDDTHHMMSS,fffffffff) where T is the date-time separator. | |
| virtual | ~TimeInstant () |
| Constructor. | |
Static Public Member Functions | |
| static TimeInstant * | now () |
Protected Attributes | |
| boost::posix_time::ptime | m_timeInstant |
| The internal time instant information. | |
A class to represent time instant.
A time instant is a point on the continuous time axis. It 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 instant, by using the data type boost::posix_time::ptime.
Definition at line 55 of file TimeInstant.h.
| te::dt::TimeInstant::TimeInstant | ( | ) |
Constructor.
Referenced by now(), and operator-().
| te::dt::TimeInstant::TimeInstant | ( | const Date & | d, |
| const TimeDuration & | td ) |
Constructor from a date and time offset.
| d | The date. |
| td | Time offset. |
| te::dt::TimeInstant::TimeInstant | ( | const boost::posix_time::ptime & | t | ) |
Constructor.
| t | A time instant. |
| te::dt::TimeInstant::TimeInstant | ( | const std::string & | dtime | ) |
Constructor.
It constructs a time instant from a non delimited ISO form string. Example: 20020131T235959
| dtime | ISO form string |
|
virtual |
Constructor.
Returns an instance of this class initialized with the current date time
|
virtual |
|
inline |
It returns the date associated to time instant.
Definition at line 106 of file TimeInstant.h.
References m_timeInstant.
|
inlinevirtual |
It returns the subtype of the date and time type.
Implements te::dt::DateTime.
Definition at line 179 of file TimeInstant.h.
References te::dt::TIME_INSTANT.
| TimeDuration te::dt::TimeInstant::getTime | ( | ) | const |
It returns the time duration associated to time instant.
|
inline |
It returns the boost time instant type.
Definition at line 99 of file TimeInstant.h.
References m_timeInstant.
|
inline |
It returns the boost time instant type.
Definition at line 92 of file TimeInstant.h.
References m_timeInstant.
|
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.
|
static |
References TimeInstant().
|
virtual |
Operator !=.
| rhs | The time instant to be compared. |
Implements te::dt::DateTime.
| long te::dt::TimeInstant::operator- | ( | const TimeInstant & | rhs | ) | const |
Operator -.
| rhs | The right-hand-side time instant. |
References TimeInstant().
|
virtual |
Operator <.
| rhs | The right-hand-side time instant to be compared. |
Implements te::dt::DateTime.
|
virtual |
Operator ==.
| rhs | The time instant to be compared. |
Implements te::dt::DateTime.
|
virtual |
Operator >
| rhs | The right-hand-side time instant to be compared. |
Implements te::dt::DateTime.
|
virtual |
It returns the time instant in the ISO textual format (YYYYMMDDTHHMMSS,fffffffff) where T is the date-time separator.
Implements te::dt::AbstractData.
|
protected |
The internal time instant information.
Definition at line 189 of file TimeInstant.h.
Referenced by getDate(), getTimeInstant(), and getTimeInstant().