VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extendedPropertiesEntityStateRepository.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 
11 #include <vrfutil/rwProperties.h>
12 #if DtHLA
14 #else
16 #endif
17 #include <vector>
18 
19 class DtVrfParameterDb;
20 
25 {
26 
27 public:
28 
29  typedef void (*PropertyDecoder) (const char* buffer, unsigned size, int version, void* usr);
30  typedef void (*PropertyEncoder) (std::vector<char>& buffer, void* usr);
31 
34 
37 
40 
44 
47  virtual void initialize(DtVrfParameterDb*);
48 
52  virtual void initialize(DtRwProperties* stateProps, DtRwProperties* paramProps);
53 
57  virtual void initialize();
59 
61  virtual bool isInitialized() const;
62 
66 
68  virtual DtStateRepository* clone(bool copy = false) const;
69 
72  virtual int compare(const DtExtEntityStateRepository* rhs);
73 
74  const DtRwProperties& stateProperties() const
75  {
76  if (myStateProperties)
77  {
78  return *myStateProperties;
79  }
80 
81  return theEmptyProperties;
82  }
83 
84  const DtRwProperties& parameterProperties() const
85  {
86  if (myParameterProperties)
87  {
88  return *myParameterProperties;
89  }
90 
91  return theEmptyProperties;
92  }
93 
96  virtual DtUUID uuid() const;
97  virtual void setUuid(const DtUUID& uuid);
99 
100  virtual DtString uuidString() const;
101 
102 #if DtDIS
103 
104  void mapPropertiesToRecordTypes(const DtRwProperties* properties,
105  std::map<unsigned, DtString>& recTypesToAttrNames);
106 #endif
107 
113  virtual bool updatePropertiesFromAttributes(bool updatesOnly = true);
114 
117  virtual void updateAttributesFromProperties();
118 
123  virtual void addPropertyDecoder(const DtString& propName, PropertyDecoder decoder, void* usr);
124 
129  virtual void addPropertyEncoder(const DtString& propName, PropertyEncoder encoder, void* usr);
130 
135  virtual bool createVrfObjectDataMessage();
136 
139  virtual void giveOwernshipOfProperties();
140 
142 
144  virtual DtTime lastPropertyEncodeTime() const { return myLastEncodeTime; }
145 
147  virtual DtTime lastPropertyDecodeTime() const { return myLastDecodeTime; }
148 
149 protected:
150 
152  virtual void initializeVrfObjectDataProperties();
153 
155  virtual void encodePropertyIfNeeded(const DtSymbolString& propName, DtReaderWriter* propRw);
156 
157 protected:
158 
164 
166 
168  {
169  PropertyDecoderInfo() : decoder(0), usr(0) {};
170  PropertyDecoderInfo(const DtString& pn, PropertyDecoder d, void* u)
171  : propertyName(pn), decoder(d), usr(u) {};
172 
173  DtString propertyName;
174  PropertyDecoder decoder;
175  void* usr;
176  };
177 
179  {
180  PropertyEncoderInfo() : encoder(0), usr(0) {};
181  PropertyEncoderInfo(const DtString& pn, PropertyEncoder e, void* u)
182  : propertyName(pn), encoder(e), usr(u) {};
183 
184  DtString propertyName;
185  PropertyEncoder encoder;
186  void* usr;
187  };
188 
189  std::list<PropertyDecoderInfo> myAdditionalDecoders;
190  std::list<PropertyEncoderInfo> myAdditionalEncoders;
191 
192  std::vector<char> myPropertyBuffer;
196 
197  mutable DtUUID myUUID;
198 
199  mutable std::map<DtString, DtString> myExtendedDataCache;
201 
203 };
204 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)