![]() |
Home | Libraries | People | FAQ | More |
boost::date_time::base_time — Representation of a precise moment in time, including the date.
// 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 ); };
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 functionsBOOST_CXX14_CONSTEXPR () ;
BOOST_CXX14_CONSTEXPR () ;
(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
(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
() ;An empty string is returned for classes that do not use a time_zone.
BOOST_CXX14_CONSTEXPR bool () ;check to see if date is not a value
BOOST_CXX14_CONSTEXPR bool () ;check to see if date is one of the infinity values
BOOST_CXX14_CONSTEXPR bool () ;check to see if date is greater than all possible dates
BOOST_CXX14_CONSTEXPR bool () ;check to see if date is greater than all possible dates
BOOST_CXX14_CONSTEXPR bool () ;check to see if time is a special value
BOOST_CXX14_CONSTEXPR bool (const time_type & rhs) ;Equality operator – others generated by boost::equality_comparable.
BOOST_CXX14_CONSTEXPR bool (const time_type & rhs) ;Equality operator – others generated by boost::less_than_comparable.
BOOST_CXX14_CONSTEXPR (const time_type & rhs) ;difference between two times
BOOST_CXX14_CONSTEXPR time_type (const dd) ;add date durations
BOOST_CXX14_CONSTEXPR time_type (const dd);
BOOST_CXX14_CONSTEXPR time_type (const dd) ;subtract date durations
BOOST_CXX14_CONSTEXPR time_type (const dd);
BOOST_CXX14_CONSTEXPR time_type (const td) ;add time durations
BOOST_CXX14_CONSTEXPR time_type (const td);
BOOST_CXX14_CONSTEXPR time_type (const rhs) ;subtract time durations
BOOST_CXX14_CONSTEXPR time_type (const td);