VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtBalancedUpdater.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtBalancedUpdater.h,v $ $Revision: 1.4 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtBalancedUpdater_H_
14 #define DtBalancedUpdater_H_
15 
16 #include <vrvUtil/vrvUtil.h>
17 #include <vector>
18 
19 namespace makVrv
20 {
28  template <typename Updatee>
30  {
31  public:
32 
35  DtBalancedUpdater(double timeStep = 1.0);
36 
38  virtual ~DtBalancedUpdater();
39 
42  void addUpdatee(const Updatee& updater);
43 
45  void removeUpdatee(const Updatee& updater);
46 
48  void update(double newTime);
49 
51  void finishUpdates(double newTime);
52 
54  size_t numberOfUpdatees() const;
55 
57  double timeStep() const;
58 
64  void setTimeStep(double timeStep);
65 
66  protected:
67 
68  typedef std::vector<Updatee> UpdateeList;
69 
70  double myTimeStep;
71  double myCurrentTime;
73 
76  };
77 }
78 
79 #define DtBalancedUpdater_INL_
80 #include <vrvUtil/DtBalancedUpdater.inl>
81 #undef DtBalancedUpdater_INL_
82 
83 #endif
84 
virtual ~DtBalancedUpdater()
Override if necessary.
void addUpdatee(const Updatee &updater)
Add an updatee object to the group.
UpdateeList myFinishedList
Definition: DtBalancedUpdater.h:75
std::vector< Updatee > UpdateeList
Definition: DtBalancedUpdater.h:68
Contains DLL export macros.
double myTimeStep
Definition: DtBalancedUpdater.h:70
void removeUpdatee(const Updatee &updater)
Remove an updater object from the group.
void setTimeStep(double timeStep)
Change the time step of the updater which is the time between updates of a particular instance...
size_t numberOfUpdatees() const
Get the number of updaters added.
UpdateeList myWaitingList
Definition: DtBalancedUpdater.h:74
DtBalanacedUpdater updates updatee classes at a desired rate in a fair (each instance gets the same n...
Definition: DtBalancedUpdater.h:29
void update(double newTime)
Update the group, this function should be called frequently.
size_t myInitialWaitingSize
Definition: DtBalancedUpdater.h:72
void finishUpdates(double newTime)
Finish all remaining updates.
double myCurrentTime
Definition: DtBalancedUpdater.h:71
double timeStep() const
Get the time step of the updater.
DtBalancedUpdater(double timeStep=1.0)
Create a balanced updater which will update at a given rate.

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)