VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
readerWriter
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
11
#include <
readerWriter/readerWriterDefines.h
>
12
#include <
readerWriter/propertyInterface.h
>
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
>
18
#include <
readerWriter/readerWriterFactory.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,
65
const
DtReaderWriter::SearchPaths
& searchPaths =
DtReaderWriter::SearchPaths
(),
66
const
DtVariableBindingsList
& variableBindings =
DtReaderWriter::nullVariableReference
());
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
110
DtClock
myClock
;
111
mutable
DtTime
myUpdateTime
;
112
bool
myIsPublished
;
113
unsigned
myDisRecordType
;
114
};
115
120
template
<
typename
_RwType>
121
class
DtRwPropertyWithThreshold
:
public
DtRwProperty
<_RwType>
122
{
123
private
:
125
DtRwPropertyWithThreshold
();
126
127
public
:
128
129
DtRwPropertyWithThreshold
(
const
DtString
& name,
DtReaderWriterRegistry
* parentRegistry = 0);
130
DtRwPropertyWithThreshold
(
const
DtString
& name,
const
DtRwPropertyWithThreshold
& orig,
131
DtReaderWriterRegistry
* parentRegistry = 0);
132
DtRwPropertyWithThreshold
&
operator=
(
const
DtRwPropertyWithThreshold
& orig);
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
185
bool
myThresholdingEnabled
;
186
188
mutable
_RwType
myLastEncodedValue
;
189
191
mutable
DtTime
myLastEncodeTime
;
192
193
static
double
myDefaultThreshold
;
194
double
myThreshold
;
195
196
static
DtTime
myDefaultMaxUpdateInterval
;
197
DtTime
myMaxUpdateInterval
;
198
199
static
DtTime
myDefaultMaxUnchangedUpdateInterval
;
200
DtTime
myMaxUnchangedUpdateInterval
;
201
};
202
203
class
DT_DLL_readerWriter
DtRwPropertyString
:
public
DtRwProperty
<DtRwString>
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);
211
DtRwPropertyString
(
const
DtRwPropertyString
& orig,
212
DtReaderWriterRegistry
* parentRegistry = 0);
213
214
DtRwPropertyString
&
operator=
(
const
DtRwPropertyString
& orig);
215
216
virtual
~
DtRwPropertyString
();
217
};
218
219
class
DT_DLL_readerWriter
DtRwPropertyBoolean
:
public
DtRwProperty
<DtRwBoolean>
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);
227
DtRwPropertyBoolean
(
const
DtRwPropertyBoolean
& orig,
228
DtReaderWriterRegistry
* parentRegistry = 0);
229
DtRwPropertyBoolean
&
operator=
(
const
DtRwPropertyBoolean
& orig);
230
virtual
~
DtRwPropertyBoolean
();
231
};
232
233
class
DT_DLL_readerWriter
DtRwPropertyInt
:
public
DtRwPropertyWithThreshold
<DtRwInt>
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);
243
DtRwPropertyInt
&
operator=
(
const
DtRwPropertyInt
& orig);
244
virtual
~
DtRwPropertyInt
();
245
};
246
247
class
DT_DLL_readerWriter
DtRwPropertyInt8
:
public
DtRwPropertyWithThreshold
< DtRwInt8 >
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);
255
DtRwPropertyInt8
(
const
DtRwPropertyInt8
& orig,
256
DtReaderWriterRegistry
* parentRegistry = 0);
257
DtRwPropertyInt8
&
operator=
(
const
DtRwPropertyInt8
& orig);
258
virtual
~
DtRwPropertyInt8
();
259
};
260
261
class
DT_DLL_readerWriter
DtRwPropertyInt16
:
public
DtRwPropertyWithThreshold
< DtRwInt16 >
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);
269
DtRwPropertyInt16
(
const
DtRwPropertyInt16
& orig,
270
DtReaderWriterRegistry
* parentRegistry = 0);
271
DtRwPropertyInt16
&
operator=
(
const
DtRwPropertyInt16
& orig);
272
virtual
~
DtRwPropertyInt16
();
273
};
274
275
class
DT_DLL_readerWriter
DtRwPropertyInt32
:
public
DtRwPropertyWithThreshold
< DtRwInt32 >
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);
283
DtRwPropertyInt32
(
const
DtRwPropertyInt32
& orig,
284
DtReaderWriterRegistry
* parentRegistry = 0);
285
DtRwPropertyInt32
&
operator=
(
const
DtRwPropertyInt32
& orig);
286
virtual
~
DtRwPropertyInt32
();
287
};
288
289
class
DT_DLL_readerWriter
DtRwPropertyReal
:
public
DtRwPropertyWithThreshold
<DtRwReal>
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);
297
DtRwPropertyReal
(
const
DtRwPropertyReal
& orig,
298
DtReaderWriterRegistry
* parentRegistry = 0);
299
DtRwPropertyReal
&
operator=
(
const
DtRwPropertyReal
& orig);
300
virtual
~
DtRwPropertyReal
();
301
};
302
303
class
DT_DLL_readerWriter
DtRwPropertyReal32
:
public
DtRwPropertyWithThreshold
< DtRwReal32 >
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);
311
DtRwPropertyReal32
(
const
DtRwPropertyReal32
& orig,
312
DtReaderWriterRegistry
* parentRegistry = 0);
313
DtRwPropertyReal32
&
operator=
(
const
DtRwPropertyReal32
& orig);
314
virtual
~
DtRwPropertyReal32
();
315
};
316
317
class
DT_DLL_readerWriter
DtRwPropertyReal64
:
public
DtRwPropertyWithThreshold
< DtRwReal64 >
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);
325
DtRwPropertyReal64
(
const
DtRwPropertyReal64
& orig,
326
DtReaderWriterRegistry
* parentRegistry = 0);
327
DtRwPropertyReal64
&
operator=
(
const
DtRwPropertyReal64
& orig);
328
virtual
~
DtRwPropertyReal64
();
329
};
330
331
class
DT_DLL_readerWriter
DtRwPropertyVector
:
public
DtRwPropertyWithThreshold
< DtRwVector >
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);
339
DtRwPropertyVector
(
const
DtRwPropertyVector
& orig,
340
DtReaderWriterRegistry
* parentRegistry = 0);
341
DtRwPropertyVector
&
operator=
(
const
DtRwPropertyVector
& orig);
342
virtual
~
DtRwPropertyVector
();
343
};
344
345
346
class
DT_DLL_readerWriter
DtRwPropertyOffsetVector
:
public
DtRwPropertyWithThreshold
< DtRwOffsetVector >
347
{
348
public
:
349
DtRwPropertyOffsetVector
(
const
DtString
& name,
DtReaderWriterRegistry
* parentRegistry = 0);
350
DtRwPropertyOffsetVector
(
const
DtString
& name,
const
DtVector
& value,
351
DtReaderWriterRegistry
* parentRegistry = 0);
352
DtRwPropertyOffsetVector
(
const
DtString
& name,
const
DtRwPropertyOffsetVector
& orig,
353
DtReaderWriterRegistry
* parentRegistry = 0);
354
DtRwPropertyOffsetVector
(
const
DtRwPropertyOffsetVector
& orig,
355
DtReaderWriterRegistry
* parentRegistry = 0);
356
DtRwPropertyOffsetVector
&
operator=
(
const
DtRwPropertyOffsetVector
& orig);
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
)