10 #include "legionDataStore/writeStateInstance.h"
12 #include <vlutil/vlString.h>
20 : myLeftIndicatorLightsOn(false)
21 , myRightIndicatorLightsOn(false)
22 , myEmergencyLightsOn(false)
47 bool myLeftIndicatorLightsOn;
49 bool myRightIndicatorLightsOn;
51 bool myEmergencyLightsOn;
62 : DtFrameStateInterface(storage)
87 virtual const bool leftIndicatorLightsOn()
const override;
89 virtual void setLeftIndicatorLightsOn(
const bool&)
override;
92 virtual const bool rightIndicatorLightsOn()
const override;
94 virtual void setRightIndicatorLightsOn(
const bool&)
override;
97 virtual const bool emergencyLightsOn()
const override;
99 virtual void setEmergencyLightsOn(
const bool&)
override;
105 virtual void makeReadOnly()
override {};
126 virtual const bool leftIndicatorLightsOn()
const override;
128 virtual const bool rightIndicatorLightsOn()
const override;
130 virtual const bool emergencyLightsOn()
const override;
132 friend class DtGroundVehicleLightingStateImplementation;
164 if (myNextFrameState.isWritable())
166 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
169 myCurrentFrameState.emitComponentUpdated();
176 myCurrentFrameState.updateStateData(sd);
177 myNextFrameState.updateStateData(sd);
184 myCurrentFrameState.aboutToBeDeleted();
185 myNextFrameState.aboutToBeDeleted();
const DtGroundVehicleLightingStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: groundVehicleLightingStateComponent.h:123
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:56
bool myLeftIndicatorLightsOn
True if the left turn-signal indicator lights are on.
Definition: groundVehicleLightingStateComponent.h:47
DtGroundVehicleLightingStateComponentData & operator=(const DtGroundVehicleLightingStateComponentData &orig)
Definition: groundVehicleLightingStateComponent.h:32
bool myRightIndicatorLightsOn
True if the right turn-signal indicator lights are on.
Definition: groundVehicleLightingStateComponent.h:49
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
virtual void makeWritable() override
Override to make component writable.
Definition: groundVehicleLightingStateComponent.h:102
DtGroundVehicleLightingStateComponentCurrentFrame myCurrentFrameState
Current frame ground vehicle lighting state component (read access).
Definition: groundVehicleLightingStateComponent.h:190
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: groundVehicleLightingStateComponent.h:147
bool isDoubleBuffered()
Definition: groundVehicleLightingStateComponent.h:153
virtual void aboutToBeDeleted() override
Notifies the current and next frame states that the component is about to be deleted.
Definition: groundVehicleLightingStateComponent.h:181
virtual void updateDataStorage() override
Copies the next frame state into the current frame state if the next frame is writable.
Definition: groundVehicleLightingStateComponent.h:162
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:82
void advanceFrame(const DtGroundVehicleLightingStateComponentData &data)
Advances the current frame state to the provided data.
Definition: groundVehicleLightingStateComponent.h:135
bool myEmergencyLightsOn
True if the emergency/hazard lights are on.
Definition: groundVehicleLightingStateComponent.h:51
virtual DtFrameStateInterface * nextFrameState() override
Definition: groundVehicleLightingStateComponent.h:157
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:197
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: groundVehicleLightingStateComponent.h:155
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
Holds ground vehicle lighting state, including left/right indicator lights and emergency hazard light...
Definition: groundVehicleLightingStateComponent.h:17
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Macro to define all required static and virtual state component type methods. Place in the public sec...
Definition: stateComponent.h:272
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Defines an undefined virtual by-value accessor and an undefined virtual setter, both throwing DtUnimp...
Definition: doubleBufferedDataStorage.h:103
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
3) Define the current frame class. This will be used for read access.
Definition: groundVehicleLightingStateComponent.h:114
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: groundVehicleLightingStateComponent.h:159
2) Define the next frame class. This will be used for write access.
Definition: groundVehicleLightingStateComponent.h:73
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Defines a const reference accessor and an inline setter for a member variable.
Definition: doubleBufferedDataStorage.h:37
virtual void updateStateData(DtStateData *sd) override
Updates the state data pointer for both the current and next frame states.
Definition: groundVehicleLightingStateComponent.h:174
DtGroundVehicleLightingStateComponentData myData
Ground vehicle lighting data for the current frame.
Definition: groundVehicleLightingStateComponent.h:142
DtGroundVehicleLightingStateComponentData()
Definition: groundVehicleLightingStateComponent.h:19
DtGroundVehicleLightingStateComponentNextFrame myNextFrameState
Next frame ground vehicle lighting state component (write access).
Definition: groundVehicleLightingStateComponent.h:192
DtGroundVehicleLightingStateComponentData(const DtGroundVehicleLightingStateComponentData &orig)
Definition: groundVehicleLightingStateComponent.h:25
#define DT_DLL_vrfStateData
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfStateDataDefines.h:29
Contains the DtStateComponent class declaration.
DtGroundVehicleLightingStateComponentData & frameState()
Definition: groundVehicleLightingStateComponent.h:84
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354