#include <senf/Scheduler/ClockService.hh>
The ClockService provides a highly accurate monotonous clock source based on gettimeofday(). However, it takes additional precautions to detect clock skew.
Definition at line 64 of file ClockService.hh.
Public Types |
|
typedef config::time_type | clock_type |
ClockService timer data type. |
|
typedef boost::int_fast64_t | int64_type |
Supplementary integer type. |
|
typedef boost::posix_time::ptime | abstime_type |
Absolute time data type. |
|
typedef boost::posix_time::time_duration |
reltime_type |
Relative time data type. |
|
Static Public Member Functions |
|
static clock_type | now () |
Return current clock value. |
|
static abstime_type | abstime (clock_type clock) |
Convert clock to absolute time. |
|
static reltime_type | reltime (clock_type clock) |
Convert clock to relative time. |
|
static clock_type | clock (abstime_type time) |
Convert absolute time to clock value. |
|
static clock_type | from_time_t (time_t const &time) |
Convert legacy time_t to clock value. |
|
static clock_type | from_timeval (timeval const &time) |
Convert legacy timeval to clock value. |
|
static clock_type | nanoseconds (int64_type v) |
Convert v nanoseconds to clock_type. |
|
static clock_type | microseconds (int64_type v) |
Convert v microseconds to clock_type. |
|
static clock_type | milliseconds (int64_type v) |
Convert v milliseconds to clock_type. |
|
static clock_type | seconds (int64_type v) |
Convert v seconds to clock_type. |
|
static clock_type | minutes (int64_type v) |
Convert v minutes to clock_type. |
|
static clock_type | hours (int64_type v) |
Convert v hours to clock_type. |
|
static clock_type | days (int64_type v) |
Convert v days to clock_type. |
|
static int64_type | in_nanoseconds (clock_type v) |
Convert v to nanoseconds. |
|
static int64_type | in_microseconds (clock_type v) |
Convert v to microseconds. |
|
static int64_type | in_milliseconds (clock_type v) |
Convert v to milliseconds. |
|
static int64_type | in_seconds (clock_type v) |
Convert v to seconds. |
|
static int64_type | in_minutes (clock_type v) |
Convert v to minutes. |
|
static int64_type | in_hours (clock_type v) |
Convert v to hours. |
|
static int64_type | in_days (clock_type v) |
Convert v to days. |
|
static void | restart () |
Force re-synchronization of abstime and clock. |
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 89 of file ClockService.hh.
typedef config::time_type senf::ClockService:: | ||||
clock_type | ||||
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 76 of file ClockService.hh.
typedef boost::int_fast64_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 82 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 96 of file ClockService.hh.
senf::ClockService::abstime_type senf::ClockService:: | ||||
abstime | ( | clock_type | clock | ) |
Convert clock to absolute time.
This member converts a clock value into an absolute Boost.DateTime value.
Definition at line 85 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
clock | ( | abstime_type | time | ) |
Convert absolute time to clock value.
This member convert an absolute time value into the corresponding clock value.
Definition at line 99 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
days | ( | int64_type | v | ) |
Convert v days to clock_type.
Definition at line 139 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
from_time_t | ( | time_t const & | time | ) |
Convert legacy time_t to clock value.
This member converts an absolute time value represented as a time_t value into a clock value
Definition at line 104 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
from_timeval | ( | timeval const & | time | ) |
Convert legacy timeval to clock value.
This member converts an absolute time value represented as a timeval value into a clock value
Definition at line 179 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
hours | ( | int64_type | v | ) |
Convert v hours to clock_type.
Definition at line 134 of file ClockService.cci.
static int64_type senf::ClockService:: | ||||
in_days | ( | clock_type | v | ) |
Convert v to days.
static int64_type senf::ClockService:: | ||||
in_hours | ( | clock_type | v | ) |
Convert v to hours.
static int64_type senf::ClockService:: | ||||
in_microseconds | ( | clock_type | v | ) |
Convert v to microseconds.
static int64_type senf::ClockService:: | ||||
in_milliseconds | ( | clock_type | v | ) |
Convert v to milliseconds.
static int64_type senf::ClockService:: | ||||
in_minutes | ( | clock_type | v | ) |
Convert v to minutes.
static int64_type senf::ClockService:: | ||||
in_nanoseconds | ( | clock_type | v | ) |
Convert v to nanoseconds.
static int64_type senf::ClockService:: | ||||
in_seconds | ( | clock_type | v | ) |
Convert v to seconds.
senf::ClockService::clock_type senf::ClockService:: | ||||
microseconds | ( | int64_type | v | ) |
Convert v microseconds to clock_type.
Definition at line 114 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
milliseconds | ( | int64_type | v | ) |
Convert v milliseconds to clock_type.
Definition at line 119 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
minutes | ( | int64_type | v | ) |
Convert v minutes to clock_type.
Definition at line 129 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
nanoseconds | ( | int64_type | v | ) |
Convert v nanoseconds to clock_type.
Definition at line 109 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
now | () | |||
Return current clock value.
Definition at line 37 of file ClockService.cci.
senf::ClockService::reltime_type senf::ClockService:: | ||||
reltime | ( | clock_type | clock | ) |
Convert clock to relative time.
This member converts a clock value into a relative Boost.DateTime time interval
Definition at line 90 of file ClockService.cci.
void senf::ClockService:: | ||||
restart | () | |||
Force re-synchronization of abstime and clock.
Calling the member should never be necessary since abstime() / clock() automatically call restart() if needed
Definition at line 184 of file ClockService.cci.
senf::ClockService::clock_type senf::ClockService:: | ||||
seconds | ( | int64_type | v | ) |
Convert v seconds to clock_type.
Definition at line 124 of file ClockService.cci.