![]() |
VR-Forces 4.0.4 Class Documentation
|
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. | |
| virtual | ~DtBalancedUpdater () |
| Override if necessary. | |
| void | addUpdatee (const Updatee &updater) |
| Add an updatee object to the group. | |
| void | removeUpdatee (const Updatee &updater) |
| Remove an updater object from the group. | |
| void | update (double newTime) |
| Update the group, this function should be called frequently. | |
| void | finishUpdates (double newTime) |
| Finish all remaining updates. | |
| size_t | numberOfUpdatees () const |
| Get the number of updaters added. | |
| double | timeStep () const |
| Get the time step of the updater. | |
| void | setTimeStep (double timeStep) |
| Change the time step of the updater which is the time between updates of a particular instance. | |
Protected Types | |
| typedef std::vector< Updatee > | UpdateeList |
Protected Attributes | |
| double | myTimeStep |
| double | myCurrentTime |
| size_t | myInitialWaitingSize |
| UpdateeList | myWaitingList |
| UpdateeList | myFinishedList |
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.
typedef std::vector<Updatee> makVrv::DtBalancedUpdater< Updatee >::UpdateeList [protected] |
| 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
| virtual makVrv::DtBalancedUpdater< Updatee >::~DtBalancedUpdater | ( | ) | [virtual] |
Override if necessary.
| void makVrv::DtBalancedUpdater< Updatee >::addUpdatee | ( | const Updatee & | updater | ) |
Add an updatee object to the group.
The updatee class should support value semantics.
| void makVrv::DtBalancedUpdater< Updatee >::removeUpdatee | ( | const Updatee & | updater | ) |
Remove an updater object from the group.
| void makVrv::DtBalancedUpdater< Updatee >::update | ( | double | newTime | ) |
Update the group, this function should be called frequently.
| void makVrv::DtBalancedUpdater< Updatee >::finishUpdates | ( | double | newTime | ) |
Finish all remaining updates.
| size_t makVrv::DtBalancedUpdater< Updatee >::numberOfUpdatees | ( | ) | const |
Get the number of updaters added.
| double makVrv::DtBalancedUpdater< Updatee >::timeStep | ( | ) | const |
Get the time step of the updater.
| 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
double makVrv::DtBalancedUpdater< Updatee >::myTimeStep [protected] |
double makVrv::DtBalancedUpdater< Updatee >::myCurrentTime [protected] |
size_t makVrv::DtBalancedUpdater< Updatee >::myInitialWaitingSize [protected] |
UpdateeList makVrv::DtBalancedUpdater< Updatee >::myWaitingList [protected] |
UpdateeList makVrv::DtBalancedUpdater< Updatee >::myFinishedList [protected] |