10 #ifndef DtStateView_H_
11 #define DtStateView_H_
18 #include <vlutil/vlExceptions.h>
36 virtual void emitStateViewUpdated() = 0;
48 template<
class StateType>
73 const StateType&
state();
76 const StateType&
state()
const;
109 template<
class StateType>
118 DtTHROW_NEW(DtCorruptedState,
119 "Unable to create DtStateView from DtSimEntry."
120 "Use isCompatible() before creating DtStateView.");
124 template<
class StateType>
131 template<
class StateType>
134 mySimEntry.forceUpdate(
this);
137 template<
class StateType>
140 mySimEntry.setUpdateRate(rate,
this);
143 template<
class StateType>
146 signal_stateViewUpdated(
this);
149 template<
class StateType>
161 template<
class StateType>
165 StateType* tState =
dynamic_cast<StateType*
>(&state);
173 template <
class StateType>
176 DtSimEntry::SimStateVector::const_iterator pos = entry.
simStates().begin();
177 DtSimEntry::SimStateVector::const_iterator endPos = entry.
simStates().end();
178 for(; pos != endPos; ++pos)
180 StateType* tState =
dynamic_cast<StateType*
>(*pos);
189 template<
class StateType>
195 template<
class StateType>
const SimStateVector & simStates() const
SimStateVector accessor.
virtual ~DtStateView()
DTOR.
Definition: DtStateView.h:125
UpdateRate
Definition: DtSimEntryUpdater.h:31
StateType * myState
Definition: DtStateView.h:106
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:174
A DtBaseStateView is a the base class for all DtStateView's.
Definition: DtStateView.h:25
A DtSimEntry is a container of DtSimState's and represents the total state of an simulation object...
Definition: DtSimEntry.h:27
virtual void emitStateViewUpdated()
This will get called by the DtSimEntry when the state for this view has been updated. This emits a signal containing the state view that was updated.
Definition: DtStateView.h:144
Definition: DtSimEntryUpdater.h:33
void forceUpdate()
Force a single update which will be sent to all views regardless of update rates. ...
Definition: DtStateView.h:132
Contains makVrv::DtSimEntry class.
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
A DtStateView is a the interface to simulation state information. Users can create DtStateViews for s...
Definition: DtStateView.h:49
const StateType & state()
Return the state this is a view onto.
Definition: DtStateView.h:190
Contains makVrv::DtSimEntryUpdater class.
boost::signalslib::signal< void(DtStateView< StateType > *)> signal_stateViewUpdated
Emitted when a this view's state has been updated.
Definition: DtStateView.h:89
A DtSimState is the base class for all state objects. Derived instances of DtSimState will be created...
Definition: DtSimState.h:19
DtSimEntry & mySimEntry
Definition: DtStateView.h:105
DtStateView & operator=(const DtStateView &)
static bool isCompatible(DtSimEntry &entry)
Returns true if the DtSimEntry contains a state of type T.
Definition: DtStateView.h:150
void setUpdateRate(DtSimEntryUpdater::UpdateRate rate)
Set the rate this view will be updated with state information.
Definition: DtStateView.h:138
DtUniqueID id() const
Definition: DtStateView.h:91
Contains DLL export macros.