VR-Link API Documentation for HLA 1.3
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vlutil
vlHashKeys.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1992-2010 VT MAK
3
** All rights reserved.
4
*********************************************************************/
8
#pragma once
9
10
#include "
vlMachineTypes.h
"
11
#include "
vlString.h
"
12
#include <string>
13
14
#ifdef DtUSE_UTILITIES_NAMESPACE
15
namespace
DtUSE_UTILITIES_NAMESPACE
16
{
17
#endif
18
19
enum
DtHashKeyType
20
{
21
DtBaseHashKeyType
= 0,
22
DtIntHashKeyType
,
23
DtPtrHashKeyType
,
24
DtStringHashKeyType
,
25
DtWStringHashKeyType
,
26
DtEntityIdentifierHashKeyType
,
27
DtEventIdHashKeyType
,
28
DtIFFSystemHashKeyType
,
29
DtObjectIdHashKeyType
,
30
DtSystemHashKeyType
,
31
DtMAXHashKeyType
32
33
};
34
39
class
DT_DLL_VLUTIL
DtBaseHashKey
40
{
41
public
:
42
44
DtBaseHashKey
();
45
47
virtual
~
DtBaseHashKey
();
48
50
DtBaseHashKey
(
const
DtBaseHashKey
& orig);
51
53
DtBaseHashKey
& operator=(
const
DtBaseHashKey
& orig);
54
56
virtual
bool
operator==
(
const
DtBaseHashKey
& other)
const
;
57
59
virtual
bool
operator!=
(
const
DtBaseHashKey
& other)
const
;
60
63
virtual
DtU32
hashValue()
const
;
64
66
virtual
DtHashKeyType
hashKeyType
()
const
{
return
DtBaseHashKeyType
;}
67
69
virtual
DtBaseHashKey
* clone()
const
= 0;
70
72
virtual
const
DtString
stringRep()
const
= 0;
73
77
virtual
bool
equalTo(
const
DtBaseHashKey
& otherKey)
const
;
78
79
protected
:
80
82
virtual
DtU64
computeHashValue() = 0;
83
84
85
protected
:
86
88
mutable
bool
myHashValueIsComputed
;
89
91
mutable
DtU32
myHashValue
;
92
};
93
94
99
class
DT_DLL_VLUTIL
DtIntHashKey
:
public
DtBaseHashKey
100
{
101
public
:
102
104
DtIntHashKey
(
DtU32
num);
105
107
virtual
~
DtIntHashKey
();
108
110
DtIntHashKey
(
const
DtIntHashKey
& orig);
111
113
DtIntHashKey
& operator=(
const
DtIntHashKey
& orig);
114
116
virtual
DtBaseHashKey
* clone()
const
;
117
119
virtual
DtU32
value()
const
;
120
122
virtual
DtHashKeyType
hashKeyType
()
const
{
return
DtIntHashKeyType
;}
123
125
virtual
const
DtString
stringRep()
const
;
126
129
virtual
bool
equalTo(
const
DtBaseHashKey
& otherKey)
const
;
130
131
protected
:
132
134
virtual
DtU64
computeHashValue();
135
136
protected
:
137
138
DtU32
myNum
;
139
};
140
141
152
class
DT_DLL_VLUTIL
DtPtrHashKey
:
public
DtBaseHashKey
153
{
154
public
:
155
157
DtPtrHashKey
(
void
*ptr);
158
160
virtual
~
DtPtrHashKey
();
161
163
DtPtrHashKey
(
const
DtPtrHashKey
& orig);
164
166
DtPtrHashKey
& operator=(
const
DtPtrHashKey
& orig);
167
169
virtual
DtBaseHashKey
* clone()
const
;
170
172
virtual
void
*value()
const
;
173
175
virtual
DtHashKeyType
hashKeyType
()
const
{
return
DtPtrHashKeyType
;}
176
178
virtual
const
DtString
stringRep()
const
;
179
182
virtual
bool
equalTo(
const
DtBaseHashKey
& otherKey)
const
;
183
184
protected
:
185
187
virtual
DtU64
computeHashValue();
188
189
protected
:
190
191
void
*
myPtr
;
192
};
193
198
class
DT_DLL_VLUTIL
DtStringHashKey
:
public
DtBaseHashKey
199
{
200
public
:
201
203
DtStringHashKey
();
204
206
DtStringHashKey
(
const
DtString
& str);
207
209
DtStringHashKey
(
const
char
* str);
210
212
virtual
~
DtStringHashKey
();
213
215
DtStringHashKey
(
const
DtStringHashKey
& orig);
216
218
DtStringHashKey
& operator=(
const
DtStringHashKey
& orig);
219
221
virtual
DtBaseHashKey
* clone()
const
;
222
224
virtual
const
DtString
& value()
const
;
225
227
virtual
void
setValue(
const
DtString
& val);
228
230
virtual
DtHashKeyType
hashKeyType
()
const
{
return
DtStringHashKeyType
;}
231
233
virtual
const
DtString
stringRep()
const
;
234
235
protected
:
236
238
virtual
DtU64
computeHashValue();
239
240
241
protected
:
242
243
DtString
myString
;
244
};
245
250
class
DT_DLL_VLUTIL
DtWStringHashKey
:
public
DtBaseHashKey
251
{
252
public
:
253
255
DtWStringHashKey
();
256
258
DtWStringHashKey
(
const
std::wstring& str);
259
261
DtWStringHashKey
(
const
wchar_t
* str);
262
264
virtual
~
DtWStringHashKey
();
265
267
DtWStringHashKey
(
const
DtWStringHashKey
& orig);
268
270
DtWStringHashKey
& operator=(
const
DtWStringHashKey
& orig);
271
273
virtual
DtBaseHashKey
* clone()
const
;
274
276
virtual
const
std::wstring& value()
const
;
277
279
virtual
void
setValue(
const
std::wstring& val);
280
282
virtual
DtHashKeyType
hashKeyType
()
const
{
return
DtWStringHashKeyType
;}
283
287
virtual
const
DtString
stringRep()
const
;
288
289
protected
:
290
292
virtual
DtU64
computeHashValue();
293
294
295
protected
:
296
297
std::wstring
myString
;
298
};
299
300
#ifdef DtUSE_UTILITIES_NAMESPACE
301
}
302
#endif
303
304
Document ID: Generated on Mon Feb 6 18:36:34 EST 2017 from SVN revision 173107
Copyright © 2005-2016 VT MÄK. All Rights Reserved (
www.mak.com
)