VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extendedPropertiesAggregateStateRepository.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 
24  public makVrfVrlinkExtToolkit::DtStateRepositoryWithExtendedAttributes<DtExtAggregateStateRepository>
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 DtExtAggregateStateRepository* 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 
109 
111  virtual void updateExtensions();
112 
118  virtual bool updatePropertiesFromAttributes(bool updatesOnly = true);
119 
122  virtual void updateAttributesFromProperties();
123 
128  virtual void addPropertyDecoder(const DtString& propName, PropertyDecoder decoder, void* usr);
129 
134  virtual void addPropertyEncoder(const DtString& propName, PropertyEncoder encoder, void* usr);
135 
140  virtual bool createVrfObjectDataMessage();
141 
144  virtual void giveOwernshipOfProperties();
145 
147  virtual DtTime lastPropertyEncodeTime() const { return myLastEncodeTime; }
148 
150  virtual DtTime lastPropertyDecodeTime() const { return myLastDecodeTime; }
151 
152 protected:
153 
155  virtual void initializeVrfObjectDataProperties();
156 
158  virtual void encodePropertyIfNeeded(const DtSymbolString& propName, DtReaderWriter* propRw);
159 
160 protected:
161 
167 
169 
171  {
172  PropertyDecoderInfo() : decoder(0), usr(0) {};
173  PropertyDecoderInfo(const DtString& pn, PropertyDecoder d, void* u)
174  : propertyName(pn), decoder(d), usr(u) {};
175 
176  DtString propertyName;
177  PropertyDecoder decoder;
178  void* usr;
179  };
180 
182  {
183  PropertyEncoderInfo() : encoder(0), usr(0) {};
184  PropertyEncoderInfo(const DtString& pn, PropertyEncoder e, void* u)
185  : propertyName(pn), encoder(e), usr(u) {};
186 
187  DtString propertyName;
188  PropertyEncoder encoder;
189  void* usr;
190  };
191 
192  std::list<PropertyDecoderInfo> myAdditionalDecoders;
193  std::list<PropertyEncoderInfo> myAdditionalEncoders;
194 
195  std::vector<char> myPropertyBuffer;
199 
200  mutable DtUUID myUUID;
201 
202  mutable std::map<DtString, DtString> myExtendedDataCache;
204 
206 };
207 

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)