File indexing completed on 2025-01-18 09:30:36
0001 #ifndef POSIX_TIME_DURATION_HPP___
0002 #define POSIX_TIME_DURATION_HPP___
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <boost/core/enable_if.hpp>
0013 #include <boost/date_time/compiler_config.hpp>
0014 #include <boost/date_time/posix_time/posix_time_config.hpp>
0015 #include <boost/numeric/conversion/cast.hpp>
0016 #include <boost/type_traits/is_integral.hpp>
0017
0018 namespace boost {
0019 namespace posix_time {
0020
0021
0022
0023
0024
0025 class BOOST_SYMBOL_VISIBLE hours : public time_duration
0026 {
0027 public:
0028 template <typename T>
0029 BOOST_CXX14_CONSTEXPR explicit hours(T const& h,
0030 typename boost::enable_if<boost::is_integral<T>, void>::type* = BOOST_DATE_TIME_NULLPTR) :
0031 time_duration(numeric_cast<hour_type>(h), 0, 0)
0032 {}
0033 };
0034
0035
0036
0037
0038
0039 class BOOST_SYMBOL_VISIBLE minutes : public time_duration
0040 {
0041 public:
0042 template <typename T>
0043 BOOST_CXX14_CONSTEXPR explicit minutes(T const& m,
0044 typename boost::enable_if<boost::is_integral<T>, void>::type* = BOOST_DATE_TIME_NULLPTR) :
0045 time_duration(0, numeric_cast<min_type>(m),0)
0046 {}
0047 };
0048
0049
0050
0051
0052
0053 class BOOST_SYMBOL_VISIBLE seconds : public time_duration
0054 {
0055 public:
0056 template <typename T>
0057 BOOST_CXX14_CONSTEXPR explicit seconds(T const& s,
0058 typename boost::enable_if<boost::is_integral<T>, void>::type* = BOOST_DATE_TIME_NULLPTR) :
0059 time_duration(0,0, numeric_cast<sec_type>(s))
0060 {}
0061 };
0062
0063
0064
0065
0066
0067 typedef date_time::subsecond_duration<time_duration,1000> millisec;
0068 typedef date_time::subsecond_duration<time_duration,1000> milliseconds;
0069
0070
0071
0072
0073 typedef date_time::subsecond_duration<time_duration,1000000> microsec;
0074 typedef date_time::subsecond_duration<time_duration,1000000> microseconds;
0075
0076
0077 #if defined(BOOST_DATE_TIME_HAS_NANOSECONDS)
0078
0079
0080
0081
0082 typedef date_time::subsecond_duration<time_duration,1000000000> nanosec;
0083 typedef date_time::subsecond_duration<time_duration,1000000000> nanoseconds;
0084
0085 #endif
0086
0087 } }
0088
0089
0090 #endif
0091