VR-Link API Documentation for DIS
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 
24 {
25 public:
26 
28  DtBaseHashKey();
29 
31  virtual ~DtBaseHashKey();
32 
34  DtBaseHashKey(const DtBaseHashKey& orig);
35 
37  DtBaseHashKey& operator=(const DtBaseHashKey& orig);
38 
40  virtual bool operator==(const DtBaseHashKey& other) const;
41 
43  virtual bool operator!=(const DtBaseHashKey& other) const;
44 
47  virtual DtU32 hashValue() const;
48 
50  virtual DtBaseHashKey* clone() const = 0;
51 
53  virtual const DtString stringRep() const = 0;
54 
58  virtual bool equalTo(const DtBaseHashKey& otherKey) const;
59 
60 protected:
61 
63  virtual DtU64 computeHashValue() = 0;
64 
65 
66 protected:
67 
69  mutable bool myHashValueIsComputed;
70 
72  mutable DtU32 myHashValue;
73 };
74 
75 
81 {
82 public:
83 
85  DtIntHashKey(DtU32 num);
86 
88  virtual ~DtIntHashKey();
89 
91  DtIntHashKey(const DtIntHashKey& orig);
92 
94  DtIntHashKey& operator=(const DtIntHashKey& orig);
95 
97  virtual DtBaseHashKey* clone() const;
98 
100  virtual DtU32 value() const;
101 
103  virtual const DtString stringRep() const;
104 
107  virtual bool equalTo(const DtBaseHashKey& otherKey) const;
108 
109 protected:
110 
112  virtual DtU64 computeHashValue();
113 
114 protected:
115 
117 };
118 
119 
131 {
132 public:
133 
135  DtPtrHashKey(void *ptr);
136 
138  virtual ~DtPtrHashKey();
139 
141  DtPtrHashKey(const DtPtrHashKey& orig);
142 
144  DtPtrHashKey& operator=(const DtPtrHashKey& orig);
145 
147  virtual DtBaseHashKey* clone() const;
148 
150  virtual void *value() const;
151 
153  virtual const DtString stringRep() const;
154 
157  virtual bool equalTo(const DtBaseHashKey& otherKey) const;
158 
159 protected:
160 
162  virtual DtU64 computeHashValue();
163 
164 protected:
165 
166  void *myPtr;
167 };
168 
174 {
175 public:
176 
178  DtStringHashKey();
179 
181  DtStringHashKey(const DtString& str);
182 
184  DtStringHashKey(const char* str);
185 
187  virtual ~DtStringHashKey();
188 
190  DtStringHashKey(const DtStringHashKey& orig);
191 
193  DtStringHashKey& operator=(const DtStringHashKey& orig);
194 
196  virtual DtBaseHashKey* clone() const;
197 
199  virtual const DtString& value() const;
200 
202  virtual void setValue(const DtString& val);
203 
205  virtual const DtString stringRep() const;
206 
207 protected:
208 
210  virtual DtU64 computeHashValue();
211 
212 
213 protected:
214 
216 };
217 
223 {
224 public:
225 
228 
230  DtWStringHashKey(const std::wstring& str);
231 
233  DtWStringHashKey(const wchar_t* str);
234 
236  virtual ~DtWStringHashKey();
237 
239  DtWStringHashKey(const DtWStringHashKey& orig);
240 
242  DtWStringHashKey& operator=(const DtWStringHashKey& orig);
243 
245  virtual DtBaseHashKey* clone() const;
246 
248  virtual const std::wstring& value() const;
249 
251  virtual void setValue(const std::wstring& val);
252 
256  virtual const DtString stringRep() const;
257 
258 protected:
259 
261  virtual DtU64 computeHashValue();
262 
263 
264 protected:
265 
266  std::wstring myString;
267 };
268 
269 #ifdef DtUSE_UTILITIES_NAMESPACE
270 }
271 #endif
272 
273 

Document ID: Generated on Wed Oct 23 22:25:48 EDT 2013 from SVN revision 132765
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)