Go to the documentation of this file.
38 #ifndef PSS_UNITS_DEFINE_CLOCK
39 #define PSS_UNITS_DEFINE_CLOCK(_name_, duration_before_epoch, _symbol_, _is_steady_) \
41 template<typename TimePoint> \
42 struct _name_##_implementation_t : public std::chrono::system_clock \
44 typedef TimePoint time_point; \
45 typedef decltype(duration_before_epoch) duration; \
46 static const duration diff_from_system_epoch; \
47 static time_point now() noexcept { \
48 return time_point(std::chrono::system_clock::now()); \
52 template<typename TimePoint> \
53 const typename _name_##_implementation_t<TimePoint>::duration \
54 _name_##_implementation_t<TimePoint>::diff_from_system_epoch(duration_before_epoch); \
57 struct _name_ : public detail::_name_##_implementation_t<TimePoint<_name_, decltype(duration_before_epoch)>> \
60 typedef _name_##_implementation_t<TimePoint<_name_, decltype(duration_before_epoch)>> BaseT; \
62 typedef typename BaseT::duration duration; \
63 typedef typename BaseT::time_point time_point; \
64 typedef duration::rep rep; \
65 typedef duration::period period; \
66 static constexpr bool is_steady = _is_steady_; \
67 static constexpr const char* symbol=QUOTE(_symbol_);\
71 #endif // PSS_UNITS_DEFINE_CLOCK