Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::date_time::date_duration< duration_rep_traits > Class Template Reference

Duration type with date level resolution. More...

#include <date_duration.hpp>

Inheritance diagram for boost::date_time::date_duration< duration_rep_traits >:
Collaboration diagram for boost::date_time::date_duration< duration_rep_traits >:

Public Types

typedef
duration_rep_traits::int_type 
duration_rep_type
 
typedef
duration_rep_traits::impl_type 
duration_rep
 

Public Member Functions

 date_duration (duration_rep day_count)
 Construct from a day count. More...
 
 date_duration (special_values sv)
 construct from special_values - only works when instantiated with duration_traits_adapted More...
 
 date_duration (const date_duration< duration_rep_traits > &other)
 Construct from another date_duration (Copy Constructor) More...
 
duration_rep get_rep () const
 returns days_ as it's instantiated type - used for streaming More...
 
bool is_special () const
 
duration_rep_type days () const
 returns days as value, not object. More...
 
bool operator== (const date_duration &rhs) const
 Equality. More...
 
bool operator< (const date_duration &rhs) const
 Less. More...
 
date_durationoperator-= (const date_duration &rhs)
 Subtract another duration – result is signed. More...
 
date_durationoperator+= (const date_duration &rhs)
 Add a duration – result is signed. More...
 
date_duration operator- () const
 unary- Allows for dd = -date_duration(2); -> dd == -2 More...
 
date_durationoperator/= (int divisor)
 Division operations on a duration with an integer. More...
 
bool is_negative () const
 return sign information More...
 

Static Public Member Functions

static date_duration unit ()
 Returns the smallest duration – used by to calculate 'end'. More...
 

Detailed Description

template<class duration_rep_traits>
class boost::date_time::date_duration< duration_rep_traits >

Duration type with date level resolution.

Member Typedef Documentation

template<class duration_rep_traits>
typedef duration_rep_traits::impl_type boost::date_time::date_duration< duration_rep_traits >::duration_rep
template<class duration_rep_traits>
typedef duration_rep_traits::int_type boost::date_time::date_duration< duration_rep_traits >::duration_rep_type

Constructor & Destructor Documentation

template<class duration_rep_traits>
boost::date_time::date_duration< duration_rep_traits >::date_duration ( duration_rep  day_count)
inlineexplicit

Construct from a day count.

template<class duration_rep_traits>
boost::date_time::date_duration< duration_rep_traits >::date_duration ( special_values  sv)
inline

construct from special_values - only works when instantiated with duration_traits_adapted

template<class duration_rep_traits>
boost::date_time::date_duration< duration_rep_traits >::date_duration ( const date_duration< duration_rep_traits > &  other)
inline

Construct from another date_duration (Copy Constructor)

Member Function Documentation

template<class duration_rep_traits>
bool boost::date_time::date_duration< duration_rep_traits >::is_negative ( ) const
inline

return sign information

template<class duration_rep_traits>
date_duration& boost::date_time::date_duration< duration_rep_traits >::operator+= ( const date_duration< duration_rep_traits > &  rhs)
inline

Add a duration – result is signed.

template<class duration_rep_traits>
date_duration boost::date_time::date_duration< duration_rep_traits >::operator- ( ) const
inline

unary- Allows for dd = -date_duration(2); -> dd == -2

template<class duration_rep_traits>
date_duration& boost::date_time::date_duration< duration_rep_traits >::operator-= ( const date_duration< duration_rep_traits > &  rhs)
inline

Subtract another duration – result is signed.

template<class duration_rep_traits>
date_duration& boost::date_time::date_duration< duration_rep_traits >::operator/= ( int  divisor)
inline

Division operations on a duration with an integer.

template<class duration_rep_traits>
bool boost::date_time::date_duration< duration_rep_traits >::operator< ( const date_duration< duration_rep_traits > &  rhs) const
inline

Less.

template<class duration_rep_traits>
bool boost::date_time::date_duration< duration_rep_traits >::operator== ( const date_duration< duration_rep_traits > &  rhs) const
inline

Equality.

template<class duration_rep_traits>
static date_duration boost::date_time::date_duration< duration_rep_traits >::unit ( )
inlinestatic

Returns the smallest duration – used by to calculate 'end'.


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