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 (const boost::gregorian::date_duration &dd)
 Constructor. More...
 
 DateDuration (const te::dt::DateDuration &rhs)
 Copy Constructor. More...
 
 DateDuration (long dd)
 Constructor. More...
 
boost::gregorian::date_duration & getDateDuration ()
 It returns the boost date duration type. More...
 
const boost::gregorian::date_duration & getDateDuration () const
 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...
 
DateDurationoperator= (const DateDuration &date)
 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

std::unique_ptr< DateDurationImpl > m_dateDurationImpl
 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 59 of file DateDuration.h.

Constructor & Destructor Documentation

◆ DateDuration() [1/4]

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

Empty constructor.

◆ DateDuration() [2/4]

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

Constructor.

Parameters
ddA date duration in days.

◆ DateDuration() [3/4]

te::dt::DateDuration::DateDuration ( const boost::gregorian::date_duration &  dd)

Constructor.

Parameters
ddA date duration.

◆ DateDuration() [4/4]

te::dt::DateDuration::DateDuration ( const te::dt::DateDuration rhs)

Copy Constructor.

◆ ~DateDuration()

virtual te::dt::DateDuration::~DateDuration ( )
virtual

Destructor.

Member Function Documentation

◆ clone()

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

It returns a clone of this object.

Returns
A clone of this object.

Implements te::dt::AbstractData.

◆ getDateDuration() [1/2]

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

It returns the boost date duration type.

Returns
The boost date duration type.

◆ getDateDuration() [2/2]

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

It returns the boost date duration type.

Returns
The boost date duration type.

◆ getDateTimeType()

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 163 of file DateDuration.h.

References te::dt::DATE_DURATION.

◆ getTypeCode()

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.

◆ operator!=()

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.

◆ operator<()

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.

◆ operator=()

DateDuration& te::dt::DateDuration::operator= ( const DateDuration date)

Operator =.

Parameters
rhsThe date to be assigned.
Returns
It returns the new value for the assigned object

◆ operator==()

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.

◆ operator>()

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.

◆ toString()

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

◆ m_dateDurationImpl

std::unique_ptr<DateDurationImpl> te::dt::DateDuration::m_dateDurationImpl
protected

Date duration information.

Definition at line 172 of file DateDuration.h.


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