![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2009 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtSimEntry.h,v $ $Revision: 1.14 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtSimEntry_H_ 00014 #define DtSimEntry_H_ 00015 00016 #include <vrvCore/vrvCore.h> 00017 #include <vrvCore/DtUniqueID.h> 00018 #include <vrvCore/DtSimEntryUpdater.h> 00019 00020 #include <vector> 00021 #include <map> 00022 00023 namespace makVrv 00024 { 00025 class DtDe; 00026 struct DtSimState; 00027 class DtBaseStateView; 00028 00031 class DT_DLL_VRVCORE DtSimEntry 00032 { 00033 public: 00034 00036 friend class DtSimData; 00037 00039 DtSimEntry(DtDe& de, DtUniqueID id); 00040 00042 virtual ~DtSimEntry(); 00043 00045 typedef std::vector<DtSimState*> SimStateVector; 00046 00048 typedef std::multimap< DtSimEntryUpdater::UpdateRate, DtBaseStateView* > UpdateRateMap; 00049 00051 const SimStateVector& simStates() const; 00052 00054 bool addState(DtSimState* state); 00055 00057 bool removeState(DtSimState* state); 00058 00060 void forceUpdate(DtBaseStateView* stateView); 00061 00064 void setUpdateRate(DtSimEntryUpdater::UpdateRate rate, DtBaseStateView* stateView); 00065 00067 DtSimEntryUpdater::UpdateRate rateForView(DtBaseStateView* stateView) const; 00068 00071 void stateUpdated(); 00072 00074 DtUniqueID id() const; 00075 00076 protected: 00077 00078 //Clears out the internal state. 00079 void reset(); 00080 00083 void addStateViewToUpdateRateMap(DtSimEntryUpdater::UpdateRate rate, 00084 DtBaseStateView* stateView); 00085 00088 void removeStateViewFromUpdateRateMap(DtBaseStateView* stateView); 00089 00091 DtSimEntryUpdater::UpdateRate maxUpdateRate(); 00092 00094 DtSimEntryUpdater::UpdateRate minUpdateRate(); 00095 00096 protected: 00097 00098 DtDe& myDe; 00099 DtUniqueID myId; 00100 SimStateVector mySimStateVector; 00101 UpdateRateMap myUpdateRateMap; 00102 unsigned long long myUpdateCounter; 00103 bool myForceUpdatePending; 00104 }; 00105 } 00106 00107 #endif 00108