VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
airTurbulenceStateComponent.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include <vlutil/vlString.h>
11 
12 namespace makVrf
13 {
15  {
17  : myAirTurbulence(0)
18  {};
19 
21  {
22  myAirTurbulence = orig.myAirTurbulence;
23  }
24 
26  {
27  myAirTurbulence = orig.myAirTurbulence;
28 
29  return *this;
30  }
31 
32  DEFINE_ACCESSOR_MUTATOR(int, airTurbulence, AirTurbulence)
33 
34  protected:
35  int myAirTurbulence;
36  };
37 
41  {
42  public:
44 
46  : DtFrameStateInterface(storage)
47  {
48  }
49 
51  };
52 
55  {
56  public:
58 
60  const DtAirTurbulenceStateComponentData& frameState() const { return myData; };
62 
63  const int& airTurbulence() const;
64  void setAirTurbulence(const int&);
65 
67  virtual void makeWritable() {};
68 
70  virtual void makeReadOnly() {};
71 
72  protected:
73  DtStateData* myStateData;
75  };
76 
79  {
80  public:
83 
85  const DtAirTurbulenceStateComponentData& frameState() const { return myData; };
86 
87  const int& airTurbulence() const;
88 
89  protected:
90  void completeSetup();
91  void updateVrfStateComponentParameters();
92 
93  void updateAirTurbulence();
94 
95  protected:
98  {
99  myData = data;
100  }
101 
102  protected:
103  boost::signals2::scoped_connection myVrfStateComponentChangedConnection;
104  boost::signals2::scoped_connection myCompleteSetupConnection;
105 
106  protected:
109  };
110 
114  {
115  public:
117 
118  bool isDoubleBuffered() { return true; };
119  const DtFrameStateInterface* currentFrameState() const { return &myCurrentFrameState; }
120  virtual DtFrameStateInterface* nextFrameState() { return &myNextFrameState; };
121  virtual const DtFrameStateInterface* nextFrameState() const { return &myNextFrameState; };
122 
124  {
125  if (myNextFrameState.isWritable())
126  {
127  myCurrentFrameState.advanceFrame(myNextFrameState.frameState());
128  }
129 
130  myCurrentFrameState.emitComponentUpdated();
131  }
132 
134  {
135  myCurrentFrameState.updateStateData(sd);
136  myNextFrameState.updateStateData(sd);
137  }
138 
139  virtual void aboutToBeDeleted() override
140  {
142  myCurrentFrameState.aboutToBeDeleted();
143  myNextFrameState.aboutToBeDeleted();
144  }
145 
146  protected:
149  };
150 
154 }
void updateStateData(DtStateData *sd)
Implement to update data storage to the new state data.
Definition: airTurbulenceStateComponent.h:133
virtual void makeWritable()
Override to make component writable.
Definition: airTurbulenceStateComponent.h:67
DtAirTurbulenceStateComponentData & frameState()
Definition: airTurbulenceStateComponent.h:61
boost::signals2::scoped_connection myVrfStateComponentChangedConnection
Definition: airTurbulenceStateComponent.h:103
DtAirTurbulenceStateComponentData myData
Definition: airTurbulenceStateComponent.h:108
Definition: stateComponent.h:266
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: airTurbulenceStateComponent.h:40
DtStateData * myStateData
Definition: airTurbulenceStateComponent.h:107
virtual const DtFrameStateInterface * nextFrameState() const
Definition: airTurbulenceStateComponent.h:121
DtAirTurbulenceStateComponentData & operator=(const DtAirTurbulenceStateComponentData &orig)
Definition: airTurbulenceStateComponent.h:25
2) Define the next frame class. This will be used for write access.
Definition: airTurbulenceStateComponent.h:54
void advanceFrame(const DtAirTurbulenceStateComponentData &data)
Definition: airTurbulenceStateComponent.h:97
The overall structure of the DtStateData mechanism is: The DtStateData contains a list of double buff...
Definition: stateData.h:339
DtStateComponentCreator< DtAirTurbulenceStateComponentImplementation > DtAirTurbulenceStateComponentCreator
5) Define the creator. This will need to be registered with the REGISTER_STATE_COMPONENT macro in the...
Definition: airTurbulenceStateComponent.h:153
3) Define the current frame class. This will be used for read access.
Definition: airTurbulenceStateComponent.h:78
#define DEFINE_STATE_COMPONENT_TYPE(CreatedComponent)
Definition: stateComponent.h:228
boost::signals2::scoped_connection myCompleteSetupConnection
Definition: airTurbulenceStateComponent.h:104
Subclass from this to indicate that this will be a double buffered state component.
Definition: stateComponent.h:379
void updateDataStorage()
Implement to update data storage. Called from advanceFrame.
Definition: airTurbulenceStateComponent.h:123
const DtAirTurbulenceStateComponentData & frameState() const
Current frame state only can access current frame buffers. This ensures thread safety.
Definition: airTurbulenceStateComponent.h:85
const DtAirTurbulenceStateComponentData & frameState() const
Next frame access write access. Ensure this is only used in a single thread (i.e.a controller thread)...
Definition: airTurbulenceStateComponent.h:60
virtual DtFrameStateInterface * nextFrameState()
Definition: airTurbulenceStateComponent.h:120
virtual void aboutToBeDeleted()
bool isDoubleBuffered()
Definition: airTurbulenceStateComponent.h:118
#define UNDEFINED_RETURNREF_ACCESSOR_MUTATOR(Type, Member, Set)
Definition: doubleBufferedDataStorage.h:57
virtual void aboutToBeDeleted() override
Definition: airTurbulenceStateComponent.h:139
#define DEFINE_ACCESSOR_MUTATOR(ReturnType, Accessor, Mutator)
Definition: doubleBufferedDataStorage.h:23
const DtFrameStateInterface * currentFrameState() const
Definition: airTurbulenceStateComponent.h:119
DtAirTurbulenceStateComponentData(const DtAirTurbulenceStateComponentData &orig)
Definition: airTurbulenceStateComponent.h:20
#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
Definition: airTurbulenceStateComponent.h:14
int myAirTurbulence
Definition: airTurbulenceStateComponent.h:35
Contains the DtStateComponent class declaration.
DtAirTurbulenceStateComponentCurrentFrame myCurrentFrameState
Definition: airTurbulenceStateComponent.h:147
Definition: vrfObjectManipulationHandlerBaseClass.h:68
4) Define the state component that will contain the wrappers to the next and current frame states tha...
Definition: airTurbulenceStateComponent.h:113
DtAirTurbulenceStateComponentData myData
Definition: airTurbulenceStateComponent.h:74
This is a simple base class that will be used to return a pointer to current or next frame state...
Definition: stateComponent.h:291
DtAirTurbulenceStateComponentData()
Definition: airTurbulenceStateComponent.h:16
DtAirTurbulenceStateComponentNextFrame myNextFrameState
Definition: airTurbulenceStateComponent.h:148

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)