#include <rtt/TimeService.hpp>
Definition at line 33 of file TimeService.hpp.
Public Types | |
| typedef double | Seconds |
| The type used to store SI unit time keeping. | |
| typedef long | secs |
| An integer representation of seconds. | |
| typedef long | msecs |
| An integer representation of miliseconds. | |
| typedef long | usecs |
| An integer representation of microseconds. | |
| typedef long long | nsecs |
| An integer representation of nanoseconds. | |
| typedef long long | ticks |
| The type for the systems clock tick. | |
Public Member Functions | |
| virtual | ~TimeService () |
| Destructor. | |
| ticks | ticksGet () const |
| Get current tick of the System clock. | |
| ticks | getTicks () const |
| Get current tick of the System clock. | |
| ticks | ticksGet (ticks &relativeTime) const |
| Get clicks passed since a certain moment. | |
| ticks | getTicks (ticks &relativeTime) const |
| Get clicks passed since a certain moment. | |
| ticks | ticksSince (ticks relativeTime) const |
| Get clicks passed since a certain moment. | |
| Seconds | secondsGet (ticks &relativeTime) const |
| Get the time in seconds passed since a certain moment. | |
| Seconds | getSeconds (ticks &relativeTime) const |
| Get the time in seconds passed since a certain moment. | |
| Seconds | secondsSince (ticks relativeTime) const |
| Get Seconds passed since a certain moment. | |
| Seconds | secondsChange (Seconds delta) |
| Change the time with delta seconds. | |
| void | enableSystemClock (bool yes_no) |
| Enables or disables reading the system clock. | |
| nsecs | getNSecs () const |
| Get current nsecs of the System clock. | |
| nsecs | getNSecs (nsecs &relativeTime) const |
| Get nsecs passed since a certain moment. | |
Static Public Member Functions | |
| static TimeService * | Instance () |
| static bool | Release () |
| Releases the TimeService Reference counting might aid in making this call safe. | |
| static ticks | nsecs2ticks (const nsecs m) |
| Convert an amount of nano seconds to System ticks. | |
| static nsecs | ticks2nsecs (const ticks t) |
| Convert an amount of ticks to nano seconds. | |
Static Public Attributes | |
| static const ticks | InfiniteTicks = ::InfiniteTicks |
| The largest number representable in ticks. | |
| static const nsecs | InfiniteNSecs = ::InfiniteNSecs |
| The largest number representable in nsecs. | |
| static const Seconds | InfiniteSeconds = ::InfiniteSeconds |
| The largest number representable in Seconds. | |
Protected Member Functions | |
| TimeService () | |
| Constructor. | |
| bool Release | ( | ) | [static] |
Releases the TimeService Reference counting might aid in making this call safe.
Definition at line 57 of file TimeService.cpp.
| ticks ticksGet | ( | ) | const [inline] |
Get current tick of the System clock.
Definition at line 88 of file TimeService.hpp.
References TimeService::getTicks().
| TimeService::ticks getTicks | ( | ) | const |
Get current tick of the System clock.
Definition at line 102 of file TimeService.cpp.
References rtos_get_time_ticks().
Referenced by ConditionExpire::ConditionExpire(), Configurator::configure(), TimeService::getSeconds(), TimeService::getTicks(), DataSourceTime::reset(), ConditionExpire::reset(), ConditionDuration::reset(), ConditionDSDuration::reset(), Logger::startup(), TimeService::ticksGet(), and TimeService::ticksSince().
Get clicks passed since a certain moment.
Definition at line 104 of file TimeService.hpp.
References TimeService::getTicks().
| TimeService::ticks getTicks | ( | TimeService::ticks & | relativeTime | ) | const |
Get clicks passed since a certain moment.
Definition at line 108 of file TimeService.cpp.
References TimeService::getTicks().
| TimeService::ticks 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 119 of file TimeService.cpp.
References TimeService::getTicks().
Referenced by ConditionExpire::evaluate(), ConditionDuration::evaluate(), TimeService::secondsChange(), and TimeService::secondsSince().
Get the time in seconds passed since a certain moment.
Definition at line 131 of file TimeService.hpp.
References TimeService::getSeconds().
| TimeService::Seconds getSeconds | ( | TimeService::ticks & | relativeTime | ) | const |
Get the time in seconds passed since a certain moment.
Definition at line 126 of file TimeService.cpp.
References TimeService::getTicks(), RTT::nsecs_to_Seconds(), and TimeService::ticks2nsecs().
Referenced by TimeService::secondsGet().
| TimeService::Seconds 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 132 of file TimeService.cpp.
References RTT::nsecs_to_Seconds(), TimeService::ticks2nsecs(), and TimeService::ticksSince().
Referenced by Configurator::configure(), ConditionDSDuration::evaluate(), DataSourceTime::get(), and Logger::D::showTime().
| TimeService::Seconds secondsChange | ( | TimeService::Seconds | delta | ) |
Change the time with delta seconds.
Definition at line 138 of file TimeService.cpp.
References TimeService::nsecs2ticks(), RTT::nsecs_to_Seconds(), RTT::Seconds_to_nsecs(), TimeService::ticks2nsecs(), and TimeService::ticksSince().
Referenced by SimulationThread::run(), and SimulationThread::step().
| void enableSystemClock | ( | bool | yes_no | ) |
Enables or disables reading the system clock.
If disabled, you'll have to change time using secondsChange.
Definition at line 81 of file TimeService.cpp.
References rtos_get_time_ticks().
Referenced by SimulationThread::finalize(), and SimulationThread::initialize().
| TimeService::nsecs getNSecs | ( | ) | const |
Get current nsecs of the System clock.
Definition at line 145 of file TimeService.cpp.
References rtos_get_time_ns().
Referenced by Timer::arm(), TimeService::getNSecs(), Timer::loop(), Timer::startTimer(), and Timer::timeRemaining().
| TimeService::nsecs getNSecs | ( | TimeService::nsecs & | relativeTime | ) | const |
Get nsecs passed since a certain moment.
Definition at line 151 of file TimeService.cpp.
References TimeService::getNSecs().
| TimeService::ticks nsecs2ticks | ( | const nsecs | m | ) | [static] |
Convert an amount of nano seconds to System ticks.
| m | The amount of nano seconds |
Definition at line 36 of file TimeService.cpp.
References nano2ticks().
Referenced by TimeService::secondsChange().
1.5.3