VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Attributes
makVrv::DtBalancedUpdater< Updatee > Class Template Reference

template<typename Updatee>
class makVrv::DtBalancedUpdater< Updatee >

DtBalanacedUpdater updates updatee classes at a desired rate in a fair (each instance gets the same number of updates) and balanced (the updates are distributed over time). To work effectively the updater must be updated at a faster rate than the desired update rate of the instances. The updatee class must provide a 'update(double curTime)' function. The updatee class should support value semantics. And must be comparable.

Public Member Functions

 DtBalancedUpdater (double timeStep=1.0)
 
virtual ~DtBalancedUpdater ()
 
void addUpdatee (const Updatee &updater)
 
void removeUpdatee (const Updatee &updater)
 
void update (double newTime)
 
void finishUpdates (double newTime)
 
size_t numberOfUpdatees () const
 
double timeStep () const
 
void setTimeStep (double timeStep)
 

Protected Types

typedef std::vector< Updatee > UpdateeList
 

Protected Attributes

double myTimeStep
 
double myCurrentTime
 
size_t myInitialWaitingSize
 
UpdateeList myWaitingList
 
UpdateeList myFinishedList
 

Member Typedef Documentation

template<typename Updatee >
typedef std::vector<Updatee> makVrv::DtBalancedUpdater< Updatee >::UpdateeList
protected

Constructor & Destructor Documentation

template<typename Updatee >
makVrv::DtBalancedUpdater< Updatee >::DtBalancedUpdater ( double  timeStep = 1.0)

Create a balanced updater which will update at a given rate. Time step may not be 0.0.

template<typename Updatee >
virtual makVrv::DtBalancedUpdater< Updatee >::~DtBalancedUpdater ( )
virtual

Override if necessary.

Member Function Documentation

template<typename Updatee >
void makVrv::DtBalancedUpdater< Updatee >::addUpdatee ( const Updatee &  updater)

Add an updatee object to the group. The updatee class should support value semantics.

template<typename Updatee >
void makVrv::DtBalancedUpdater< Updatee >::removeUpdatee ( const Updatee &  updater)

Remove an updater object from the group.

template<typename Updatee >
void makVrv::DtBalancedUpdater< Updatee >::update ( double  newTime)

Update the group, this function should be called frequently.

template<typename Updatee >
void makVrv::DtBalancedUpdater< Updatee >::finishUpdates ( double  newTime)

Finish all remaining updates.

template<typename Updatee >
size_t makVrv::DtBalancedUpdater< Updatee >::numberOfUpdatees ( ) const

Get the number of updaters added.

template<typename Updatee >
double makVrv::DtBalancedUpdater< Updatee >::timeStep ( ) const

Get the time step of the updater.

template<typename Updatee >
void makVrv::DtBalancedUpdater< Updatee >::setTimeStep ( double  timeStep)

Change the time step of the updater which is the time between updates of a particular instance. Typically would would want to call finishUpdates before calling this function. Time step may not be 0.0.

Member Data Documentation

template<typename Updatee >
double makVrv::DtBalancedUpdater< Updatee >::myTimeStep
protected
template<typename Updatee >
double makVrv::DtBalancedUpdater< Updatee >::myCurrentTime
protected
template<typename Updatee >
size_t makVrv::DtBalancedUpdater< Updatee >::myInitialWaitingSize
protected
template<typename Updatee >
UpdateeList makVrv::DtBalancedUpdater< Updatee >::myWaitingList
protected
template<typename Updatee >
UpdateeList makVrv::DtBalancedUpdater< Updatee >::myFinishedList
protected

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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)