$search

RTT::os::TimeService Class Reference
[Time measurement classes.]

#include <TimeService.hpp>

List of all members.

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 (nsecs &relativeTime) const
nsecs getNSecs () const
Seconds getSeconds (ticks &relativeTime) const
ticks getTicks (ticks &relativeTime) const
ticks getTicks () const
Seconds secondsChange (Seconds delta)
Seconds secondsGet (ticks &relativeTime) const
Seconds secondsSince (ticks relativeTime) const
ticks ticksGet (ticks &relativeTime) const
ticks ticksGet () const
ticks ticksSince (ticks relativeTime) const
virtual ~TimeService ()

Static Public Member Functions

static TimeServiceInstance ()
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

Detailed Description

The TimeService is used for system-wide time keeping and conversions.

Definition at line 35 of file TimeService.hpp.


Member Typedef Documentation

An integer representation of miliseconds

Definition at line 51 of file TimeService.hpp.

typedef long long RTT::os::TimeService::nsecs

An integer representation of nanoseconds

Definition at line 61 of file TimeService.hpp.

The type used to store SI unit time keeping

Definition at line 41 of file TimeService.hpp.

An integer representation of seconds

Definition at line 46 of file TimeService.hpp.

typedef long long RTT::os::TimeService::ticks

The type for the systems clock tick.

Definition at line 66 of file TimeService.hpp.

An integer representation of microseconds

Definition at line 56 of file TimeService.hpp.


Constructor & Destructor Documentation

RTT::TimeService::~TimeService (  )  [virtual]

Destructor

Definition at line 71 of file TimeService.cpp.

RTT::TimeService::TimeService (  )  [protected]

Constructor

Definition at line 65 of file TimeService.cpp.


Member Function Documentation

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 76 of file TimeService.cpp.

TimeService::nsecs RTT::TimeService::getNSecs ( TimeService::nsecs relativeTime  )  const

Get nsecs passed since a certain moment

Returns:
nsecs passed since relativeTime unless relativeTime is zero, then sets relativeTime = timeGet() and returns zero

Definition at line 146 of file TimeService.cpp.

TimeService::nsecs RTT::TimeService::getNSecs (  )  const

Get current nsecs of the System clock

Returns:
current nsecs of the system clock

Definition at line 140 of file TimeService.cpp.

TimeService::Seconds RTT::TimeService::getSeconds ( TimeService::ticks relativeTime  )  const

Get the time in seconds passed since a certain moment

Returns:
seconds passed since relativeTime unless relativeTime is zero, then sets relativeTime = timeGet() and returns zero

Definition at line 121 of file TimeService.cpp.

TimeService::ticks RTT::TimeService::getTicks ( TimeService::ticks relativeTime  )  const

Get clicks passed since a certain moment

Returns:
ticks passed since relativeTime unless relativeTime is zero, then sets relativeTime = timeGet() and returns zero

Definition at line 103 of file TimeService.cpp.

TimeService::ticks RTT::TimeService::getTicks (  )  const

Get current tick of the System clock

Returns:
current tick of the system clock

Definition at line 97 of file TimeService.cpp.

TimeService * RTT::TimeService::Instance (  )  [static]

Definition at line 41 of file TimeService.cpp.

TimeService::ticks RTT::TimeService::nsecs2ticks ( const nsecs  m  )  [static]

Convert an amount of nano seconds to System ticks

Parameters:
m The amount of nano seconds
Returns:
The equivalent in ticks

Definition at line 31 of file TimeService.cpp.

bool RTT::TimeService::Release (  )  [static]

Releases the TimeService Reference counting might aid in making this call safe

Returns:
true on success, false on failure

Definition at line 52 of file TimeService.cpp.

TimeService::Seconds RTT::TimeService::secondsChange ( TimeService::Seconds  delta  ) 

Change the time with delta seconds.

Returns:
the new time.

Definition at line 133 of file TimeService.cpp.

Seconds RTT::os::TimeService::secondsGet ( ticks relativeTime  )  const [inline]

Get the time in seconds passed since a certain moment

Returns:
seconds passed since relativeTime unless relativeTime is zero, then sets relativeTime = timeGet() and returns zero
Deprecated:
by getSeconds()

Definition at line 133 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.

Returns:
Seconds passed since relativeTime.

Definition at line 127 of file TimeService.cpp.

TimeService::nsecs RTT::TimeService::ticks2nsecs ( const ticks  t  )  [static]

Convert an amount of ticks to nano seconds

Definition at line 36 of file TimeService.cpp.

ticks RTT::os::TimeService::ticksGet ( ticks relativeTime  )  const [inline]

Get clicks passed since a certain moment

Returns:
ticks passed since relativeTime unless relativeTime is zero, then sets relativeTime = timeGet() and returns zero
Deprecated:
by getTicks()

Definition at line 106 of file TimeService.hpp.

ticks RTT::os::TimeService::ticksGet (  )  const [inline]

Get current tick of the System clock

Returns:
current tick of the system clock
Deprecated:
by getTicks()

Definition at line 90 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.

Returns:
ticks passed since relativeTime.

Definition at line 114 of file TimeService.cpp.


Member Data Documentation

TimeService * RTT::TimeService::_instance = 0 [static, private]

Our only instance of the TimeService

Definition at line 219 of file TimeService.hpp.

The largest number representable in nsecs.

Definition at line 201 of file TimeService.hpp.

The largest number representable in Seconds.

Definition at line 206 of file TimeService.hpp.

The largest number representable in ticks.

Definition at line 196 of file TimeService.hpp.

System wide offset of time.

Definition at line 224 of file TimeService.hpp.

Definition at line 226 of file TimeService.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Mar 1 16:27:52 2013