![]() |
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 ; typedef ; typedef ; typedef ; typedef ; typedef ; // construct/copy/destruct (, , = ); (); (); // public member functions () ; () ; ( = ) ; ( = ) ; () ; () ; () ; () ; () ; () ; () ; () ; () ; () ; (); () ; (); () ; (); () ; (); };
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() ;
() ;
( = ) ;
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
( = ) ;
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.
() ;check to see if date is not a value
() ;check to see if date is one of the infinity values
() ;check to see if date is greater than all possible dates
() ;check to see if date is greater than all possible dates
() ;check to see if time is a special value
( rhs) ;Equality operator – others generated by boost::equality_comparable.
( rhs) ;Equality operator – others generated by boost::less_than_comparable.
( rhs) ;difference between two times
( dd) ;add date durations
( dd);
( dd) ;subtract date durations
( dd);
( td) ;add time durations
( td);
( rhs) ;subtract time durations
( td);