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  ;            

  // public member functions
  (const , const ,  = );
  ();
  (const );
  BOOST_CXX14_CONSTEXPR  () ;
  BOOST_CXX14_CONSTEXPR  () ;
   (bool = ) ;
   (bool = ) ;
   () ;
  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 member functions

  1. (const  day, const  td, 
               dst = );
  2. ( sv);
  3. (const  rhs);
  4. BOOST_CXX14_CONSTEXPR  () ;
  5. BOOST_CXX14_CONSTEXPR  () ;
  6.  (bool = ) ;

    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

  7.  (bool = ) ;

    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

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

PrevUpHomeNext