![]() |
VR-Forces 5.0.3 Developer's Guide
|
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 |
|
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 |
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.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |