VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extAggregateStateRepository.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 
17 #if DtHLA
19 #else
21 #endif
22 #include <vector>
23 
27  public makVrfVrlinkExtToolkit::DtStateRepositoryWithExtendedAttributes<DtExtAggregateBaseStateRepository>
28 {
29 
30 public:
31 
32  typedef void (*PropertyDecoder) (const char* buffer, unsigned size, int version, void* usr);
33  typedef void (*PropertyEncoder) (std::vector<char>& buffer, void* usr);
34 
37 
40 
43 
50  virtual void initialize(DtRwProperties* stateProps, DtRwProperties* paramProps);
51 
55  virtual void initialize(const DtRwProperties& stateProps, const DtRwProperties& paramProps);
56 
60  virtual void initialize();
62 
64  virtual bool isInitialized() const;
65 
68  const DtExtAggregateStateRepository& orig);
69 
71  virtual DtStateRepository* clone(bool copy = false) const;
72 
75  virtual int compare(const DtExtAggregateStateRepository* rhs);
76 
77  virtual const DtRwProperties& stateProperties() const
78  {
79  if (myStateProperties)
80  {
81  return *myStateProperties;
82  }
83 
85  }
86 
87  virtual const DtRwProperties& parameterProperties() const
88  {
89  if (myParameterProperties)
90  {
91  return *myParameterProperties;
92  }
93 
95  }
96 
99  virtual bool sensorsKilled() const;
100  virtual void setSensorsKilled(bool killed);
102 
103 #if DtDIS
104  void mapPropertiesToRecordTypes(const DtRwProperties* properties,
106  std::map<unsigned, DtString>& recTypesToAttrNames);
107 #endif
108 
110 
112  virtual void updateExtensions();
113 
119  virtual bool updatePropertiesFromAttributes(bool updatesOnly = true);
120 
123  virtual void updateAttributesFromProperties();
124 
130  virtual void addPropertyDecoder(const DtString& propName, PropertyDecoder decoder, void* usr,
131  unsigned disRecordType = 0);
132 
138  virtual void addPropertyEncoder(const DtString& propName, PropertyEncoder encoder, void* usr,
139  unsigned disRecordType = 0);
140 
147  virtual void addVrfObjectDataDecoder( const DtString& propName, PropertyDecoder decoder, void* usr,
148  unsigned disRecordType = 0);
149 
154  virtual void addVrfObjectDataEncoder( const DtString& propName, PropertyEncoder encoder, void* usr,
155  unsigned disRecordType = 0);
156 
158  virtual void removePropertyEncodersAndDecoders();
159 
164  virtual bool createVrfObjectDataMessage();
165 
168  virtual void giveOwernshipOfProperties();
169 
171  virtual DtTime lastPropertyEncodeTime() const { return myLastEncodeTime; }
172 
174  virtual DtTime lastPropertyDecodeTime() const { return myLastDecodeTime; }
175 
178 
179  virtual void addPropertyUpdatedCallback(
181  virtual void removePropertyUpdatedCallback(
184 
185 protected:
186 
188  virtual void initializeVrfObjectDataProperties();
189 
191  virtual void encodePropertyIfNeeded(const DtSymbolString& propName, DtReaderWriter* propRw);
192 
194  virtual char* encodingBuffer(int size);
195 
196 protected:
197 
201 
203 
205  {
206  PropertyDecoderInfo() : decoder(0), usr(0) {};
207  PropertyDecoderInfo(const DtString& pn, PropertyDecoder d, void* u)
208  : propertyName(pn), decoder(d), usr(u) {};
209 
210  DtString propertyName;
211  PropertyDecoder decoder;
212  void* usr;
213  };
214 
216  {
217  PropertyEncoderInfo() : encoder(0), usr(0) {};
218  PropertyEncoderInfo(const DtString& pn, PropertyEncoder e, void* u)
219  : propertyName(pn), encoder(e), usr(u) {};
220 
221  DtString propertyName;
222  PropertyEncoder encoder;
223  void* usr;
224  };
225 
226  std::list<PropertyDecoderInfo> myVrfObjectDataDecoders;
227  std::list<PropertyDecoderInfo> myAdditionalDecoders;
228  std::list<PropertyEncoderInfo> myAdditionalEncoders;
229 
230  std::vector<char> myPropertyBuffer;
234 
236 
239 
240  mutable int myPropertyVersion;
241 
243 
245 };
246 
PropertyDecoderInfo()
Definition: extAggregateStateRepository.h:206
Contains the DtExtAggregateBaseStateRepository class. This is the base extension class for the Aggreg...
PropertyDecoder decoder
Definition: extAggregateStateRepository.h:211
This class allows one to collect and compare strings using an index number instead of having to do st...
Definition: symbolString.h:27
DtNoArgumentCallbackList myPropertyUpdatedCallbacks
Definition: extAggregateStateRepository.h:244
DtTime myLastEncodeTime
Definition: extAggregateStateRepository.h:232
std::list< PropertyDecoderInfo > myVrfObjectDataDecoders
Definition: extAggregateStateRepository.h:226
std::list< PropertyEncoderInfo > myAdditionalEncoders
Definition: extAggregateStateRepository.h:228
DtRwProperties * myStateProperties
Definition: extAggregateStateRepository.h:198
void(* DtCallbackFunctionType)(void *)
The function signature of the callback function.
Definition: noArgumentCallbackList.h:155
int myPropertyVersion
Definition: extAggregateStateRepository.h:240
void * usr
Definition: extAggregateStateRepository.h:212
Definition: extAggregateStateRepository.h:204
voidpf void uLong size
Definition: ioapi.h:39
static const DtRwProperties & emptyProperties()
PropertyEncoderInfo()
Definition: extAggregateStateRepository.h:217
Definition: readerWriter.h:85
DtTime myLastDecodeTime
Definition: extAggregateStateRepository.h:233
Contains the DtSensorFieldOfViewPublisher class declaration.
std::vector< char > myPropertyBuffer
Definition: extAggregateStateRepository.h:230
virtual const DtRwProperties & stateProperties() const
Definition: extAggregateStateRepository.h:77
bool myReceivedVrfObjectDataVersion
Definition: extAggregateStateRepository.h:237
DtRwProperties * myParameterProperties
Definition: extAggregateStateRepository.h:199
bool myIsInitialized
Definition: extAggregateStateRepository.h:202
bool myReceivedVrfPropertyVersion
Definition: extAggregateStateRepository.h:238
DtRangeItems myRangeItemsCache
Definition: extAggregateStateRepository.h:242
bool mySensorsKilled
Definition: extAggregateStateRepository.h:235
DtClock myClock
Definition: extAggregateStateRepository.h:231
virtual const DtRwProperties & parameterProperties() const
Definition: extAggregateStateRepository.h:87
PropertyEncoderInfo(const DtString &pn, PropertyEncoder e, void *u)
Definition: extAggregateStateRepository.h:218
This class works just as DtCalllbackTable, but manages callbacks that have no arguments, and therefore don&#39;t fit in the template defined by DtCallbackList.
Definition: noArgumentCallbackList.h:151
PropertyEncoder encoder
Definition: extAggregateStateRepository.h:222
Definition: rangeItem.h:206
void * usr
Definition: extAggregateStateRepository.h:223
bool myOwnsProperties
Definition: extAggregateStateRepository.h:200
Definition: extAggregateStateRepository.h:215
PropertyDecoderInfo(const DtString &pn, PropertyDecoder d, void *u)
Definition: extAggregateStateRepository.h:207
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:122
std::list< PropertyDecoderInfo > myAdditionalDecoders
Definition: extAggregateStateRepository.h:227
virtual DtTime lastPropertyEncodeTime() const
Last time properties were encoded.
Definition: extAggregateStateRepository.h:171
virtual DtTime lastPropertyDecodeTime() const
Last time properties were decoded.
Definition: extAggregateStateRepository.h:174
#define DT_DLL_vrfExtObjects
Definition: dllExport.h:23
DtExtAggregateStateRepository class extends the DtExtAggregateBaseStateRepository to be able to handl...
Definition: extAggregateStateRepository.h:26

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)