Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:36

0001 #ifndef POSIX_PTIME_HPP___
0002 #define POSIX_PTIME_HPP___
0003 
0004 /* Copyright (c) 2002,2003 CrystalClear Software, Inc.
0005  * Use, modification and distribution is subject to the 
0006  * Boost Software License, Version 1.0. (See accompanying
0007  * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
0008  * Author: Jeff Garland 
0009  * $Date$
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   //bring special enum values into the namespace
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   //! Time type with no timezone or other adjustments
0030   /*! \ingroup time_basics
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     //! Construct with date and offset in day
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     //! Construct a time at start of the given day (midnight)
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     //! Copy from time_rep
0050     BOOST_CXX14_CONSTEXPR 
0051     ptime(const time_rep_type& rhs):
0052       date_time::base_time<time_type,time_system_type>(rhs)
0053     {}
0054     //! Construct from special value
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     // Default constructor constructs to not_a_date_time
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 // DATE_TIME_NO_DEFAULT_CONSTRUCTOR
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 } }//namespace posix_time
0081 
0082 
0083 #endif
0084