Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template base_time

boost::date_time::base_time — Representation of a precise moment in time, including the date.

Synopsis

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

template<typename T, typename time_system> 
class base_time : private  {
public:
  // types
  typedef void                            ;
  typedef T                               ;                     
  typedef       ;                 
  typedef           ;                     
  typedef  ;            
  typedef  ;            

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

  // public member functions
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
   (bool = false) ;
   (bool = false) ;
   () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CXX14_CONSTEXPR bool () ;
  BOOST_CXX14_CONSTEXPR bool (const time_type &) ;
  BOOST_CXX14_CONSTEXPR bool (const time_type &) ;
  BOOST_CXX14_CONSTEXPR  (const time_type &) ;
  BOOST_CXX14_CONSTEXPR time_type (const ) ;
  BOOST_CXX14_CONSTEXPR time_type (const );
  BOOST_CXX14_CONSTEXPR time_type (const ) ;
  BOOST_CXX14_CONSTEXPR time_type (const );
  BOOST_CXX14_CONSTEXPR time_type (const ) ;
  BOOST_CXX14_CONSTEXPR time_type (const );
  BOOST_CXX14_CONSTEXPR time_type (const ) ;
  BOOST_CXX14_CONSTEXPR time_type (const );
};

Description

This class is a skeleton for the interface of a temporal type with a resolution that is higher than a day. It is intended that this class be the base class and that the actual time class be derived using the BN pattern. In this way, the derived class can make decisions such as 'should there be a default constructor' and what should it set its value to, should there be optional constructors say allowing only an time_durations that generate a time from a clock,etc. So, in fact multiple time types can be created for a time_system with different construction policies, and all of them can perform basic operations by only writing a copy constructor. Finally, compiler errors are also shorter.

The real behavior of the time class is provided by the time_system template parameter. This class must provide all the logic for addition, subtraction, as well as define all the interface types.

base_time public construct/copy/destruct

  1. (const  day, const  td, 
               dst = );
  2. ( sv);
  3. (const  rhs);

base_time public member functions

  1. BOOST_CXX14_CONSTEXPR  () ;
  2. BOOST_CXX14_CONSTEXPR  () ;
  3.  (bool = false) ;

    Optional bool parameter will return time zone as an offset (ie "+07:00"). Empty string is returned for classes that do not use a time_zone

  4.  (bool = false) ;

    Optional bool parameter will return time zone as an offset (ie "+07:00"). Empty string is returned for classes that do not use a time_zone

  5.  () ;
    An empty string is returned for classes that do not use a time_zone.
  6. BOOST_CXX14_CONSTEXPR bool () ;
    check to see if date is not a value
  7. BOOST_CXX14_CONSTEXPR bool () ;
    check to see if date is one of the infinity values
  8. BOOST_CXX14_CONSTEXPR bool () ;
    check to see if date is greater than all possible dates
  9. BOOST_CXX14_CONSTEXPR bool () ;
    check to see if date is greater than all possible dates
  10. BOOST_CXX14_CONSTEXPR bool () ;
    check to see if time is a special value
  11. BOOST_CXX14_CONSTEXPR bool (const time_type & rhs) ;
    Equality operator – others generated by boost::equality_comparable.
  12. BOOST_CXX14_CONSTEXPR bool (const time_type & rhs) ;
    Equality operator – others generated by boost::less_than_comparable.
  13. BOOST_CXX14_CONSTEXPR  
    (const time_type & rhs) ;
    difference between two times
  14. BOOST_CXX14_CONSTEXPR time_type (const  dd) ;
    add date durations
  15. BOOST_CXX14_CONSTEXPR time_type (const  dd);
  16. BOOST_CXX14_CONSTEXPR time_type (const  dd) ;
    subtract date durations
  17. BOOST_CXX14_CONSTEXPR time_type (const  dd);
  18. BOOST_CXX14_CONSTEXPR time_type (const  td) ;
    add time durations
  19. BOOST_CXX14_CONSTEXPR time_type (const  td);
  20. BOOST_CXX14_CONSTEXPR time_type 
    (const  rhs) ;
    subtract time durations
  21. BOOST_CXX14_CONSTEXPR time_type (const  td);

PrevUpHomeNext