File indexing completed on 2025-01-18 09:30:36
0001 #ifndef POSIX_PTIME_HPP___
0002 #define POSIX_PTIME_HPP___
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <boost/date_time/posix_time/posix_time_system.hpp>
0013 #include <boost/date_time/time.hpp>
0014 #include <boost/date_time/compiler_config.hpp>
0015
0016 namespace boost {
0017
0018 namespace posix_time {
0019
0020
0021 using date_time::special_values;
0022 using date_time::not_special;
0023 using date_time::neg_infin;
0024 using date_time::pos_infin;
0025 using date_time::not_a_date_time;
0026 using date_time::max_date_time;
0027 using date_time::min_date_time;
0028
0029
0030
0031
0032 class BOOST_SYMBOL_VISIBLE ptime : public date_time::base_time<ptime, posix_time_system>
0033 {
0034 public:
0035 typedef posix_time_system time_system_type;
0036 typedef time_system_type::time_rep_type time_rep_type;
0037 typedef time_system_type::time_duration_type time_duration_type;
0038 typedef ptime time_type;
0039
0040 BOOST_CXX14_CONSTEXPR
0041 ptime(gregorian::date d,time_duration_type td) :
0042 date_time::base_time<time_type,time_system_type>(d,td)
0043 {}
0044
0045 BOOST_CXX14_CONSTEXPR
0046 explicit ptime(gregorian::date d) :
0047 date_time::base_time<time_type,time_system_type>(d,time_duration_type(0,0,0))
0048 {}
0049
0050 BOOST_CXX14_CONSTEXPR
0051 ptime(const time_rep_type& rhs):
0052 date_time::base_time<time_type,time_system_type>(rhs)
0053 {}
0054
0055 BOOST_CXX14_CONSTEXPR
0056 ptime(const special_values sv) :
0057 date_time::base_time<time_type,time_system_type>(sv)
0058 {}
0059 #if !defined(DATE_TIME_NO_DEFAULT_CONSTRUCTOR)
0060
0061 BOOST_CXX14_CONSTEXPR
0062 ptime() :
0063 date_time::base_time<time_type,time_system_type>(gregorian::date(not_a_date_time),
0064 time_duration_type(not_a_date_time))
0065 {}
0066 #endif
0067
0068 friend BOOST_CXX14_CONSTEXPR
0069 bool operator==(const ptime& lhs, const ptime& rhs);
0070
0071 };
0072
0073 inline BOOST_CXX14_CONSTEXPR
0074 bool operator==(const ptime& lhs, const ptime& rhs)
0075 {
0076 return ptime::time_system_type::is_equal(lhs.time_,rhs.time_);
0077 }
0078
0079
0080 } }
0081
0082
0083 #endif
0084