13 #ifndef DtStateView_H_
14 #define DtStateView_H_
19 #include <boost/signal.hpp>
21 #include <vlutil/vlExceptions.h>
39 virtual void emitStateViewUpdated() = 0;
51 template<
class StateType>
76 const StateType&
state();
79 const StateType&
state()
const;
112 template<
class StateType>
121 DtTHROW_NEW(DtCorruptedState,
122 "Unable to create DtStateView from DtSimEntry."
123 "Use isCompatible() before creating DtStateView.");
127 template<
class StateType>
134 template<
class StateType>
137 mySimEntry.forceUpdate(
this);
140 template<
class StateType>
143 mySimEntry.setUpdateRate(rate,
this);
146 template<
class StateType>
149 signal_stateViewUpdated(
this);
152 template<
class StateType>
164 template<
class StateType>
168 StateType* tState =
dynamic_cast<StateType*
>(&state);
176 template <
class StateType>
179 DtSimEntry::SimStateVector::const_iterator pos = entry.
simStates().begin();
180 DtSimEntry::SimStateVector::const_iterator endPos = entry.
simStates().end();
181 for(; pos != endPos; ++pos)
183 StateType* tState =
dynamic_cast<StateType*
>(*pos);
192 template<
class StateType>
198 template<
class StateType>
const SimStateVector & simStates() const
SimStateVector accessor.
virtual ~DtStateView()
DTOR.
Definition: DtStateView.h:128
UpdateRate
Definition: DtSimEntryUpdater.h:34
StateType * myState
Definition: DtStateView.h:109
DtUniqueID id() const
Return the unique Id of this entry.
DtStateView()
Non-Existant.
static StateType * findState(DtSimEntry &entry)
Returns a pointer to the state type for an entry, if the state is not found a null pointer is returne...
Definition: DtStateView.h:177
A DtBaseStateView is a the base class for all DtStateView's.
Definition: DtStateView.h:28
A DtSimEntry is a container of DtSimState's and represents the total state of an simulation object...
Definition: DtSimEntry.h:31
virtual void emitStateViewUpdated()
This will get called by the DtSimEntry when the state for this view has been updated.
Definition: DtStateView.h:147
Definition: DtSimEntryUpdater.h:36
void forceUpdate()
Force a single update which will be sent to all views regardless of update rates. ...
Definition: DtStateView.h:135
Contains makVrv::DtSimEntry class.
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
A DtStateView is a the interface to simulation state information.
Definition: DtStateView.h:52
boost::signal< void(DtStateView< StateType > *)> signal_stateViewUpdated
Emitted when a this view's state has been updated.
Definition: DtStateView.h:92
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
const StateType & state()
Return the state this is a view onto.
Definition: DtStateView.h:193
Contains makVrv::DtSimEntryUpdater class.
A DtSimState is the base class for all state objects.
Definition: DtSimState.h:22
DtSimEntry & mySimEntry
Definition: DtStateView.h:108
DtStateView & operator=(const DtStateView &)
static bool isCompatible(DtSimEntry &entry)
Returns true if the DtSimEntry contains a state of type T.
Definition: DtStateView.h:153
void setUpdateRate(DtSimEntryUpdater::UpdateRate rate)
Set the rate this view will be updated with state information.
Definition: DtStateView.h:141
DtUniqueID id() const
Definition: DtStateView.h:94
Contains DLL export macros.