Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template time_duration

boost::date_time::time_duration — Represents some amount of elapsed time measure to a given resolution.

Synopsis

// In header: <boost/date_time/time_duration.hpp>

template<typename T, typename rep_type> 
class time_duration : private  {
public:
  // types
  typedef                               ;
  typedef                                  ;               
  typedef                           ;                 
  typedef                 ;                    
  typedef                ;                   
  typedef                 ;                    
  typedef                 ;                    
  typedef  ;     
  typedef                ;                   
  typedef                ;                   

  // construct/copy/destruct
  ();
  (, ,  = ,  = );
  ();
  ();

  // public member functions
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;
   (time_duration &) ;
   (time_duration &) ;
   () ;
   () ;
   () ;
   () ;
   ();
   ();
   ();
   () ;
   ();
   () ;
   () ;
   () ;
   () ;
   () ;
   () ;

  // public static functions
   ();
   ();
   ();
   ();
};

Description

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.

Template Parameters

  1. typename T

    The subclass type

  2. typename rep_type

    The time resolution traits for this duration type.

time_duration public construct/copy/destruct

  1. ();
  2. ( hours_in,  minutes_in,  seconds_in = , 
                   frac_sec_in = );
  3. ( sv);
    Construct from special_values.
  4. ( in);

time_duration public member functions

  1.  () ;
    Returns number of hours in the duration.
  2.  () ;
    Returns normalized number of minutes.
  3.  () ;
    Returns normalized number of seconds (0..60)
  4.  () ;
    Returns total number of seconds truncating any fractional seconds.
  5.  () ;
    Returns total number of milliseconds truncating any fractional seconds.
  6.  () ;
    Returns total number of nanoseconds truncating any sub millisecond values.
  7.  () ;
    Returns total number of microseconds truncating any sub microsecond values.
  8.  () ;
    Returns count of fractional seconds at given resolution.
  9.  () ;
  10.  () ;
  11.  () ;
  12.  () ;
  13.  () ;
  14.  (time_duration & rhs) ;
  15.  (time_duration & rhs) ;
  16.  () ;
    unary- Allows for time_duration td = -td1
  17.  ( d) ;
  18.  ( d) ;
  19.  ( divisor) ;
  20.  ( d);
  21.  ( d);
  22.  ( divisor);
    Division operations on a duration with an integer.
  23.  ( rhs) ;
    Multiplication operations an a duration with an integer.
  24.  ( divisor);
  25.  () ;
  26.  () ;
    Is ticks_ a special value?
  27.  () ;
    Is duration pos-infinity.
  28.  () ;
    Is duration neg-infinity.
  29.  () ;
    Is duration not-a-date-time.
  30.  () ;
    Used for special_values output.

time_duration public static functions

  1.  ();
    Returns smallest representable duration.
  2.  ();
    Return the number of ticks in a second.
  3.  ();
    Provide the resolution of this duration type.
  4.  ();
    Returns number of possible digits in fractional seconds.

PrevUpHomeNext