Reliable high precision monotonous clock source. More...
#include <senf/Scheduler/ClockService.hh>
Public Types | |
typedef config::time_type | clock_type |
ClockService timer data type. More... | |
typedef std::int64_t | int64_type |
Supplementary integer type. More... | |
typedef boost::posix_time::ptime | abstime_type |
Absolute time data type. More... | |
typedef boost::posix_time::time_duration | reltime_type |
Relative time data type. More... | |
Static Public Member Functions | |
static clock_type | now () |
Return current clock value. More... | |
static abstime_type | abstime (clock_type const &clock) |
Convert clock to absolute time. More... | |
static reltime_type | reltime (clock_type const &clock) |
Convert clock to relative time. More... | |
static clock_type | clock (abstime_type const &time) |
Convert absolute time to clock value. More... | |
static clock_type | from_time_t (time_t const &time) |
Convert legacy time_t to clock value. More... | |
static time_t | to_time_t (clock_type const &time) |
Convert legacy time_t to clock value to legacy time_t. More... | |
static clock_type | from_timeval (timeval const &time) |
Convert legacy timeval to clock value. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR clock_type | nanoseconds (int64_type const &v) |
Convert v nanoseconds to clock_type. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR clock_type | microseconds (int64_type const &v) |
Convert v microseconds to clock_type. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR clock_type | milliseconds (int64_type const &v) |
Convert v milliseconds to clock_type. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR clock_type | seconds (int64_type const &v) |
Convert v seconds to clock_type. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR clock_type | minutes (int64_type const &v) |
Convert v minutes to clock_type. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR clock_type | hours (int64_type const &v) |
Convert v hours to clock_type. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR clock_type | days (int64_type const &v) |
Convert v days to clock_type. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR int64_type | in_nanoseconds (clock_type const &v) |
Convert v to nanoseconds. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR int64_type | in_microseconds (clock_type const &v) |
Convert v to microseconds. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR int64_type | in_milliseconds (clock_type const &v) |
Convert v to milliseconds. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR int64_type | in_seconds (clock_type const &v) |
Convert v to seconds. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR int64_type | in_minutes (clock_type const &v) |
Convert v to minutes. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR int64_type | in_hours (clock_type const &v) |
Convert v to hours. More... | |
static SENF_CLOCKSERVICE_CONSTEXPR int64_type | in_days (clock_type const &v) |
Convert v to days. More... | |
static void | restart () |
Force re-synchronization of abstime and clock. More... | |
Static Public Attributes | |
static constexpr clock_type | maxTime = std::numeric_limits<config::time_type>::max() |
Reliable high precision monotonous clock source.
The ClockService provides a highly accurate monotonous clock source based on gettimeofday(). However, it takes additional precautions to detect clock skew.
Definition at line 62 of file ClockService.hh.
typedef boost::posix_time::ptime senf::ClockService::abstime_type |
Absolute time data type.
Boost.DateTime datatype used to represent absolute date/time values.
Definition at line 91 of file ClockService.hh.
ClockService timer data type.
Unsigned integer type representing scheduler time. Scheduler time is measured in nanoseconds relative to some implementation defined reference time.
Definition at line 78 of file ClockService.hh.
typedef std::int64_t senf::ClockService::int64_type |
Supplementary integer type.
This type is used to represent varies supplementary values (e.g. number of microseconds)
Definition at line 84 of file ClockService.hh.
typedef boost::posix_time::time_duration senf::ClockService::reltime_type |
Relative time data type.
Boost.DateTime datatype used to represent time intervals
Definition at line 98 of file ClockService.hh.
|
static |
Convert clock to absolute time.
This member converts a clock value into an absolute Boost.DateTime value.
|
static |
Convert absolute time to clock value.
This member convert an absolute time value into the corresponding clock value.
|
static |
Convert v days to clock_type.
|
static |
Convert legacy time_t to clock value.
This member converts an absolute time value represented as a time_t value into a clock value
|
static |
Convert legacy timeval to clock value.
This member converts an absolute time value represented as a timeval value into a clock value
|
static |
Convert v hours to clock_type.
|
static |
Convert v to days.
|
static |
Convert v to hours.
|
static |
Convert v to microseconds.
|
static |
Convert v to milliseconds.
|
static |
Convert v to minutes.
|
static |
Convert v to nanoseconds.
|
static |
Convert v to seconds.
|
static |
Convert v microseconds to clock_type.
|
static |
Convert v milliseconds to clock_type.
|
static |
Convert v minutes to clock_type.
|
static |
Convert v nanoseconds to clock_type.
|
static |
Return current clock value.
|
static |
Convert clock to relative time.
This member converts a clock value into a relative Boost.DateTime time interval
|
static |
|
static |
Convert v seconds to clock_type.
|
static |
Convert legacy time_t to clock value to legacy time_t.
This member converts a clock value into an absolute time value represented as a time_t in UTC !
|
static |
Definition at line 102 of file ClockService.hh.