te::dt::DateDuration Class Reference

A class to represent date duration. More...

#include <DateDuration.h>

Inheritance diagram for te::dt::DateDuration:
te::dt::DateTime te::dt::AbstractData

Public Member Functions

AbstractDataclone () const
 It returns a clone of this object. More...
 
 DateDuration ()
 Empty constructor. More...
 
 DateDuration (long dd)
 Constructor. More...
 
 DateDuration (const boost::gregorian::date_duration &dd)
 Constructor. More...
 
const boost::gregorian::date_duration & getDateDuration () const
 It returns the boost date duration type. More...
 
boost::gregorian::date_duration & getDateDuration ()
 It returns the boost date duration type. More...
 
DateTimeType getDateTimeType () const
 It returns the subtype of the date and time 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...
 
std::string toString () const
 It returns the date duration in a textual format. More...
 
virtual ~DateDuration ()
 Destructor. More...
 

Protected Attributes

boost::gregorian::date_duration m_dateDuration
 Date duration information. More...
 

Detailed Description

A class to represent date duration.

A date duration is a simple day count used for arithmetic with date, based on the Gregorian Calendar. Internally, it uses the datetime boost library to represent gregorian date duration, by using the data type boost::gregorian::date_duration.

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

Definition at line 51 of file DateDuration.h.

Constructor & Destructor Documentation

te::dt::DateDuration::DateDuration ( )

Empty constructor.

te::dt::DateDuration::DateDuration ( long  dd)

Constructor.

Parameters
ddA date duration in days.
te::dt::DateDuration::DateDuration ( const boost::gregorian::date_duration &  dd)

Constructor.

Parameters
ddA date duration.
virtual te::dt::DateDuration::~DateDuration ( )
virtual

Destructor.

Member Function Documentation

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

It returns a clone of this object.

Returns
A clone of this object.

Implements te::dt::AbstractData.

const boost::gregorian::date_duration& te::dt::DateDuration::getDateDuration ( ) const
inline

It returns the boost date duration type.

Returns
The boost date duration type.

Definition at line 77 of file DateDuration.h.

boost::gregorian::date_duration& te::dt::DateDuration::getDateDuration ( )
inline

It returns the boost date duration type.

Returns
The boost date duration type.

Definition at line 84 of file DateDuration.h.

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

References te::dt::DATE_DURATION.

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

Operator !=.

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

Implements te::dt::DateTime.

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

Operator <.

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

Implements te::dt::DateTime.

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

Operator ==.

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

Implements te::dt::DateTime.

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

Operator >

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

Implements te::dt::DateTime.

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

It returns the date duration in a textual format.

Returns
The date duration in a textual format.

Implements te::dt::AbstractData.

Member Data Documentation

boost::gregorian::date_duration te::dt::DateDuration::m_dateDuration
protected

Date duration information.

Definition at line 150 of file DateDuration.h.


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