#include <TimeService.hpp>
Public Types | |
typedef long | msecs |
typedef long long | nsecs |
typedef double | Seconds |
typedef long | secs |
typedef long long | ticks |
typedef long | usecs |
Public Member Functions | |
void | enableSystemClock (bool yes_no) |
nsecs | getNSecs () const |
nsecs | getNSecs (nsecs &relativeTime) const |
Seconds | getSeconds (ticks &relativeTime) const |
ticks | getTicks () const |
ticks | getTicks (ticks &relativeTime) const |
Seconds | secondsChange (Seconds delta) |
Seconds | secondsGet (ticks &relativeTime) const |
Seconds | secondsSince (ticks relativeTime) const |
bool | systemClockEnabled () const |
ticks | ticksChange (ticks delta) |
ticks | ticksGet () const |
ticks | ticksGet (ticks &relativeTime) const |
ticks | ticksSince (ticks relativeTime) const |
virtual | ~TimeService () |
Static Public Member Functions | |
static TimeService * | Instance () |
static ticks | nsecs2ticks (const nsecs m) |
static bool | Release () |
static nsecs | ticks2nsecs (const ticks t) |
Static Public Attributes | |
static const nsecs | InfiniteNSecs = ::InfiniteNSecs |
static const Seconds | InfiniteSeconds = ::InfiniteSeconds |
static const ticks | InfiniteTicks = ::InfiniteTicks |
Protected Member Functions | |
TimeService () | |
Private Attributes | |
ticks | offset |
bool | use_clock |
Static Private Attributes | |
static TimeService * | _instance = 0 |
The TimeService is used for system-wide time keeping and conversions.
Definition at line 53 of file TimeService.hpp.
typedef long RTT::os::TimeService::msecs |
An integer representation of miliseconds
Definition at line 69 of file TimeService.hpp.
typedef long long RTT::os::TimeService::nsecs |
An integer representation of nanoseconds
Definition at line 79 of file TimeService.hpp.
typedef double RTT::os::TimeService::Seconds |
The type used to store SI unit time keeping
Definition at line 59 of file TimeService.hpp.
typedef long RTT::os::TimeService::secs |
An integer representation of seconds
Definition at line 64 of file TimeService.hpp.
typedef long long RTT::os::TimeService::ticks |
The type for the systems clock tick.
Definition at line 84 of file TimeService.hpp.
typedef long RTT::os::TimeService::usecs |
An integer representation of microseconds
Definition at line 74 of file TimeService.hpp.
|
virtual |
Destructor
Definition at line 90 of file TimeService.cpp.
|
protected |
Constructor
Definition at line 84 of file TimeService.cpp.
void RTT::TimeService::enableSystemClock | ( | bool | yes_no | ) |
Enables or disables reading the system clock. If disabled, you'll have to change time using secondsChange.
Definition at line 95 of file TimeService.cpp.
TimeService::nsecs RTT::TimeService::getNSecs | ( | ) | const |
Get current nsecs of the System clock
Definition at line 170 of file TimeService.cpp.
TimeService::nsecs RTT::TimeService::getNSecs | ( | TimeService::nsecs & | relativeTime | ) | const |
Get nsecs passed since a certain moment
Definition at line 176 of file TimeService.cpp.
TimeService::Seconds RTT::TimeService::getSeconds | ( | TimeService::ticks & | relativeTime | ) | const |
Get the time in seconds passed since a certain moment
Definition at line 144 of file TimeService.cpp.
TimeService::ticks RTT::TimeService::getTicks | ( | ) | const |
Get current tick of the System clock
Definition at line 120 of file TimeService.cpp.
TimeService::ticks RTT::TimeService::getTicks | ( | TimeService::ticks & | relativeTime | ) | const |
Get clicks passed since a certain moment
Definition at line 126 of file TimeService.cpp.
|
static |
Definition at line 60 of file TimeService.cpp.
|
static |
Convert an amount of nano seconds to System ticks
m | The amount of nano seconds |
Definition at line 50 of file TimeService.cpp.
|
static |
Releases the TimeService Reference counting might aid in making this call safe
Definition at line 71 of file TimeService.cpp.
TimeService::Seconds RTT::TimeService::secondsChange | ( | TimeService::Seconds | delta | ) |
Change the time with delta seconds.
Definition at line 156 of file TimeService.cpp.
Get the time in seconds passed since a certain moment
Definition at line 151 of file TimeService.hpp.
TimeService::Seconds RTT::TimeService::secondsSince | ( | TimeService::ticks | relativeTime | ) | const |
Get Seconds passed since a certain moment. If relativeTime is zero, the absolute syteme time is given.
Definition at line 150 of file TimeService.cpp.
bool RTT::TimeService::systemClockEnabled | ( | ) | const |
Check if the system clock is being read.
Definition at line 114 of file TimeService.cpp.
|
static |
Convert an amount of ticks to nano seconds
Definition at line 55 of file TimeService.cpp.
TimeService::ticks RTT::TimeService::ticksChange | ( | TimeService::ticks | delta | ) |
Change the time with delta ticks.
Definition at line 163 of file TimeService.cpp.
|
inline |
Get current tick of the System clock
Definition at line 108 of file TimeService.hpp.
Get clicks passed since a certain moment
Definition at line 124 of file TimeService.hpp.
TimeService::ticks RTT::TimeService::ticksSince | ( | TimeService::ticks | relativeTime | ) | const |
Get clicks passed since a certain moment. If relativeTime is zero, the absolute system time is given.
Definition at line 137 of file TimeService.cpp.
|
staticprivate |
Our only instance of the TimeService
Definition at line 249 of file TimeService.hpp.
|
static |
The largest number representable in nsecs.
Definition at line 231 of file TimeService.hpp.
|
static |
The largest number representable in Seconds.
Definition at line 236 of file TimeService.hpp.
|
static |
The largest number representable in ticks.
Definition at line 226 of file TimeService.hpp.
|
private |
System wide offset of time.
Definition at line 254 of file TimeService.hpp.
|
private |
Definition at line 256 of file TimeService.hpp.