te::dt::DatePeriod Class Reference

A class to represent date period based on the Gregorian Calendar. More...

#include <DatePeriod.h>

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

Public Member Functions

AbstractDataclone () const
 It returns a clone of this object. More...
 
 DatePeriod ()
 Constructor. More...
 
 DatePeriod (const Date &initialDate, const Date &finalDate)
 Constructor. More...
 
 DatePeriod (const boost::gregorian::date_period &dp)
 Constructor. More...
 
 DatePeriod (const boost::gregorian::date &begin, const boost::gregorian::date &end)
 It creates a period as [begin, end). More...
 
const boost::gregorian::date_period & getDatePeriod () const
 It returns the boost date period type. More...
 
boost::gregorian::date_period & getDatePeriod ()
 It returns the boost date period type. More...
 
DateTimeType getDateTimeType () const
 It returns the subtype of the date and time type. More...
 
Date getFinalDate () const
 It gets the final date. More...
 
DateTimeInstantgetFinalInstant () const
 It gets the final date time instant. More...
 
Date getInitialDate () const
 It gets the initial date. More...
 
DateTimeInstantgetInitialInstant () const
 It gets the initial date time instant. 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...
 
std::string toString () const
 It returns the date period in the ISO textual format (YYYYMMDDTYYYYMMDD). More...
 
virtual ~DatePeriod ()
 Destructor. More...
 

Protected Attributes

boost::gregorian::date_period m_datePeriod
 The internal date period information. More...
 

Detailed Description

A class to represent date period based on the Gregorian Calendar.

A class to represent date period based on the Gregorian Calendar. A date period represents a range between two dates. Internally, it uses the datetime boost library to represent gregorian date period, by using the data type boost::gregorian::date_period.

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

Definition at line 51 of file DatePeriod.h.

Constructor & Destructor Documentation

te::dt::DatePeriod::DatePeriod ( )

Constructor.

te::dt::DatePeriod::DatePeriod ( const Date initialDate,
const Date finalDate 
)

Constructor.

Parameters
initialDateAn initial gregorian date.
finalDateAn final gregorian date.
te::dt::DatePeriod::DatePeriod ( const boost::gregorian::date_period &  dp)

Constructor.

Parameters
dpA date period based on the Gregorian Calendar.
te::dt::DatePeriod::DatePeriod ( const boost::gregorian::date &  begin,
const boost::gregorian::date &  end 
)

It creates a period as [begin, end).

Parameters
beginThe initial date.
beginThe final date.
virtual te::dt::DatePeriod::~DatePeriod ( )
virtual

Destructor.

Member Function Documentation

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

It returns a clone of this object.

Returns
A clone of this object.

Implements te::dt::AbstractData.

const boost::gregorian::date_period& te::dt::DatePeriod::getDatePeriod ( ) const
inline

It returns the boost date period type.

Returns
The boost date period type.

Definition at line 86 of file DatePeriod.h.

boost::gregorian::date_period& te::dt::DatePeriod::getDatePeriod ( )
inline

It returns the boost date period type.

Returns
The boost date period type.

Definition at line 93 of file DatePeriod.h.

DateTimeType te::dt::DatePeriod::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 182 of file DatePeriod.h.

References te::dt::DATE_PERIOD.

Date te::dt::DatePeriod::getFinalDate ( ) const

It gets the final date.

Returns
The final date
DateTimeInstant* te::dt::DatePeriod::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.

Date te::dt::DatePeriod::getInitialDate ( ) const

It gets the initial date.

Returns
The initial date
DateTimeInstant* te::dt::DatePeriod::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.

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::DatePeriod::operator!= ( const DateTime rhs) const
virtual

Operator !=.

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

Implements te::dt::DateTime.

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

Operator <.

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

Implements te::dt::DateTime.

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

Operator ==.

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

Implements te::dt::DateTime.

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

Operator >

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

Implements te::dt::DateTime.

std::string te::dt::DatePeriod::toString ( ) const
virtual

It returns the date period in the ISO textual format (YYYYMMDDTYYYYMMDD).

Returns
The date period in the ISO textual format (YYYYMMDDTYYYYMMDD).

Implements te::dt::AbstractData.

Member Data Documentation

boost::gregorian::date_period te::dt::DatePeriod::m_datePeriod
protected

The internal date period information.

Definition at line 191 of file DatePeriod.h.


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