11 #include "legionDataStore/writeStateInstance.h"
12 #include <boost/signals2.hpp>
14 #include <vlutil/vlString.h>
65 virtual const std::map<DtUUID, DtRunwayStateData>&
runways()
const {
throw DtUnimplementedMethod(
"The std::map<DtUUID, DtRunwayStateData> runways() const method is unimplemented"); };
68 virtual void setRunways(
const std::map<DtUUID, DtRunwayStateData>&) {
throw DtUnimplementedMethod(
"The void setRunways(const std::map<DtUUID, DtRunwayStateData>&) method is unimplemented"); };
118 virtual const bool& isLocal()
const override;
121 virtual void setIsLocal(
const bool&)
override;
124 virtual const bool& checkForNameReservation()
const override;
127 virtual void setCheckForNameReservation(
const bool&)
override;
130 virtual const bool& active()
const override;
133 virtual void setActive(
const bool&)
override;
136 virtual const DtString& globalId()
const override;
139 virtual void setGlobalId(
const DtString&)
override;
142 virtual const DtUUID& uuid()
const override;
145 virtual void setUUID(
const DtUUID&)
override;
148 virtual const DtString& airportCode()
const override;
151 virtual void setAirportCode(
const DtString&)
override;
155 virtual unsigned char value(
const DtString&)
const override;
159 virtual void setValue(
const DtString&,
unsigned char)
override;
162 virtual void restoreFromArchive(
const DtString&)
override;
167 virtual unsigned char runwayValue(
const DtString&,
const DtString& runwayName)
const override;
172 virtual void setRunwayValue(
const DtString&,
unsigned char,
const DtString& runwayName)
override;
175 virtual std::vector<DtString> runwaysArchived()
const override;
180 return airportCode();
191 virtual const unsigned long long orbatId()
const override {
return 0; };
192 virtual void setOrbatId(
const unsigned long long&)
override {};
196 virtual void setUserLongLongData(
const unsigned long long&)
override;
198 virtual const UInt64 userLongLongData()
const override;
201 virtual const DtString& sidc()
const override;
202 virtual void setSidc(
const DtString&)
override;
205 virtual const DtForceType forceType()
const override;
208 virtual void setForceType(
const DtForceType&)
override;
211 virtual const UInt32 appearanceBits()
const override;
214 virtual void setAppearanceBits(
const UInt32&)
override;
217 virtual const DtEntityType
entityType()
const override {
return DtEntityType(objectType()); };
219 virtual const DtEntityType objectType()
const override;
222 virtual void setEntityType(
const DtEntityType& t)
override;
225 virtual const DtEntityIdentifier& entityId()
const override;
228 virtual void setEntityId(
const DtEntityIdentifier&)
override;
231 virtual const DtSimulationAddress simEngineAddress()
const override;
237 virtual void removeRunway(
const DtUUID&)
override;
255 virtual const std::map<DtUUID, DtRunwayStateData>& runways()
const override;
258 virtual void setRunways(
const std::map<DtUUID, DtRunwayStateData>&)
override;
262 virtual void restoreRunwaysFromArchive(
const std::vector<DtString>&)
override;
283 virtual const bool& isLocal()
const override;
285 virtual const bool& checkForNameReservation()
const override;
287 virtual const bool& active()
const override;
289 virtual const DtString& globalId()
const override;
291 virtual const DtUUID& uuid()
const override;
293 virtual const DtString& airportCode()
const override;
298 virtual const UInt64 userLongLongData()
const override;
301 virtual const UInt32 appearanceBits()
const override;
303 virtual const DtEntityType
entityType()
const override {
return DtEntityType(objectType()); };
305 virtual const DtEntityType objectType()
const override;
307 virtual const DtEntityIdentifier& entityId()
const override;
309 virtual const DtSimulationAddress simEngineAddress()
const override;
311 virtual std::vector<DtString> runwaysArchived()
const override;
314 virtual unsigned char value(
const DtString&)
const override;
318 virtual unsigned char runwayValue(
const DtString&,
const DtString& runwayName)
const override;
320 virtual const unsigned long long orbatId()
const override {
return 0; };
323 virtual const DtString& sidc()
const override;
326 virtual const DtForceType forceType()
const override;
337 virtual const std::map<DtUUID, DtRunwayStateData>& runways()
const override;
376 if (myNextFrameState.isWritable())
378 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
381 myCurrentFrameState.emitComponentUpdated();
388 myCurrentFrameState.updateStateData(sd);
389 myNextFrameState.updateStateData(sd);
396 myCurrentFrameState.aboutToBeDeleted();
397 myNextFrameState.aboutToBeDeleted();
401 virtual void addAdditionalStateComponents()
override;
406 virtual void convertToRemote()
override;
409 virtual void convertToLocal()
override;
DtAerodromeStateData myData
Mutable aerodrome state data buffer for the next frame.
Definition: aerodromeStateComponent.h:266
UUID is a unique ID wrapper class.
Definition: uuid.h:59
bool isDoubleBuffered()
Returns true, indicating this component uses double-buffered state storage.
Definition: aerodromeStateComponent.h:365
virtual const unsigned long long orbatId() const override
Aerodromes cannot be in orbat.
Definition: aerodromeStateComponent.h:191
DtStateComponentCreator< DtAerodromeStateComponentImplementation > DtAerodromeStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: aerodromeStateComponent.h:422
Definition: stateComponent.h:67
Exception thrown when a required method has not been implemented.
Definition: stateDataTypes.h:30
virtual const DtRunwayLightStateData & runwayState(const std::string &) const
Returns the runway light state data for the runway end identified by the given name.
Definition: aerodromeStateComponent.h:62
virtual const unsigned long long orbatId() const override
Aerodromes cannot be in orbat.
Definition: aerodromeStateComponent.h:320
3) Define the current frame class. This will be used for read access. Read-only implementation of DtA...
Definition: aerodromeStateComponent.h:271
virtual DtRunwayStateData & runway(const std::string &)
Returns a mutable reference to the runway identified by the given name.
Definition: aerodromeStateComponent.h:50
unsigned int UInt32
32-bit unsigned integer type.
Definition: stateDataTypes.h:21
Definition: aerodromeStateData.h:498
virtual const DtString & markingText() const override
Returns the airport code as the marking text for this aerodrome.
Definition: aerodromeStateComponent.h:178
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
The DtSimulatedObjectStateComponent is an interface that all main components (those that are consider...
Definition: simulatedObjectStateComponent.h:21
virtual const DtAerodromeStateData & frameState() const override
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: aerodromeStateComponent.h:280
unsigned long long UInt64
64-bit unsigned integer type.
Definition: stateDataTypes.h:19
#define UNDEFINED_RETURNREF_ACCESSOR(ReturnType, Member)
Defines a virtual const reference accessor that throws DtUnimplementedMethod, marking the method as r...
Definition: doubleBufferedDataStorage.h:60
DtAerodromeStateData & frameState()
Returns a mutable reference to the aerodrome state data for the next frame.
Definition: aerodromeStateComponent.h:115
2) Define the next frame class. This will be used for write access. Write-access implementation of Dt...
Definition: aerodromeStateComponent.h:103
virtual void restoreFromArchive(const DtString &)
Restores this aerodrome's state from the given archived state string.
Definition: aerodromeStateComponent.h:95
virtual DtFrameStateInterface * nextFrameState() override
Returns the writable next-frame state interface.
Definition: aerodromeStateComponent.h:369
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
virtual void restoreRunwaysFromArchive(const std::vector< DtString > &)
Restores all runways from the provided list of archived state strings.
Definition: aerodromeStateComponent.h:74
#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
virtual const DtEntityType entityType() const override
Returns the entity type (wraps objectType()).
Definition: aerodromeStateComponent.h:303
virtual const std::map< DtUUID, DtRunwayStateData > & runways() const
Returns a const map of all runways keyed by UUID.
Definition: aerodromeStateComponent.h:65
virtual const DtRunwayStateData & runway(const std::string &) const
Returns a const reference to the runway identified by the given name.
Definition: aerodromeStateComponent.h:58
virtual const DtAerodromeStateData & frameState() const override
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: aerodromeStateComponent.h:112
virtual std::vector< DtString > runwaysArchived() const
Returns a list of archived runway state strings.
Definition: aerodromeStateComponent.h:71
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:489
virtual const DtEntityType entityType() const override
Returns the entity type (wraps objectType()).
Definition: aerodromeStateComponent.h:217
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) Abstract interface for aerodrome (airport) state, providing access to runway and airport code data.
Definition: aerodromeStateComponent.h:21
Definition: aerodromeStateData.h:17
virtual void aboutToBeDeleted()
Called when the component is about to be deleted; emits signal_stateComponentAboutToBeDeleted.
Legion::WriteStateInstance myWriteStateInstance
Legion write state instance for distributed state publication.
Definition: aerodromeStateComponent.h:417
virtual void setMarkingText(const DtString &t) override
Sets the airport code via the marking text interface.
Definition: aerodromeStateComponent.h:185
virtual void setValue(const DtString &, unsigned char)
Sets the named appearance value for this aerodrome.
Definition: aerodromeStateComponent.h:92
virtual void updateDataStorage() override
Advances the current frame by copying the next-frame data if writable, then emits the component-updat...
Definition: aerodromeStateComponent.h:374
virtual DtRunwayStateData & runway(const DtUUID &)
Returns a mutable reference to the runway identified by the given UUID.
Definition: aerodromeStateComponent.h:46
DtAerodromeStateData myData
Aerodrome state data buffer for the current (committed) frame.
Definition: aerodromeStateComponent.h:350
virtual unsigned char runwayValue(const DtString &, const DtString &runwayName) const
Returns the named appearance value for the specified runway.
Definition: aerodromeStateComponent.h:79
#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 DtRunwayStateData & runway(const DtUUID &) const
Returns a const reference to the runway identified by the given UUID.
Definition: aerodromeStateComponent.h:54
virtual const DtString & markingText() const override
Returns the airport code as the marking text for this aerodrome.
Definition: aerodromeStateComponent.h:295
DtAerodromeStateComponentCurrentFrame myCurrentFrameState
Read-only current-frame state buffer.
Definition: aerodromeStateComponent.h:413
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: aerodromeStateComponent.h:356
DtAerodromeStateComponentNextFrame myNextFrameState
Writable next-frame state buffer.
Definition: aerodromeStateComponent.h:415
virtual unsigned char value(const DtString &) const
Returns the named appearance value for this aerodrome.
Definition: aerodromeStateComponent.h:88
virtual Legion::WriteStateInstance writeStateInstance() override
Returns the Legion write state instance used for distributed state publication.
Definition: aerodromeStateComponent.h:403
virtual void updateStateData(DtStateData *sd) override
Updates the state data pointer on both frame buffers.
Definition: aerodromeStateComponent.h:386
virtual const DtFrameStateInterface * currentFrameState() const override
Returns the read-only current-frame state interface.
Definition: aerodromeStateComponent.h:367
#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
virtual void aboutToBeDeleted() override
Notifies both frame buffers that this component is about to be deleted.
Definition: aerodromeStateComponent.h:393
virtual void setRunwayValue(const DtString &, unsigned char, const DtString &runwayName)
Sets the named appearance value for the specified runway.
Definition: aerodromeStateComponent.h:84
virtual void setRunways(const std::map< DtUUID, DtRunwayStateData > &)
Replaces all runways with the provided map.
Definition: aerodromeStateComponent.h:68
virtual void setOrbatId(const unsigned long long &) override
Definition: aerodromeStateComponent.h:192
virtual const DtFrameStateInterface * nextFrameState() const override
Returns the next-frame state interface as a const pointer.
Definition: aerodromeStateComponent.h:371
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
virtual void removeRunway(const DtUUID &)
Removes the runway identified by the given UUID.
Definition: aerodromeStateComponent.h:42
void advanceFrame(const DtAerodromeStateData &data)
Copies the next-frame data into the current frame buffer; called by the implementation during frame a...
Definition: aerodromeStateComponent.h:343
Definition: aerodromeStateData.h:355