OpenDDS  Snapshot(2023/04/28-20:55)
TimePoint_T.inl
Go to the documentation of this file.
1 #include "TimePoint_T.h"
2 
3 #include "Time_Helper.h"
4 
6 
7 namespace OpenDDS {
8 namespace DCPS {
9 
10 template<typename AceClock>
13 : value_(zero_value.value())
14 {
15 }
16 
17 template<typename AceClock>
20 : value_(ace_time_value)
21 {
22 }
23 
24 template<typename AceClock>
27 : value_(ace_time_value)
28 {
29 }
30 
31 template<typename AceClock>
34 : value_(time_to_time_value(dds_time))
35 {
36 }
37 
38 template<typename AceClock>
42 {
43  return TimePoint_T<AceClock>(clock());
44 }
45 
46 template<typename AceClock>
50 {
51  return value_;
52 }
53 
54 template<typename AceClock>
56 void
58 {
59  value_ = ace_time_value;
60 }
61 
62 template<typename AceClock>
64 bool
66 {
67  return *this == zero_value;
68 }
69 
70 template<typename AceClock>
72 bool
74 {
75  return *this == max_value;
76 }
77 
78 template<typename AceClock>
80 void
82 {
83  value_ = clock();
84 }
85 
86 template<typename AceClock>
90 {
91  return time_value_to_time(value_);
92 }
93 
94 template<typename AceClock>
98 {
100 }
101 
102 template<typename AceClock>
106 {
107  value_ += td.value();
108  return *this;
109 }
110 
111 template<typename AceClock>
115 {
116  value_ -= td.value();
117  return *this;
118 }
119 
120 template<typename AceClock>
124 {
125  return TimePoint_T<AceClock>(x.value() + y.value());
126 }
127 
128 template<typename AceClock>
132 {
133  return TimePoint_T<AceClock>(x.value() + y.value());
134 }
135 
136 template<typename AceClock>
140 {
141  return TimeDuration(x.value() - y.value());
142 }
143 
144 template<typename AceClock>
148 {
149  return TimePoint_T<AceClock>(x.value() - y.value());
150 }
151 
152 template<typename AceClock>
154 bool
155 operator<(const TimePoint_T<AceClock>& x, const TimePoint_T<AceClock>& y)
156 {
157  return x.value() < y.value();
158 }
159 
160 template<typename AceClock>
162 bool
164 {
165  return x.value() > y.value();
166 }
167 
168 template<typename AceClock>
170 bool
171 operator<=(const TimePoint_T<AceClock>& x, const TimePoint_T<AceClock>& y)
172 {
173  return x.value() <= y.value();
174 }
175 
176 template<typename AceClock>
178 bool
180 {
181  return x.value() >= y.value();
182 }
183 
184 template<typename AceClock>
186 bool
188 {
189  return x.value() == y.value();
190 }
191 
192 template<typename AceClock>
194 bool
196 {
197  return x.value() != y.value();
198 }
199 
200 }
201 }
202 
const LogLevel::Value value
Definition: debug.cpp:61
ACE_INLINE OpenDDS_Dcps_Export DDS::Time_t time_value_to_time(const ACE_Time_Value &tv)
Value value_
ACE_INLINE bool operator!=(const TimePoint_T< AceClock > &x, const TimePoint_T< AceClock > &y)
const ACE_Time_Value & value() const
ACE_INLINE bool operator==(const TimePoint_T< AceClock > &x, const TimePoint_T< AceClock > &y)
ACE_INLINE TimePoint_T< AceClock > operator+(const TimePoint_T< AceClock > &x, const TimeDuration &y)
ACE_INLINE OpenDDS_Dcps_Export ACE_Time_Value time_to_time_value(const DDS::Time_t &t)
ACE_INLINE bool operator>=(const TimePoint_T< AceClock > &x, const TimePoint_T< AceClock > &y)
ACE_INLINE OpenDDS_Dcps_Export MonotonicTime_t time_value_to_monotonic_time(const ACE_Time_Value &tv)
SequenceNumber operator+=(SequenceNumber &lhs, int rhs)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
ACE_INLINE TimePoint_T< AceClock > operator-(const TimePoint_T< AceClock > &x, const TimeDuration &y)
#define ACE_INLINE
ACE_INLINE bool operator>(const TimePoint_T< AceClock > &x, const TimePoint_T< AceClock > &y)
const ACE_Time_Value_T< AceClock > & value() const
Definition: TimePoint_T.inl:49
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28