All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::dt::TimePeriodTZ Class Reference

A class to represent time period with time zone. More...

#include <TimePeriodTZ.h>

Inheritance diagram for te::dt::TimePeriodTZ:
te::dt::DateTimePeriod te::dt::DateTime te::dt::AbstractData

Public Member Functions

AbstractDataclone () const
 It returns a clone of this object. More...
 
DateTimeType getDateTimeType () const
 It returns the subtype of the date and time type. More...
 
DateTimeInstantgetFinalInstant () const
 It gets the final date time instant. More...
 
TimeInstantTZ getFinalTimeInstant () const
 It gets the final time instant. More...
 
DateTimeInstantgetInitialInstant () const
 It gets the initial date time instant. More...
 
TimeInstantTZ getInitialTimeInstant () const
 It gets the initial time instant. More...
 
const
boost::local_time::local_time_period & 
getTimePeriodTZ () const
 It returns the boost time period with time zone type. More...
 
boost::local_time::local_time_period & getTimePeriodTZ ()
 It returns the boost time period with time zone 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...
 
 TimePeriodTZ (const TimeInstantTZ &initialTime, const TimeInstantTZ &finalTime)
 Constructor. More...
 
 TimePeriodTZ (const boost::local_time::local_time_period &t)
 Constructor. More...
 
std::string toString () const
 It returns the time period with time zone in the ISO textual format (YYYYMMDDThhmmss±hhmm/YYYYMMDDThhmmss±hhmm). More...
 
virtual ~TimePeriodTZ ()
 Destructor. More...
 

Protected Attributes

boost::local_time::local_time_period m_timePeriodTZ
 Time period with time zone information. More...
 

Detailed Description

A class to represent time period with time zone.

A time period is a part of the continous time axis limited by two time instants with time zone. Each time instant with time zone is composed of a date that uses the Gregorian calendar and of a time with an associated time zone. Internally, it uses the datetime boost library to represent time period with time zone, by using the data type boost::local_time::local_time_period.

See also
DateTime, Date, DatePeriod, DateDuration, TimeInstant, TimeInstantTZ, TimePeriod, TimeDuration

Definition at line 54 of file TimePeriodTZ.h.

Constructor & Destructor Documentation

te::dt::TimePeriodTZ::TimePeriodTZ ( const TimeInstantTZ initialTime,
const TimeInstantTZ finalTime 
)

Constructor.

Parameters
initialTimeA initial time instant.
finalTimeA final time instant.

Definition at line 30 of file TimePeriodTZ.cpp.

te::dt::TimePeriodTZ::TimePeriodTZ ( const boost::local_time::local_time_period &  t)

Constructor.

Parameters
tA time period with time zone.

Definition at line 35 of file TimePeriodTZ.cpp.

te::dt::TimePeriodTZ::~TimePeriodTZ ( )
virtual

Destructor.

Definition at line 104 of file TimePeriodTZ.cpp.

Member Function Documentation

te::dt::AbstractData * te::dt::TimePeriodTZ::clone ( ) const
virtual

It returns a clone of this object.

Returns
A clone of this object.

Implements te::dt::AbstractData.

Definition at line 84 of file TimePeriodTZ.cpp.

DateTimeType te::dt::TimePeriodTZ::getDateTimeType ( ) const
inlinevirtual

It returns the subtype of the date and time type.

Returns
The subtype of the date and time type.

Implements te::dt::DateTime.

Definition at line 174 of file TimePeriodTZ.h.

References te::dt::TIME_PERIOD_TZ.

te::dt::DateTimeInstant * te::dt::TimePeriodTZ::getFinalInstant ( ) const
virtual

It gets the final date time instant.

Returns
The final time instant
Note
The caller will take the ownership of the returned pointer.

Implements te::dt::DateTimePeriod.

Definition at line 55 of file TimePeriodTZ.cpp.

te::dt::TimeInstantTZ te::dt::TimePeriodTZ::getFinalTimeInstant ( ) const

It gets the final time instant.

Returns
The final time instant

Definition at line 45 of file TimePeriodTZ.cpp.

te::dt::DateTimeInstant * te::dt::TimePeriodTZ::getInitialInstant ( ) const
virtual

It gets the initial date time instant.

Returns
The initial time instant
Note
The caller will take the ownership of the returned pointer.

Implements te::dt::DateTimePeriod.

Definition at line 50 of file TimePeriodTZ.cpp.

te::dt::TimeInstantTZ te::dt::TimePeriodTZ::getInitialTimeInstant ( ) const

It gets the initial time instant.

Returns
The initial time instant

Definition at line 40 of file TimePeriodTZ.cpp.

const boost::local_time::local_time_period& te::dt::TimePeriodTZ::getTimePeriodTZ ( ) const
inline

It returns the boost time period with time zone type.

Returns
The boost time period with time zone type.

Definition at line 78 of file TimePeriodTZ.h.

boost::local_time::local_time_period& te::dt::TimePeriodTZ::getTimePeriodTZ ( )
inline

It returns the boost time period with time zone type.

Returns
The boost time period with time zone type.

Definition at line 85 of file TimePeriodTZ.h.

int te::dt::DateTime::getTypeCode ( ) const
inlinevirtualinherited

It returns the data type code associated to date and time values: DATETIME_TYPE.

Returns
The data type code associated to the date and time values: DATETIME_TYPE.

Implements te::dt::AbstractData.

Definition at line 103 of file DateTime.h.

References te::dt::DATETIME_TYPE.

bool te::dt::TimePeriodTZ::operator!= ( const DateTime rhs) const
virtual

Operator !=.

Parameters
rhsThe time period to be compared.
Returns
It returns true if the two time periods are not equal. Otherwise, it returns false.

Implements te::dt::DateTime.

Definition at line 66 of file TimePeriodTZ.cpp.

References m_timePeriodTZ.

bool te::dt::TimePeriodTZ::operator< ( const DateTime rhs) const
virtual

Operator <.

Parameters
rhsThe right-hand-side time period to be compared.
Returns
It returns true if the right-hand-side time period is greater than the lefth side one. Otherwise, it returns false.

Implements te::dt::DateTime.

Definition at line 72 of file TimePeriodTZ.cpp.

References m_timePeriodTZ.

bool te::dt::TimePeriodTZ::operator== ( const DateTime rhs) const
virtual

Operator ==.

Parameters
rhsThe time period to be compared.
Returns
It returns true if the two time period are equal. Otherwise, it returns false.

Implements te::dt::DateTime.

Definition at line 60 of file TimePeriodTZ.cpp.

References m_timePeriodTZ.

bool te::dt::TimePeriodTZ::operator> ( const DateTime rhs) const
virtual

Operator >

Parameters
rhsThe right-hand-side time period to be compared.
Returns
It returns true if the right-hand-side time period is less than the lefth side one. Otherwise, it returns false.

Implements te::dt::DateTime.

Definition at line 78 of file TimePeriodTZ.cpp.

References m_timePeriodTZ.

std::string te::dt::TimePeriodTZ::toString ( void  ) const
virtual

It returns the time period with time zone in the ISO textual format (YYYYMMDDThhmmss±hhmm/YYYYMMDDThhmmss±hhmm).

Returns
The time period with time zone in the ISO textual format (YYYYMMDDThhmmss±hhmm/YYYYMMDDThhmmss±hhmm).

Implements te::dt::AbstractData.

Definition at line 89 of file TimePeriodTZ.cpp.

Member Data Documentation

boost::local_time::local_time_period te::dt::TimePeriodTZ::m_timePeriodTZ
protected

Time period with time zone information.

Definition at line 183 of file TimePeriodTZ.h.

Referenced by operator!=(), operator<(), operator==(), and operator>().


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