VR-Forces 4.10 Class Documentation
 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

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). More...

Public Member Functions

 DtBalancedUpdater (double timeStep=1.0)
 Create a balanced updater which will update at a given rate. More...
 
virtual ~DtBalancedUpdater ()
 Override if necessary. More...
 
void addUpdatee (const Updatee &updater)
 Add an updatee object to the group. More...
 
void removeUpdatee (const Updatee &updater)
 Remove an updater object from the group. More...
 
void update (double newTime)
 Update the group, this function should be called frequently. More...
 
void finishUpdates (double newTime)
 Finish all remaining updates. More...
 
size_t numberOfUpdatees () const
 Get the number of updaters added. More...
 
double timeStep () const
 Get the time step of the updater. More...
 
void setTimeStep (double timeStep)
 Change the time step of the updater which is the time between updates of a particular instance. More...
 

Protected Types

typedef std::vector< Updatee > UpdateeList
 

Protected Attributes

double myTimeStep
 
double myCurrentTime
 
size_t myInitialWaitingSize
 
UpdateeList myWaitingList
 
UpdateeList myFinishedList
 

Detailed Description

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.

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 Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)