MAK Data Logger API Documentation for HLA
List of all members | Public Member Functions | Protected Attributes
MAKLogger::DtLgrClock Class Reference

A clock which provides time steps via a time provider and with optional scaling. More...

+ Collaboration diagram for MAKLogger::DtLgrClock:

Public Member Functions

 DtLgrClock (const DtTimeProvider *timeProvider)
 Constructor timeProvider - a pointer (owned by someone else) of the DtTime Provider class.
virtual ~DtLgrClock ()
 Destructor.
virtual void tick ()
 Tick the clock which increments the time.
DtAbsoluteTime currentTime () const
 Gets the current time, this value will not change until tick is called again.
void setCurrentTime (const DtAbsoluteTime &newTime)
 Sets the internal current time.
virtual DtAbsoluteTime pendingTime () const
 Get the pending time - time if provider were ticked now.
DtRelativeTime lastTimeStep () const
 The last change in time between ticks.
virtual void stop ()
 The same as two calls to setCurrentTime( 0.0 ), setTimeScale( 0.0 );.
virtual void pause ()
 The same as a call to setTimeScale( 0.0 );.
virtual void setTimeScale (double scaleValue)
 Changes the time scale.
virtual double timeScale () const
 Gets the time scale value.
virtual void setTimeProvider (const DtTimeProvider *timeProvider)
 Set the time provider.
virtual const DtTimeProvidertimeProvider () const
 Get the time provider.

Protected Attributes

const DtTimeProvidermyTimeProvider
DtAbsoluteTime myLastTime
DtAbsoluteTime myCurrentTime
DtRelativeTime myLastTimeStep
double myTimeScale

Detailed Description

A clock which provides time steps via a time provider and with optional scaling.

Constructor & Destructor Documentation

MAKLogger::DtLgrClock::DtLgrClock ( const DtTimeProvider timeProvider)

Constructor timeProvider - a pointer (owned by someone else) of the DtTime Provider class.

DtLgrClock does not take ownership of this pointer, it only uses it.

virtual MAKLogger::DtLgrClock::~DtLgrClock ( )
virtual

Destructor.

Member Function Documentation

DtAbsoluteTime MAKLogger::DtLgrClock::currentTime ( ) const

Gets the current time, this value will not change until tick is called again.

DtRelativeTime MAKLogger::DtLgrClock::lastTimeStep ( ) const

The last change in time between ticks.

virtual void MAKLogger::DtLgrClock::pause ( )
virtual

The same as a call to setTimeScale( 0.0 );.

virtual DtAbsoluteTime MAKLogger::DtLgrClock::pendingTime ( ) const
virtual

Get the pending time - time if provider were ticked now.

void MAKLogger::DtLgrClock::setCurrentTime ( const DtAbsoluteTime newTime)

Sets the internal current time.

virtual void MAKLogger::DtLgrClock::setTimeProvider ( const DtTimeProvider timeProvider)
virtual

Set the time provider.

This class does not take ownership of this pointer, and only uses it.

virtual void MAKLogger::DtLgrClock::setTimeScale ( double  scaleValue)
virtual

Changes the time scale.

Warning
SetTimeScale internally calls tick before modifying the time scale.
virtual void MAKLogger::DtLgrClock::stop ( )
virtual

The same as two calls to setCurrentTime( 0.0 ), setTimeScale( 0.0 );.

virtual void MAKLogger::DtLgrClock::tick ( )
virtual

Tick the clock which increments the time.

Calculated via currentTime = currentTime + time elapsed * timescale

virtual const DtTimeProvider* MAKLogger::DtLgrClock::timeProvider ( ) const
virtual

Get the time provider.

virtual double MAKLogger::DtLgrClock::timeScale ( ) const
virtual

Gets the time scale value.

Member Data Documentation

DtAbsoluteTime MAKLogger::DtLgrClock::myCurrentTime
protected
DtAbsoluteTime MAKLogger::DtLgrClock::myLastTime
protected
DtRelativeTime MAKLogger::DtLgrClock::myLastTimeStep
protected
const DtTimeProvider* MAKLogger::DtLgrClock::myTimeProvider
protected
double MAKLogger::DtLgrClock::myTimeScale
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Apr 11 12:13:00 EDT 2013 from SVN revision 126011
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)