VR-Forces 4.7 Class Documentation
 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 
97  virtual void setUuidString(const DtString& uuidStr);
98  virtual DtString uuidString() const;
99 
102  virtual bool sensorsKilled() const;
103  virtual void setSensorsKilled(bool killed);
105 
106 #if DtDIS
107 
108  void mapPropertiesToRecordTypes(const DtRwProperties* properties,
109  std::map<unsigned, DtString>& recTypesToAttrNames);
110 #endif
111 
113 
115  virtual void updateExtensions();
116 
122  virtual bool updatePropertiesFromAttributes(bool updatesOnly = true);
123 
126  virtual void updateAttributesFromProperties();
127 
132  virtual void addPropertyDecoder(const DtString& propName, PropertyDecoder decoder, void* usr);
133 
138  virtual void addPropertyEncoder(const DtString& propName, PropertyEncoder encoder, void* usr);
139 
144  virtual bool createVrfObjectDataMessage();
145 
148  virtual void giveOwernshipOfProperties();
149 
151  virtual DtTime lastPropertyEncodeTime() const { return myLastEncodeTime; }
152 
154  virtual DtTime lastPropertyDecodeTime() const { return myLastDecodeTime; }
155 
158 
159  virtual void addPropertyUpdatedCallback(
161  virtual void removePropertyUpdatedCallback(
164 
165 protected:
166 
168  virtual void initializeVrfObjectDataProperties();
169 
171  virtual void encodePropertyIfNeeded(const DtSymbolString& propName, DtReaderWriter* propRw);
172 
174  virtual char* encodingBuffer(int size);
175 
176 protected:
177 
181 
183 
185  {
186  PropertyDecoderInfo() : decoder(0), usr(0) {};
187  PropertyDecoderInfo(const DtString& pn, PropertyDecoder d, void* u)
188  : propertyName(pn), decoder(d), usr(u) {};
189 
190  DtString propertyName;
191  PropertyDecoder decoder;
192  void* usr;
193  };
194 
196  {
197  PropertyEncoderInfo() : encoder(0), usr(0) {};
198  PropertyEncoderInfo(const DtString& pn, PropertyEncoder e, void* u)
199  : propertyName(pn), encoder(e), usr(u) {};
200 
201  DtString propertyName;
202  PropertyEncoder encoder;
203  void* usr;
204  };
205 
206  std::list<PropertyDecoderInfo> myAdditionalDecoders;
207  std::list<PropertyEncoderInfo> myAdditionalEncoders;
208 
209  std::vector<char> myPropertyBuffer;
213 
215 
218 
219  mutable int myPropertyVersion;
220 
221  mutable DtString myUUIDString; // May be updated on access from extended data
222 
223  mutable std::map<DtString, DtString> myExtendedDataCache;
225 
227 };
228 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)