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 void                              ;
  typedef T                                 ;               
  typedef rep_type                          ;                 
  typedef                 ;                    
  typedef                ;                   
  typedef                 ;                    
  typedef                 ;                    
  typedef  ;     
  typedef                ;                   
  typedef                ;                   

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

  // public member functions
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR duration_type () ;
  BOOST_CXX14_CONSTEXPR duration_type () ;
  BOOST_CONSTEXPR bool () ;
  BOOST_CONSTEXPR bool () ;
  BOOST_CONSTEXPR bool () ;
  BOOST_CONSTEXPR bool (const time_duration &) ;
  BOOST_CONSTEXPR bool (const time_duration &) ;
  BOOST_CONSTEXPR duration_type () ;
  BOOST_CONSTEXPR duration_type (const duration_type &) ;
  BOOST_CONSTEXPR duration_type (const duration_type &) ;
  BOOST_CONSTEXPR duration_type (int) ;
  BOOST_CXX14_CONSTEXPR duration_type (const duration_type &);
  BOOST_CXX14_CONSTEXPR duration_type (const duration_type &);
  BOOST_CXX14_CONSTEXPR duration_type (int);
  BOOST_CXX14_CONSTEXPR duration_type (int) ;
  BOOST_CXX14_CONSTEXPR duration_type (int);
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CONSTEXPR  () ;

  // public static functions
  BOOST_CXX14_CONSTEXPR duration_type ();
  BOOST_CXX14_CONSTEXPR  ();
  BOOST_CXX14_CONSTEXPR  ();
  BOOST_CXX14_CONSTEXPR unsigned short ();
};

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

time_duration public static functions

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

PrevUpHomeNext