Logo Search packages:      
Sourcecode: passenger version File versions  Download package

boost::date_time::time_duration< T, rep_type > Class Template Reference

#include <time_duration.hpp>

Inheritance diagram for boost::date_time::time_duration< T, rep_type >:

boost::posix_time::time_duration boost::posix_time::hours boost::posix_time::minutes boost::posix_time::seconds

List of all members.

Detailed Description

template<class T, typename rep_type>
class boost::date_time::time_duration< T, rep_type >

Represents some amount of elapsed time measure to a given resolution.

This class represents a standard set of capabilities for all counted time durations. Time duration implementations should derive from this class passing their type as the first template parameter. This design allows the subclass duration types to provide custom construction policies or other custom features not provided here.

T The subclass type
rep_type The time resolution traits for this duration type.

Definition at line 32 of file time_duration.hpp.

Public Types

typedef rep_type::day_type day_type
typedef T duration_type
typedef rep_type::hour_type hour_type
typedef rep_type::impl_type impl_type
typedef rep_type::min_type min_type
typedef rep_type::sec_type sec_type
typedef rep_type::tick_type tick_type
typedef rep_type traits_type

Public Member Functions

fractional_seconds_type fractional_seconds () const
 Returns count of fractional seconds at given resolution.
impl_type get_rep () const
 Used for special_values output.
hour_type hours () const
 Returns number of hours in the duration.
duration_type invert_sign () const
bool is_neg_infinity () const
 Is duration neg-infinity.
bool is_negative () const
bool is_not_a_date_time () const
 Is duration not-a-date-time.
bool is_pos_infinity () const
 Is duration pos-infinity.
bool is_special () const
 Is ticks_ a special value?
min_type minutes () const
 Returns normalized number of minutes.
duration_type operator* (int rhs) const
 Multiplication operations an a duration with an integer.
duration_type operator*= (int divisor)
duration_type operator+ (const duration_type &d) const
duration_type operator+= (const duration_type &d)
duration_type operator- (const duration_type &d) const
duration_type operator- () const
 unary- Allows for time_duration td = -td1
duration_type operator-= (const duration_type &d)
duration_type operator/ (int divisor) const
duration_type operator/= (int divisor)
 Division operations on a duration with an integer.
bool operator< (const time_duration &rhs) const
bool operator== (const time_duration &rhs) const
sec_type seconds () const
 Returns normalized number of seconds (0..60).
tick_type ticks () const
 time_duration (special_values sv)
 Construct from special_values.
 time_duration (const time_duration< T, rep_type > &other)
 Construct from another time_duration (Copy constructor).
 time_duration (hour_type hours_in, min_type minutes_in, sec_type seconds_in=0, fractional_seconds_type frac_sec_in=0)
tick_type total_microseconds () const
 Returns total number of microseconds truncating any sub microsecond values.
tick_type total_milliseconds () const
 Returns total number of milliseconds truncating any fractional seconds.
tick_type total_nanoseconds () const
 Returns total number of nanoseconds truncating any sub millisecond values.
sec_type total_seconds () const
 Returns total number of seconds truncating any fractional seconds.

Static Public Member Functions

static unsigned short num_fractional_digits ()
 Returns number of possible digits in fractional seconds.
static time_resolutions resolution ()
 Provide the resolution of this duration type.
static tick_type ticks_per_second ()
 Return the number of ticks in a second.
static duration_type unit ()
 Returns smallest representable duration.

Protected Member Functions

 time_duration (impl_type in)

Protected Attributes

impl_type ticks_

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

Generated by  Doxygen 1.6.0   Back to index