10 #include "legionDataStore/writeStateInstance.h"
12 #include <vlutil/vlString.h>
58 : DtFrameStateInterface(storage)
80 const bool leftIndicatorLightsOn()
const;
81 void setLeftIndicatorLightsOn(
const bool&);
83 const bool rightIndicatorLightsOn()
const;
84 void setRightIndicatorLightsOn(
const bool&);
86 const bool emergencyLightsOn()
const;
87 void setEmergencyLightsOn(
const bool&);
93 virtual void makeReadOnly() {};
112 const bool leftIndicatorLightsOn()
const;
113 const bool rightIndicatorLightsOn()
const;
114 const bool emergencyLightsOn()
const;
116 friend class DtGroundVehicleLightingStateImplementation;
141 if (myNextFrameState.isWritable())
143 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
146 myCurrentFrameState.emitComponentUpdated();
151 myCurrentFrameState.updateStateData(sd);
152 myNextFrameState.updateStateData(sd);
158 myCurrentFrameState.aboutToBeDeleted();
159 myNextFrameState.aboutToBeDeleted();
const DtGroundVehicleLightingStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: groundVehicleLightingStateComponent.h:110
const DtFrameStateInterface * currentFrameState() const
Definition: groundVehicleLightingStateComponent.h:135
1) Define the interface class that will be used to represent the next and curent frames. The UNDEFINED_ macros are convenience macros that will define methods that throw exceptions (until they are implemented)
Definition: groundVehicleLightingStateComponent.h:52
bool myLeftIndicatorLightsOn
Definition: groundVehicleLightingStateComponent.h:45
DtGroundVehicleLightingStateComponentData & operator=(const DtGroundVehicleLightingStateComponentData &orig)
Definition: groundVehicleLightingStateComponent.h:31
bool myRightIndicatorLightsOn
Definition: groundVehicleLightingStateComponent.h:46
virtual void makeWritable()
Override to make component writable.
Definition: groundVehicleLightingStateComponent.h:90
Definition: stateComponent.h:266
DtGroundVehicleLightingStateComponentCurrentFrame myCurrentFrameState
Definition: groundVehicleLightingStateComponent.h:163
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: groundVehicleLightingStateComponent.h:129
bool isDoubleBuffered()
Definition: groundVehicleLightingStateComponent.h:134
virtual void aboutToBeDeleted() override
Definition: groundVehicleLightingStateComponent.h:155
const DtGroundVehicleLightingStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: groundVehicleLightingStateComponent.h:77
void advanceFrame(const DtGroundVehicleLightingStateComponentData &data)
Definition: groundVehicleLightingStateComponent.h:117
bool myEmergencyLightsOn
Definition: groundVehicleLightingStateComponent.h:47
Definition: stateComponent.h:101
DtStateComponentCreator< DtGroundVehicleLightingStateComponentImplementation > DtGroundVehicleLightingStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: groundVehicleLightingStateComponent.h:169
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
virtual const DtFrameStateInterface * nextFrameState() const
Definition: groundVehicleLightingStateComponent.h:137
Definition: groundVehicleLightingStateComponent.h:16
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
DtGroundVehicleLightingStateComponentData myData
Definition: groundVehicleLightingStateComponent.h:98
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: groundVehicleLightingStateComponent.h:149
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
virtual DtFrameStateInterface * nextFrameState()
Definition: groundVehicleLightingStateComponent.h:136
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: groundVehicleLightingStateComponent.h:139
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
3) Define the current frame class. This will be used for read access.
Definition: groundVehicleLightingStateComponent.h:102
2) Define the next frame class. This will be used for write access.
Definition: groundVehicleLightingStateComponent.h:69
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
DtGroundVehicleLightingStateComponentData myData
Definition: groundVehicleLightingStateComponent.h:124
DtGroundVehicleLightingStateComponentData()
Definition: groundVehicleLightingStateComponent.h:18
DtGroundVehicleLightingStateComponentNextFrame myNextFrameState
Definition: groundVehicleLightingStateComponent.h:164
DtGroundVehicleLightingStateComponentData(const DtGroundVehicleLightingStateComponentData &orig)
Definition: groundVehicleLightingStateComponent.h:24
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:26
Contains the DtStateComponent class declaration.
DtGroundVehicleLightingStateComponentData & frameState()
Definition: groundVehicleLightingStateComponent.h:78
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
DtStateData * myStateData
Definition: groundVehicleLightingStateComponent.h:123