A class to represent date period based on the Gregorian Calendar. More...
#include <DatePeriod.h>
Public Member Functions | |
AbstractData * | clone () 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... | |
DateTimeInstant * | getFinalInstant () const |
It gets the final date time instant. More... | |
Date | getInitialDate () const |
It gets the initial date. More... | |
DateTimeInstant * | getInitialInstant () 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... | |
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.
Definition at line 51 of file DatePeriod.h.
te::dt::DatePeriod::DatePeriod | ( | ) |
Constructor.
Definition at line 30 of file DatePeriod.cpp.
Constructor.
initialDate | An initial gregorian date. |
finalDate | An final gregorian date. |
Definition at line 35 of file DatePeriod.cpp.
te::dt::DatePeriod::DatePeriod | ( | const boost::gregorian::date_period & | dp | ) |
Constructor.
dp | A date period based on the Gregorian Calendar. |
Definition at line 40 of file DatePeriod.cpp.
te::dt::DatePeriod::DatePeriod | ( | const boost::gregorian::date & | begin, |
const boost::gregorian::date & | end | ||
) |
It creates a period as [begin, end).
begin | The initial date. |
begin | The final date. |
Definition at line 45 of file DatePeriod.cpp.
|
virtual |
Destructor.
Definition at line 106 of file DatePeriod.cpp.
|
virtual |
It returns a clone of this object.
Implements te::dt::AbstractData.
Definition at line 94 of file DatePeriod.cpp.
|
inline |
It returns the boost date period type.
Definition at line 86 of file DatePeriod.h.
|
inline |
It returns the boost date period type.
Definition at line 93 of file DatePeriod.h.
|
inlinevirtual |
It 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.
te::dt::Date te::dt::DatePeriod::getFinalDate | ( | ) | const |
|
virtual |
It gets the final date time instant.
Implements te::dt::DateTimePeriod.
Definition at line 65 of file DatePeriod.cpp.
te::dt::Date te::dt::DatePeriod::getInitialDate | ( | ) | const |
|
virtual |
It gets the initial date time instant.
Implements te::dt::DateTimePeriod.
Definition at line 60 of file DatePeriod.cpp.
|
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 date period to be compared. |
Implements te::dt::DateTime.
Definition at line 76 of file DatePeriod.cpp.
References m_datePeriod.
|
virtual |
Operator <.
rhs | The right side date period to be compared. |
Implements te::dt::DateTime.
Definition at line 82 of file DatePeriod.cpp.
References m_datePeriod.
|
virtual |
Operator ==.
rhs | The date period to be compared. |
Implements te::dt::DateTime.
Definition at line 70 of file DatePeriod.cpp.
References m_datePeriod.
|
virtual |
Operator >
rhs | The right side date period to be compared. |
Implements te::dt::DateTime.
Definition at line 88 of file DatePeriod.cpp.
References m_datePeriod.
|
virtual |
It returns the date period in the ISO textual format (YYYYMMDDTYYYYMMDD).
Implements te::dt::AbstractData.
Definition at line 99 of file DatePeriod.cpp.
|
protected |
The internal date period information.
Definition at line 191 of file DatePeriod.h.
Referenced by operator!=(), operator<(), operator==(), and operator>().