12 #include <legionStandardOM/sets/readRadioReceiverRepository.hpp>
13 #include <legionStandardOM/sets/writeRadioReceiverRepository.hpp>
23 : myHostId(
DtUUID::nullUUID())
24 , myTransmitterId(
DtUUID::nullUUID())
34 : myHostId(orig.myHostId)
35 , myTransmitterId(orig.myTransmitterId)
36 , myReceiverState(orig.myReceiverState)
37 , myReceivedPower(orig.myReceivedPower)
38 , myRadioId(orig.myRadioId)
71 DtUUID myTransmitterId;
73 unsigned int myReceiverState;
75 float myReceivedPower;
91 : DtFrameStateInterface(storage)
119 virtual const DtUUID hostId()
const override;
122 virtual const DtUUID& transmitterId()
const override;
124 virtual void setTransmitterId(
const DtUUID&)
override;
127 virtual const unsigned int receiverState()
const override;
129 virtual void setReceiverState(
const unsigned int&)
override;
132 virtual const UInt64 radioId()
const override;
134 virtual void setRadioId(
const UInt64&)
override;
137 virtual const float receivedPower()
const override;
139 virtual void setReceivedPower(
const float&)
override;
142 virtual void makeWritable()
override;
145 virtual void makeReadOnly()
override;
148 virtual Legion::WriteStateInstance writeStateInstance()
override;
151 virtual void updateStateData(
DtStateData*)
override;
154 void cleanupWriteState();
157 void setPublishingOnLegionNetwork(
bool b);
183 virtual const DtUUID hostId()
const override;
185 virtual const DtUUID& transmitterId()
const override;
187 virtual const unsigned int receiverState()
const override;
189 virtual const UInt64 radioId()
const override;
191 virtual const float receivedPower()
const override;
194 bool readComponentValid()
const;
197 bool findReadComponent();
201 virtual void updateStateData(
DtStateData*)
override;
212 virtual void handleDataUpdated();
244 if (myNextFrameState.isWritable())
246 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
248 myCurrentFrameState.emitComponentUpdated();
252 virtual bool forceAdvance()
override;
255 virtual void firstFrameAdvance()
override;
261 myCurrentFrameState.updateStateData(sd);
262 myNextFrameState.updateStateData(sd);
269 myCurrentFrameState.aboutToBeDeleted();
270 myNextFrameState.aboutToBeDeleted();
274 virtual void completeSetup()
override;
276 virtual void removeAdditionalStateComponents()
override;
279 virtual void setPublishingOnLegionNetwork(
bool b)
override;
UUID is a unique ID wrapper class.
Definition: uuid.h:59
DtStateComponentCreator< DtRadioReceiverStateComponentImplementation > DtRadioReceiverStateComponentCreator
Factory creator type for DtRadioReceiverStateComponentImplementation. Must be registered with the REG...
Definition: radioReceiverStateComponent.h:292
virtual void aboutToBeDeleted() override
Notifies both inner frame components that this component is about to be deleted.
Definition: radioReceiverStateComponent.h:266
DtRadioReceiverStateComponentNextFrame myNextFrameState
The write-access (next frame) state wrapper.
Definition: radioReceiverStateComponent.h:285
const DtRadioReceiverStateComponentData & frameState() const
Returns the current frame state data.
Definition: radioReceiverStateComponent.h:180
float myReceivedPower
Received signal power in dBm.
Definition: radioReceiverStateComponent.h:75
UInt64 myRadioId
Unique radio identifier.
Definition: radioReceiverStateComponent.h:77
bool myFoundComponent
True once the Legion read component has been successfully located.
Definition: radioReceiverStateComponent.h:287
bool isDoubleBuffered()
Definition: radioReceiverStateComponent.h:233
DtRadioReceiverStateComponentData(const DtRadioReceiverStateComponentData &orig)
Copy constructor.
Definition: radioReceiverStateComponent.h:33
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
DtUUID myTransmitterId
UUID of the transmitter being received.
Definition: radioReceiverStateComponent.h:71
Write-access (next-frame) implementation of the radio receiver state component. Manages publishing re...
Definition: radioReceiverStateComponent.h:104
Read-access (current-frame) implementation of the radio receiver state component. Subscribes to Legio...
Definition: radioReceiverStateComponent.h:170
virtual void updateStateData(DtStateData *sd) override
Propagates the new state data pointer to both inner frame components.
Definition: radioReceiverStateComponent.h:259
#define UNDEFINED_RETURNVALUE_ACCESSOR(ReturnType, Member)
Defines a virtual const accessor that throws DtUnimplementedMethod, marking the method as requiring a...
Definition: doubleBufferedDataStorage.h:53
Contains the DtUUID class declaration.
DtRadioReceiverStateComponentData myData
The next-frame state data snapshot.
Definition: radioReceiverStateComponent.h:161
unsigned long long UInt64
64-bit unsigned integer type.
Definition: stateDataTypes.h:19
DtRadioReceiverStateComponentData()
Default constructor. Initializes all fields to zero/null.
Definition: radioReceiverStateComponent.h:22
const DtRadioReceiverStateComponentData & frameState() const
Returns the current frame state data (read-only).
Definition: radioReceiverStateComponent.h:114
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
virtual DtFrameStateInterface * nextFrameState() override
Definition: radioReceiverStateComponent.h:237
LOM::WriteRadioReceiverRepository myWriteRadioReceiverRepository
Legion write repository for publishing receiver state to the network.
Definition: radioReceiverStateComponent.h:163
#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
LOM::ReadRadioReceiverRepository myReadRadioReceiverRepository
Legion read repository used to subscribe to receiver state updates.
Definition: radioReceiverStateComponent.h:218
void advanceFrame(const DtRadioReceiverStateComponentData &data)
Advances the frame by copying the next-frame data into the current frame.
Definition: radioReceiverStateComponent.h:207
Double-buffered state component implementation for radio receiver state. Owns and manages both the ne...
Definition: radioReceiverStateComponent.h:225
#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.
Holds the state data for a DIS/HLA radio receiver, including host entity, transmitter reference...
Definition: radioReceiverStateComponent.h:19
DtRadioReceiverStateComponentData & operator=(const DtRadioReceiverStateComponentData &orig)
Copy assignment operator.
Definition: radioReceiverStateComponent.h:45
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Defines an undefined virtual const-reference accessor and an undefined virtual setter, both throwing DtUnimplementedMethod and requiring overrides in a derived class.
Definition: doubleBufferedDataStorage.h:112
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: radioReceiverStateComponent.h:239
Abstract interface for the radio receiver state component, representing common accessors for both the...
Definition: radioReceiverStateComponent.h:83
#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 const DtFrameStateInterface * currentFrameState() const override
Definition: radioReceiverStateComponent.h:235
DtUUID myHostId
Accessor and mutator for the host entity UUID.
Definition: radioReceiverStateComponent.h:69
virtual void updateDataStorage() override
Advances the current frame by copying next-frame data, then emits the updated signal.
Definition: radioReceiverStateComponent.h:242
#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
bool myPublishingOnLegionNetwork
True if this component is currently publishing on the Legion network.
Definition: radioReceiverStateComponent.h:165
DtRadioReceiverStateComponentData & frameState()
Returns the current frame state data (read-write).
Definition: radioReceiverStateComponent.h:116
Contains the DtStateComponent class declaration.
DtRadioReceiverStateComponentData myData
The current-frame state data snapshot.
Definition: radioReceiverStateComponent.h:216
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
unsigned int myReceiverState
DIS/HLA receiver operational state value.
Definition: radioReceiverStateComponent.h:73
Definition: stateComponent.h:94
DtRadioReceiverStateComponentCurrentFrame myCurrentFrameState
The read-access (current frame) state wrapper.
Definition: radioReceiverStateComponent.h:283
int myCallbackHandle
Handle for the registered Legion instance-update callback.
Definition: radioReceiverStateComponent.h:220