VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DtPeriodicTimer Class Reference

File: periTimer.h. More...

Inheritance diagram for DtPeriodicTimer:
Inheritance graph
[legend]

Public Member Functions

 DtPeriodicTimer (const DtClock *clock, const unsigned int type, const DtTime period, const DtTimerCallbackFcn callback, void *usr)
 The usr pointer points to some user-specified data that will be passed into the given callback when the timer fires.
virtual ~DtPeriodicTimer ()
virtual void fire ()
 Sets off (fires) the timer.
- Public Member Functions inherited from DtTimer
 DtTimer (const unsigned int type, const DtTime fireTime, const DtTimerCallbackFcn callback, void *usr)
 constructor The type parameter is an integer assigned by the caller for debugging purposes.
 DtTimer (const DtTimer &orig)
 copy constructor
DtTimeroperator= (const DtTimer &orig)
 assignment operator
virtual ~DtTimer ()
 destructor
virtual bool tick (const DtTime simTime)
 If time to fire, calls fire and returns true.
virtual void reset (const DtTime fireTime)
 Resets the time to fire.
virtual void cancel ()
 Sets cancelled state to true, fired state to false.
virtual bool fired () const
 Returns whether or not timer has fired.
virtual DtTime fireTime () const
 Simulation time that timer is scheduled to fire.
virtual unsigned int timerType () const
 User-specified integer used to identify the purpose of the timer.
virtual void * usrData ()
 Pointer to user-specified data to be passed into callback when timer fires.
virtual bool cancelled () const
 Returns whether or not timer has been cancelled (if its cancel() member has been called).
virtual void setResortPending ()
 Resort pending state is used by a DtScheduler as it manages when it wants to resort the timers it is maintaining.
virtual void clearResortPending ()
virtual bool resortPending () const
virtual void setDeleteAfterFire ()
 Designates timer whether or not should be automatically deleted after it has fired.
virtual void clearDeleteAfterFire ()
virtual bool deleteAfterFire () const
 Indicates if timer has been configured to be automatically deleted upon firing or not (in which case creator of timer is responsible for deleting timer after it has fired).
virtual bool managed () const
 Indicates whether or not timer is being managed by a DtScheduler or not.
virtual void setScheduler (DtScheduler *scheduler)
 Sets the DtScheduler responsible for managing this timer.

Protected Member Functions

DtPeriodicTimeroperator= (const DtPeriodicTimer &orig)
 not defined

Private Attributes

const DtTime myPeriod
const DtClockmyClock

Additional Inherited Members

- Protected Attributes inherited from DtTimer
DtSchedulermyScheduler
const DtTimerCallbackFcn myCallback
const unsigned int myType
void * myUsrData
 This pointer is the property of the DtTimer user and should not be modified in any way by DtTimer.
bool myFired
bool myDeleteAfterFire
bool myCancelled
DtTime myFireTime
bool myResortPending

Detailed Description

File: periTimer.h.

Class: DtPeriodicTimer

Description: A periodic timer resets itself after firing to fire 'period' seconds after the time at which it was scheduled to fire.

Constructor & Destructor Documentation

DtPeriodicTimer::DtPeriodicTimer ( const DtClock clock,
const unsigned int  type,
const DtTime  period,
const DtTimerCallbackFcn  callback,
void *  usr 
)

The usr pointer points to some user-specified data that will be passed into the given callback when the timer fires.

The usr pointer is owned by the caller (who is therefore responsible for destroying it) and it should not be modified by this class in any way.

virtual DtPeriodicTimer::~DtPeriodicTimer ( )
virtual

Member Function Documentation

DtPeriodicTimer& DtPeriodicTimer::operator= ( const DtPeriodicTimer orig)
protected

not defined

virtual void DtPeriodicTimer::fire ( )
virtual

Sets off (fires) the timer.

Sets the fired state to true. If a callback exists, invokes the callback. If myScheduler has been set, calls scheduler's reSort() member passing in this object as the argument.

Reimplemented from DtTimer.

Member Data Documentation

const DtTime DtPeriodicTimer::myPeriod
private
const DtClock* DtPeriodicTimer::myClock
private

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

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)