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:

List of all members.

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.


Member Function Documentation

DtAbsoluteTime MAKLogger::DtLgrClock::currentTime ( ) const

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

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::tick ( ) [virtual]

Tick the clock which increments the time.

Calculated via currentTime = currentTime + time elapsed * timescale


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

Document ID: Generated on Tue Oct 11 19:41:03 EDT 2011 from SVN revision 107422
Copyright © 2005-2011 VT MÄK Inc. All Rights Reserved (www.mak.com)