10 #include "legionDataStore/writeStateInstance.h"
12 #include <vlutil/vlString.h>
27 , myShipClass(DtAisShipClass_A)
69 DtString myDestination;
71 DtAisShipClass myShipClass;
82 : DtFrameStateInterface(storage)
110 virtual const int mmsi()
const override;
112 virtual void setMmsi(
const int&)
override;
115 virtual const int imo()
const override;
117 virtual void setImo(
const int&)
override;
120 virtual const int eta()
const override;
122 virtual void setEta(
const int&)
override;
125 virtual const DtString destination()
const override;
127 virtual void setDestination(
const DtString&)
override;
130 virtual const int status()
const override;
132 virtual void setStatus(
const int&)
override;
141 virtual const DtAisShipClass shipClass()
const override;
143 virtual void setShipClass(
const DtAisShipClass&)
override;
164 virtual const int mmsi()
const override;
166 virtual const int imo()
const override;
168 virtual const int eta()
const override;
170 virtual const DtString destination()
const override;
172 virtual const int status()
const override;
174 virtual const DtAisShipClass shipClass()
const override;
176 friend class DtAisDataStateImplementation;
208 if (myNextFrameState.isWritable())
210 myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
213 myCurrentFrameState.emitComponentUpdated();
220 myCurrentFrameState.updateStateData(sd);
221 myNextFrameState.updateStateData(sd);
228 myCurrentFrameState.aboutToBeDeleted();
229 myNextFrameState.aboutToBeDeleted();
DtAisDataStateComponentData myData
AIS data for the next frame.
Definition: aisDataStateComponent.h:148
virtual void makeReadOnly() override
Override to make component read-only.
Definition: aisDataStateComponent.h:138
int myImo
IMO (International Maritime Organization) number.
Definition: aisDataStateComponent.h:63
virtual const DtFrameStateInterface * currentFrameState() const override
Definition: aisDataStateComponent.h:199
bool isDoubleBuffered()
Definition: aisDataStateComponent.h:197
3) Define the current frame class. This will be used for read access.
Definition: aisDataStateComponent.h:152
Default creator implementation for a state component type. T_StateComponent is the concrete component...
Definition: stateComponent.h:326
const DtAisDataStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: aisDataStateComponent.h:105
virtual void aboutToBeDeleted() override
Notifies the current and next frame states that the component is about to be deleted.
Definition: aisDataStateComponent.h:225
virtual void updateStateData(DtStateData *sd) override
Updates the state data pointer for both the current and next frame states.
Definition: aisDataStateComponent.h:218
DtAisShipClass myShipClass
AIS ship class, classified by size/capacity.
Definition: aisDataStateComponent.h:71
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: aisDataStateComponent.h:191
virtual void updateDataStorage() override
Copies the next frame state into the current frame state if the next frame is writable.
Definition: aisDataStateComponent.h:206
DtStateComponentCreator< DtAisDataStateComponentImplementation > DtAisDataStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: aisDataStateComponent.h:241
DtAisDataStateComponentData()
Definition: aisDataStateComponent.h:21
int myStatus
Navigational status code.
Definition: aisDataStateComponent.h:67
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:513
#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
void advanceFrame(const DtAisDataStateComponentData &data)
Advances the current frame state to the provided data.
Definition: aisDataStateComponent.h:179
#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.
virtual DtFrameStateInterface * nextFrameState() override
Definition: aisDataStateComponent.h:201
DtAisDataStateComponentData & frameState()
Returns the AIS data state for the next frame (mutable).
Definition: aisDataStateComponent.h:107
Holds AIS (Automatic Identification System) navigation data for a surface vessel, including MMSI...
Definition: aisDataStateComponent.h:19
int myMmsi
MMSI (Maritime Mobile Service Identity) number.
Definition: aisDataStateComponent.h:61
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Defines a const reference accessor and an inline setter for a member variable.
Definition: doubleBufferedDataStorage.h:37
Definition: stateComponent.h:98
const DtAisDataStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety Returns the AIS...
Definition: aisDataStateComponent.h:161
DtAisDataStateComponentData & operator=(const DtAisDataStateComponentData &orig)
Definition: aisDataStateComponent.h:40
DtAisDataStateComponentNextFrame myNextFrameState
Next frame AIS state component (write access).
Definition: aisDataStateComponent.h:236
#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
DtString myDestination
Destination port name.
Definition: aisDataStateComponent.h:69
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: aisDataStateComponent.h:76
2) Define the next frame class. This will be used for write access.
Definition: aisDataStateComponent.h:96
DtAisDataStateComponentData(const DtAisDataStateComponentData &orig)
Definition: aisDataStateComponent.h:30
virtual const DtFrameStateInterface * nextFrameState() const override
Definition: aisDataStateComponent.h:203
Contains the DtStateComponent class declaration.
int myEta
AIS estimated time of arrival (ETA).
Definition: aisDataStateComponent.h:65
DtAisDataStateComponentData myData
AIS data for the current frame.
Definition: aisDataStateComponent.h:186
Base interface for accessing current or next frame state in a double-buffered state component...
Definition: stateComponent.h:354
DtAisDataStateComponentCurrentFrame myCurrentFrameState
Current frame AIS state component (read access).
Definition: aisDataStateComponent.h:234
virtual void makeWritable() override
Override to make component writable.
Definition: aisDataStateComponent.h:135