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

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

#include <rtt/TimeService.hpp>

List of all members.

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 TimeServiceInstance ()
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
 The largest number representable in ticks.
static const nsecs InfiniteNSecs
 The largest number representable in nsecs.
static const Seconds InfiniteSeconds
 The largest number representable in Seconds.

Protected Member Functions

 TimeService ()
 Constructor.

Detailed Description

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

Definition at line 34 of file TimeService.hpp.


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.

nsecs RTT::TimeService::getNSecs ( 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
nsecs RTT::TimeService::getNSecs (  )  const

Get current nsecs of the System clock.

Returns:
current nsecs of the system clock
Seconds RTT::TimeService::getSeconds ( 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
ticks RTT::TimeService::getTicks ( 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
ticks RTT::TimeService::getTicks (  )  const

Get current tick of the System clock.

Returns:
current tick of the system clock
static 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
static bool RTT::TimeService::Release (  )  [static]

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

Returns:
true on success, false on failure
Seconds RTT::TimeService::secondsChange ( Seconds  delta  ) 

Change the time with delta seconds.

Returns:
the new time.
Seconds RTT::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 132 of file TimeService.hpp.

Seconds RTT::TimeService::secondsSince ( 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.
ticks RTT::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 105 of file TimeService.hpp.

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

Get current tick of the System clock.

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

Definition at line 89 of file TimeService.hpp.

ticks RTT::TimeService::ticksSince ( 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.

The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:45 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3