VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
rwProperty.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
13 #include <readerWriter/rwBoolean.h>
14 #include <readerWriter/rwString.h>
15 #include <readerWriter/rwInt.h>
16 #include <readerWriter/rwReal.h>
17 #include <readerWriter/rwVector.h>
19 #include <vlutil/vlTime.h>
20 
21 #include <string>
22 
25 template <typename _RwType>
26 class DtRwProperty : public _RwType, public DtPropertyInterface
27 {
28 private:
30  DtRwProperty();
31 
32 public:
33 
34  DtRwProperty(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
35  DtRwProperty(const DtString& name, const DtRwProperty& orig,
36  DtReaderWriterRegistry* parentRegistry = 0);
37  DtRwProperty& operator=(const DtRwProperty& orig);
38  virtual ~DtRwProperty();
39 
43  virtual char* encode(char*) const;
44 
46  virtual const char* decode(const char*);
47 
48  virtual DtString stringRep(const DtString& root = "") const;
49 
51  virtual void getSize(int& size) const;
52 
53  virtual int hlaAlignment() const;
54 
56  virtual const char* propertyType() const;
57 
59  virtual DtSymbolString propertyName() const { return _RwType::name(); };
60 
62  virtual void setPropertyName(const DtString& propertyName) { _RwType::setName(propertyName); };
63 
64  virtual void getSelf(DtlObjPtr args,
67 
68  virtual DtlObjPtr getData(DtlObjPtr args, const DtReaderWriter::SearchPaths& searchPaths,
69  const DtVariableBindingsList& variableBindings);
70 
72  virtual bool merge(const DtPropertyInterface& target, MergeFlags,
73  const DtMergePath& path = DtMergePath(), const std::set<DtString>& ignore = std::set<DtString>());
74 
77  virtual DtReaderWriter* readerWriter();
78  virtual const DtReaderWriter* readerWriter() const;
80 
83  virtual DtPropertyInterface* property();
84  virtual const DtPropertyInterface* property() const;
86 
88  virtual void recordUpdateTime() const;
89 
91  virtual bool wasUpdatedSince(DtTime t) const;
92 
95  virtual bool isPublished() const;
96  virtual void setIsPublished(bool isPub);
98 
102  virtual unsigned disRecordType() const;
103  virtual void setDisRecordType(unsigned recType);
105 
106  virtual void reset();
107 
108 protected:
109 
113  unsigned myDisRecordType;
114 };
115 
120 template <typename _RwType>
122 {
123 private:
126 
127 public:
128 
129  DtRwPropertyWithThreshold(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
131  DtReaderWriterRegistry* parentRegistry = 0);
133  virtual ~DtRwPropertyWithThreshold();
134 
139  virtual char* encode(char*) const;
140 
144  virtual bool wasUpdatedSince(DtTime t) const;
145 
147  virtual void enableThresholding(bool enable);
148 
152  virtual void setThreshold(double percentage);
153 
156  static void setDefaultThreshold(double percentage);
157 
162  virtual void setMaxUpdateInterval(DtTime interval);
163 
166  static void setDefaultMaxUpdateInterval(DtTime interval);
167 
176  virtual void setMaxUnchangedUpdateInterval(DtTime interval);
177 
180  static void setDefaultMaxUnchangedUpdateInterval(DtTime interval);
181 
182 protected:
183 
186 
188  mutable _RwType myLastEncodedValue;
189 
192 
193  static double myDefaultThreshold;
194  double myThreshold;
195 
198 
201 };
202 
204 {
205 public:
206  DtRwPropertyString(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
207  DtRwPropertyString(const DtString& name, const DtString& value,
208  DtReaderWriterRegistry* parentRegistry = 0);
209  DtRwPropertyString(const DtString& name, const DtRwPropertyString& orig,
210  DtReaderWriterRegistry* parentRegistry = 0);
212  DtReaderWriterRegistry* parentRegistry = 0);
213 
215 
216  virtual ~DtRwPropertyString();
217 };
218 
220 {
221 public:
222  DtRwPropertyBoolean(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
223  DtRwPropertyBoolean(const DtString& name, bool value,
224  DtReaderWriterRegistry* parentRegistry = 0);
225  DtRwPropertyBoolean(const DtString& name, const DtRwPropertyBoolean& orig,
226  DtReaderWriterRegistry* parentRegistry = 0);
228  DtReaderWriterRegistry* parentRegistry = 0);
230  virtual ~DtRwPropertyBoolean();
231 };
232 
234 {
235 public:
236  DtRwPropertyInt(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
237  DtRwPropertyInt(const DtString& name, int value,
238  DtReaderWriterRegistry* parentRegistry = 0);
239  DtRwPropertyInt(const DtString& name, const DtRwPropertyInt& orig,
240  DtReaderWriterRegistry* parentRegistry = 0);
241  DtRwPropertyInt(const DtRwPropertyInt& orig,
242  DtReaderWriterRegistry* parentRegistry = 0);
244  virtual ~DtRwPropertyInt();
245 };
246 
248 {
249 public:
250  DtRwPropertyInt8(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
251  DtRwPropertyInt8(const DtString& name, DtInt8 value,
252  DtReaderWriterRegistry* parentRegistry = 0);
253  DtRwPropertyInt8(const DtString& name, const DtRwPropertyInt8& orig,
254  DtReaderWriterRegistry* parentRegistry = 0);
256  DtReaderWriterRegistry* parentRegistry = 0);
258  virtual ~DtRwPropertyInt8();
259 };
260 
262 {
263 public:
264  DtRwPropertyInt16(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
265  DtRwPropertyInt16(const DtString& name, DtInt16 value,
266  DtReaderWriterRegistry* parentRegistry = 0);
267  DtRwPropertyInt16(const DtString& name, const DtRwPropertyInt16& orig,
268  DtReaderWriterRegistry* parentRegistry = 0);
270  DtReaderWriterRegistry* parentRegistry = 0);
272  virtual ~DtRwPropertyInt16();
273 };
274 
276 {
277 public:
278  DtRwPropertyInt32(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
279  DtRwPropertyInt32(const DtString& name, DtInt32 value,
280  DtReaderWriterRegistry* parentRegistry = 0);
281  DtRwPropertyInt32(const DtString& name, const DtRwPropertyInt32& orig,
282  DtReaderWriterRegistry* parentRegistry = 0);
284  DtReaderWriterRegistry* parentRegistry = 0);
286  virtual ~DtRwPropertyInt32();
287 };
288 
290 {
291 public:
292  DtRwPropertyReal(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
293  DtRwPropertyReal(const DtString& name, DtReal value,
294  DtReaderWriterRegistry* parentRegistry = 0);
295  DtRwPropertyReal(const DtString& name, const DtRwPropertyReal& orig,
296  DtReaderWriterRegistry* parentRegistry = 0);
298  DtReaderWriterRegistry* parentRegistry = 0);
300  virtual ~DtRwPropertyReal();
301 };
302 
304 {
305 public:
306  DtRwPropertyReal32(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
307  DtRwPropertyReal32(const DtString& name, DtFloat32 value,
308  DtReaderWriterRegistry* parentRegistry = 0);
309  DtRwPropertyReal32(const DtString& name, const DtRwPropertyReal32& orig,
310  DtReaderWriterRegistry* parentRegistry = 0);
312  DtReaderWriterRegistry* parentRegistry = 0);
314  virtual ~DtRwPropertyReal32();
315 };
316 
318 {
319 public:
320  DtRwPropertyReal64(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
321  DtRwPropertyReal64(const DtString& name, DtFloat64 value,
322  DtReaderWriterRegistry* parentRegistry = 0);
323  DtRwPropertyReal64(const DtString& name, const DtRwPropertyReal64& orig,
324  DtReaderWriterRegistry* parentRegistry = 0);
326  DtReaderWriterRegistry* parentRegistry = 0);
328  virtual ~DtRwPropertyReal64();
329 };
330 
332 {
333 public:
334  DtRwPropertyVector(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
335  DtRwPropertyVector(const DtString& name, const DtVector& value,
336  DtReaderWriterRegistry* parentRegistry = 0);
337  DtRwPropertyVector(const DtString& name, const DtRwPropertyVector& orig,
338  DtReaderWriterRegistry* parentRegistry = 0);
340  DtReaderWriterRegistry* parentRegistry = 0);
342  virtual ~DtRwPropertyVector();
343 };
344 
345 
347 {
348 public:
349  DtRwPropertyOffsetVector(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0);
350  DtRwPropertyOffsetVector(const DtString& name, const DtVector& value,
351  DtReaderWriterRegistry* parentRegistry = 0);
353  DtReaderWriterRegistry* parentRegistry = 0);
355  DtReaderWriterRegistry* parentRegistry = 0);
357  virtual ~DtRwPropertyOffsetVector();
358 };
359 
360 #define rwProperties_INL_
361 #include <readerWriter/rwProperty.inl>
362 #undef rwProperties_INL_

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)