12 #include <legionStandardOM/sets/readRadioReceiverRepository.hpp>
13 #include <legionStandardOM/sets/writeRadioReceiverRepository.hpp>
20 : myHostId(
DtUUID::nullUUID())
21 , myTransmitterId(
DtUUID::nullUUID())
29 : myHostId(orig.myHostId)
30 , myTransmitterId(orig.myTransmitterId)
31 , myReceiverState(orig.myReceiverState)
32 , myReceivedPower(orig.myReceivedPower)
33 , myRadioId(orig.myRadioId)
56 DtUUID myTransmitterId;
57 unsigned int myReceiverState;
58 float myReceivedPower;
70 : DtFrameStateInterface(storage)
91 const DtUUID hostId()
const;
93 const DtUUID& transmitterId()
const;
94 void setTransmitterId(
const DtUUID&);
96 const unsigned int receiverState()
const;
97 void setReceiverState(
const unsigned int&);
99 const UInt64 radioId()
const;
100 void setRadioId(
const UInt64&);
102 const float receivedPower()
const;
103 void setReceivedPower(
const float&);
106 virtual void makeWritable();
109 virtual void makeReadOnly();
111 Legion::WriteStateInstance writeStateInstance()
override;
112 virtual void updateStateData(
DtStateData*)
override;
114 void cleanupWriteState();
115 void setPublishingOnLegionNetwork(
bool b);
133 const DtUUID hostId()
const;
134 const DtUUID& transmitterId()
const;
135 const unsigned int receiverState()
const;
136 const UInt64 radioId()
const;
137 const float receivedPower()
const;
139 bool readComponentValid()
const;
140 bool findReadComponent();
142 virtual void updateStateData(
DtStateData*)
override;
150 virtual void handleDataUpdated();
173 if (myNextFrameState.isWritable())
175 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
177 myCurrentFrameState.emitComponentUpdated();
181 virtual bool forceAdvance();
184 virtual void firstFrameAdvance()
override;
188 myCurrentFrameState.updateStateData(sd);
189 myNextFrameState.updateStateData(sd);
195 myCurrentFrameState.aboutToBeDeleted();
196 myNextFrameState.aboutToBeDeleted();
199 virtual void completeSetup()
override;
200 virtual void removeAdditionalStateComponents()
override;
201 virtual void setPublishingOnLegionNetwork(
bool b)
override;
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
DtStateComponentCreator< DtRadioReceiverStateComponentImplementation > DtRadioReceiverStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: radioReceiverStateComponent.h:211
virtual void aboutToBeDeleted() override
Definition: radioReceiverStateComponent.h:192
DtRadioReceiverStateComponentNextFrame myNextFrameState
Definition: radioReceiverStateComponent.h:205
const DtRadioReceiverStateComponentData & frameState() const
Definition: radioReceiverStateComponent.h:131
float myReceivedPower
Definition: radioReceiverStateComponent.h:58
UInt64 myRadioId
Definition: radioReceiverStateComponent.h:59
bool myFoundComponent
Definition: radioReceiverStateComponent.h:206
bool isDoubleBuffered()
Definition: radioReceiverStateComponent.h:166
DtRadioReceiverStateComponentData(const DtRadioReceiverStateComponentData &orig)
Definition: radioReceiverStateComponent.h:28
Definition: stateComponent.h:257
DtUUID myTransmitterId
Definition: radioReceiverStateComponent.h:56
const DtFrameStateInterface * currentFrameState() const
Definition: radioReceiverStateComponent.h:167
2) Define the next frame class. This will be used for write access.
Definition: radioReceiverStateComponent.h:82
3) Define the current frame class. This will be used for read access.
Definition: radioReceiverStateComponent.h:125
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Definition: doubleBufferedDataStorage.h:31
Contains the DtUUID class declaration.
DtRadioReceiverStateComponentData myData
Definition: radioReceiverStateComponent.h:118
DtRadioReceiverStateComponentData()
Definition: radioReceiverStateComponent.h:19
const DtRadioReceiverStateComponentData & frameState() const
Definition: radioReceiverStateComponent.h:88
virtual DtFrameStateInterface * nextFrameState()
Definition: radioReceiverStateComponent.h:168
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:336
LOM::WriteRadioReceiverRepository myWriteRadioReceiverRepository
Definition: radioReceiverStateComponent.h:119
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:219
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:365
LOM::ReadRadioReceiverRepository myReadRadioReceiverRepository
Definition: radioReceiverStateComponent.h:154
void advanceFrame(const DtRadioReceiverStateComponentData &data)
Definition: radioReceiverStateComponent.h:146
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: radioReceiverStateComponent.h:161
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: radioReceiverStateComponent.h:186
#define UNDEFINED_RETURNVALUE_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:53
virtual void aboutToBeDeleted()
DtStateData * myStateData
Definition: radioReceiverStateComponent.h:120
Definition: radioReceiverStateComponent.h:17
DtStateData * myStateData
Definition: radioReceiverStateComponent.h:156
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: radioReceiverStateComponent.h:171
DtRadioReceiverStateComponentData & operator=(const DtRadioReceiverStateComponentData &orig)
Definition: radioReceiverStateComponent.h:37
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
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: radioReceiverStateComponent.h:64
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
DtUUID myHostId
Definition: radioReceiverStateComponent.h:55
#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
bool myPublishingOnLegionNetwork
Definition: radioReceiverStateComponent.h:121
virtual const DtFrameStateInterface * nextFrameState() const
Definition: radioReceiverStateComponent.h:169
DtRadioReceiverStateComponentData & frameState()
Definition: radioReceiverStateComponent.h:89
Contains the DtStateComponent class declaration.
DtRadioReceiverStateComponentData myData
Definition: radioReceiverStateComponent.h:153
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:282
unsigned int myReceiverState
Definition: radioReceiverStateComponent.h:57
Definition: stateComponent.h:89
DtRadioReceiverStateComponentCurrentFrame myCurrentFrameState
Definition: radioReceiverStateComponent.h:204
int myCallbackHandle
Definition: radioReceiverStateComponent.h:155