10 #include "legionDataStore/writeStateInstance.h"
12 #include <vlutil/vlString.h>
19 : myLeftIndicatorLightsOn(false)
20 , myRightIndicatorLightsOn(false)
21 , myEmergencyLightsOn(false)
45 bool myLeftIndicatorLightsOn;
46 bool myRightIndicatorLightsOn;
47 bool myEmergencyLightsOn;
58 : DtFrameStateInterface(storage)
80 virtual const bool leftIndicatorLightsOn()
const override;
81 virtual void setLeftIndicatorLightsOn(
const bool&)
override;
83 virtual const bool rightIndicatorLightsOn()
const override;
84 virtual void setRightIndicatorLightsOn(
const bool&)
override;
86 virtual const bool emergencyLightsOn()
const override;
87 virtual void setEmergencyLightsOn(
const bool&)
override;
93 virtual void makeReadOnly()
override {};
111 virtual const bool leftIndicatorLightsOn()
const override;
112 virtual const bool rightIndicatorLightsOn()
const override;
113 virtual const bool emergencyLightsOn()
const override;
115 friend class DtGroundVehicleLightingStateImplementation;
139 if (myNextFrameState.isWritable())
141 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
144 myCurrentFrameState.emitComponentUpdated();
149 myCurrentFrameState.updateStateData(sd);
150 myNextFrameState.updateStateData(sd);
156 myCurrentFrameState.aboutToBeDeleted();
157 myNextFrameState.aboutToBeDeleted();
const DtGroundVehicleLightingStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: groundVehicleLightingStateComponent.h:109
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
Definition: stateComponent.h:269
virtual void makeWritable() override
Override to make component writable.
Definition: groundVehicleLightingStateComponent.h:90
DtGroundVehicleLightingStateComponentCurrentFrame myCurrentFrameState
Definition: groundVehicleLightingStateComponent.h:161
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: groundVehicleLightingStateComponent.h:127
bool isDoubleBuffered()
Definition: groundVehicleLightingStateComponent.h:132
virtual void aboutToBeDeleted() override
Definition: groundVehicleLightingStateComponent.h:153
virtual void updateDataStorage() override
Implement to update data storage. Called from advanceFrame.
Definition: groundVehicleLightingStateComponent.h:137
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:116
bool myEmergencyLightsOn
Definition: groundVehicleLightingStateComponent.h:47
virtual DtFrameStateInterface * nextFrameState() override
Definition: groundVehicleLightingStateComponent.h:134
Definition: stateComponent.h:104
DtStateComponentCreator< DtGroundVehicleLightingStateComponentImplementation > DtGroundVehicleLightingStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: groundVehicleLightingStateComponent.h:167
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: groundVehicleLightingStateComponent.h:133
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:398
Definition: groundVehicleLightingStateComponent.h:16
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:231
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:384
#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:101
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: groundVehicleLightingStateComponent.h:135
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
virtual void updateStateData(DtStateData *sd) override
Implement to update data storage to the new state data.
Definition: groundVehicleLightingStateComponent.h:147
DtGroundVehicleLightingStateComponentData myData
Definition: groundVehicleLightingStateComponent.h:122
DtGroundVehicleLightingStateComponentData()
Definition: groundVehicleLightingStateComponent.h:18
DtGroundVehicleLightingStateComponentNextFrame myNextFrameState
Definition: groundVehicleLightingStateComponent.h:162
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:294