VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extEntityStateRepository.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2019 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
16 #if DtHLA
18 #else
20 #endif
21 #include <vector>
22 
26  public makVrfVrlinkExtToolkit::DtStateRepositoryWithExtendedAttributes<DtExtEntityBaseStateRepository>
27 {
28 public:
29 
30  typedef void (*PropertyDecoder) (const char* buffer, unsigned size, int version, void* usr);
31  typedef void (*PropertyEncoder) (std::vector<char>& buffer, void* usr);
32 
33 public:
34 
38 
41 
44 
46  virtual ~DtExtEntityStateRepository();
47 
50 
55  virtual void initialize( DtRwProperties* stateProps, DtRwProperties* paramProps );
56 
60  virtual void initialize( const DtRwProperties& stateProps, const DtRwProperties& paramProps );
61 
65  virtual void initialize();
66 
68 
70  virtual bool isInitialized() const;
71 
74 
76  virtual DtStateRepository* clone( bool copy = false ) const;
77 
79  virtual int compare( const DtExtEntityStateRepository* rhs );
80 
81  virtual const DtRwProperties& stateProperties() const
82  {
83  if ( myStateProperties )
84  {
85  return *myStateProperties;
86  }
87 
89  }
90 
91  virtual const DtRwProperties& parameterProperties() const
92  {
93  if ( myParameterProperties )
94  {
95  return *myParameterProperties;
96  }
97 
99  }
100 
102  virtual void setDiGuyActionWithOffset( const DtString& val, bool paused,
103  double speed = 0.0, bool usePositioning = false, const DtVector& offset = DtVector(0,0,0) );
104 
106  virtual void setBodyWeight( double );
107  virtual double bodyWeight() const;
108 
109  virtual void setUuidString( const DtString& uuidStr );
110  virtual DtString uuidString() const;
111 
114 
115  virtual bool sensorsKilled() const;
116  virtual void setSensorsKilled( bool killed );
117 
119 
120 #if DtDIS
121 
122  void mapPropertiesToRecordTypes( const DtRwProperties* properties,
123  std::map<unsigned,DtString>& recTypesToAttrNames );
124 #endif
125 
131  virtual bool updatePropertiesFromAttributes( bool updatesOnly = true );
132 
135  virtual void updateAttributesFromProperties();
136 
142  virtual void addPropertyDecoder( const DtString& propName, PropertyDecoder decoder, void* usr,
143  unsigned disRecordType = 0);
144 
150  virtual void addPropertyEncoder( const DtString& propName, PropertyEncoder encoder, void* usr,
151  unsigned disRecordType = 0);
152 
157  virtual bool createVrfObjectDataMessage();
158 
161  virtual void giveOwernshipOfProperties();
162 
164  virtual DtTime lastPropertyEncodeTime() const { return myLastEncodeTime; }
165 
167  virtual DtTime lastPropertyDecodeTime() const { return myLastDecodeTime; }
168 
172 
173  virtual void addPropertyUpdatedCallback(
175  virtual void removePropertyUpdatedCallback(
177 
179 
180 protected:
181 
183  virtual void initializeVrfObjectDataProperties();
184 
186  virtual void encodePropertyIfNeeded( const DtSymbolString& propName, DtReaderWriter* propRw );
187 
188 protected:
189 
191  {
192  PropertyDecoderInfo() : decoder(0), usr(0) {};
193  PropertyDecoderInfo(const DtString& pn, PropertyDecoder d, void* u)
194  : propertyName(pn), decoder(d), usr(u) {};
195 
196  DtString propertyName;
197  PropertyDecoder decoder;
198  void* usr;
199  };
200 
202  {
203  PropertyEncoderInfo() : encoder(0), usr(0) {};
204  PropertyEncoderInfo(const DtString& pn, PropertyEncoder e, void* u)
205  : propertyName(pn), encoder(e), usr(u) {};
206 
207  DtString propertyName;
208  PropertyEncoder encoder;
209  void* usr;
210  };
211 
215 
217 
218  std::list<PropertyDecoderInfo> myAdditionalDecoders;
219  std::list<PropertyEncoderInfo> myAdditionalEncoders;
220 
221  std::vector<char> myPropertyBuffer;
225 
227 
230 
231  mutable int myPropertyVersion;
232 
233  mutable DtString myUUIDString; // May be updated on access from extended data
234 
235  mutable std::map<DtString,DtString> myExtendedDataCache;
237 
239 
240 };

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)