|
DUDS
|
Distributed Update of Data from Something
|
An extention to the C++ std::chrono::time_point template to make time points easier to work with. More...
#include <Interstellar.hpp>
Public Member Functions | |
| constexpr | TimePoint ()=default |
| TimePoint (const TimePoint &)=default | |
| template<class OtherRep , class OtherPeriod > | |
| constexpr | TimePoint (const std::chrono::duration< OtherRep, OtherPeriod > &od) |
| Constructs a TimePoint from a duration. More... | |
| template<class OtherClock , class OtherDuration > | |
| constexpr | TimePoint (const std::chrono::time_point< OtherClock, OtherDuration > &otp) |
| Constructs a TimePoint from a std::chrono::time_point. More... | |
| TimePoint & | operator= (const TimePoint &)=default |
| template<class OtherClock , class OtherDuration > | |
| TimePoint & | operator= (const TimePoint< OtherClock, OtherDuration > &otp) |
| Assigns a new time from another TimePoint using different template parameters. More... | |
Static Public Member Functions | |
| static constexpr TimePoint | max () |
| Returns the latest time that can be represented. More... | |
| static constexpr TimePoint | min () |
| Returns the earlist time that can be represented. More... | |
An extention to the C++ std::chrono::time_point template to make time points easier to work with.
I found the inclusion of the clock type to be rather bothersome since the DUDS library doesn't use types to track the origin of information. This class avoids that issue, and allows easier type conversions and cross-type assignments with a lot less typing. I find it is also eaiser to write code that doesn't result in compile-time errors using this template rather than using the C++ one directly.
| Clock | A clock class. |
| Duration | A duration class. |
Definition at line 53 of file Interstellar.hpp.
|
default |
|
default |
|
inline |
Constructs a TimePoint from a duration.
| od | A duration from time-zero, epoch, whatever you want to call it. |
Definition at line 62 of file Interstellar.hpp.
|
inline |
Constructs a TimePoint from a std::chrono::time_point.
| otp | The source time point. It may use a different period and a a different clock type. |
Definition at line 84 of file Interstellar.hpp.
|
inlinestatic |
Returns the latest time that can be represented.
Definition at line 111 of file Interstellar.hpp.
Referenced by duds::time::planetary::LeapSeconds::getLeapBounds().
|
inlinestatic |
Returns the earlist time that can be represented.
Definition at line 103 of file Interstellar.hpp.
Referenced by duds::time::planetary::LeapSeconds::getLeapBounds().
|
default |
|
inline |
Assigns a new time from another TimePoint using different template parameters.
| otp | The source TimePoint. It may use a different period and a a different clock type. |
Definition at line 96 of file Interstellar.hpp.