1 | #ifndef POSIX_PTIME_HPP___ |
---|
2 | #define POSIX_PTIME_HPP___ |
---|
3 | |
---|
4 | /* Copyright (c) 2002,2003 CrystalClear Software, Inc. |
---|
5 | * Use, modification and distribution is subject to the |
---|
6 | * Boost Software License, Version 1.0. (See accompanying |
---|
7 | * file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) |
---|
8 | * Author: Jeff Garland |
---|
9 | * $Date: 2004/10/01 02:29:49 $ |
---|
10 | */ |
---|
11 | |
---|
12 | #include "boost/date_time/posix_time/posix_time_system.hpp" |
---|
13 | #include "boost/date_time/time.hpp" |
---|
14 | |
---|
15 | namespace boost { |
---|
16 | |
---|
17 | namespace posix_time { |
---|
18 | |
---|
19 | //bring special enum values into the namespace |
---|
20 | using date_time::special_values; |
---|
21 | using date_time::not_special; |
---|
22 | using date_time::neg_infin; |
---|
23 | using date_time::pos_infin; |
---|
24 | using date_time::not_a_date_time; |
---|
25 | using date_time::max_date_time; |
---|
26 | using date_time::min_date_time; |
---|
27 | |
---|
28 | //! Time type with no timezone or other adjustments |
---|
29 | /*! \ingroup time_basics |
---|
30 | */ |
---|
31 | class ptime : public date_time::base_time<ptime, posix_time_system> |
---|
32 | { |
---|
33 | public: |
---|
34 | typedef posix_time_system time_system_type; |
---|
35 | typedef time_system_type::time_rep_type time_rep_type; |
---|
36 | typedef time_system_type::time_duration_type time_duration_type; |
---|
37 | typedef ptime time_type; |
---|
38 | //! Construct with date and offset in day |
---|
39 | ptime(gregorian::date d,time_duration_type td) : date_time::base_time<time_type,time_system_type>(d,td) |
---|
40 | {} |
---|
41 | //! Construct a time at start of the given day (midnight) |
---|
42 | explicit ptime(gregorian::date d) : date_time::base_time<time_type,time_system_type>(d,time_duration_type(0,0,0)) |
---|
43 | {} |
---|
44 | //! Copy from time_rep |
---|
45 | ptime(const time_rep_type& rhs): |
---|
46 | date_time::base_time<time_type,time_system_type>(rhs) |
---|
47 | {} |
---|
48 | //! Construct from special value |
---|
49 | ptime(const special_values sv) : date_time::base_time<time_type,time_system_type>(sv) |
---|
50 | {} |
---|
51 | #if !defined(DATE_TIME_NO_DEFAULT_CONSTRUCTOR) |
---|
52 | // Default constructor constructs to not_a_date_time |
---|
53 | ptime() : date_time::base_time<time_type,time_system_type>(gregorian::date(not_a_date_time), time_duration_type(not_a_date_time)) |
---|
54 | {} |
---|
55 | #endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR |
---|
56 | |
---|
57 | }; |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | } }//namespace posix_time |
---|
62 | |
---|
63 | |
---|
64 | #endif |
---|
65 | |
---|