![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 2004 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: cstringHashKey.h,v $ $Revision: 1.3 $ $State: Exp $ 00007 *********************************************************************/ 00008 00009 #ifndef cstringHashKey_H_ 00010 #define cstringHashKey_H_ 00011 00012 #include "tdbutil/tdbUtilDefines.h" 00013 #include <vlutil/vlString.h> 00014 #include <vlutil/vlHashKeys.h> 00015 #include <vlutil/vlHashlist.h> 00016 00017 00018 // 00019 // The DtCStringHashKey class is a string hash key not based upon DtString. 00020 // This is useful for longterm storage because this may consume less memory 00021 // as DtStrings always take 64 bytes. 00022 // 00023 class DT_DLL_tdbutil DtCStringHashKey : public DtBaseHashKey 00024 { 00025 public: 00026 00027 // empty constructor -- generally should not be called 00028 DtCStringHashKey(); 00029 00030 // default constructor 00031 DtCStringHashKey(const DtString& str); 00032 00033 // alternate constructor 00034 DtCStringHashKey(const char* str); 00035 00036 // destructor 00037 virtual ~DtCStringHashKey(); 00038 00039 // copy constructor 00040 DtCStringHashKey(const DtCStringHashKey& orig); 00041 00042 // assignment operator 00043 DtCStringHashKey& operator=(const DtCStringHashKey& orig); 00044 00045 // equality operator 00046 virtual bool operator==(const DtBaseHashKey& other) const; 00047 00048 // Make a copy of this hash key. 00049 virtual DtBaseHashKey* clone() const; 00050 00051 // Get hash key value. 00052 virtual const char* value() const; 00053 virtual const DtString stringRep() const; 00054 00055 // Set hash key value 00056 virtual void setValue(const char* val); 00057 00058 protected: 00059 00060 // Compute the hashed value for this key. 00061 virtual DtU32 computeHashValue(); 00062 00063 protected: 00064 00065 char* myString; 00066 }; 00067 00068 #endif 00069