This commit is contained in:
dougt%netscape.com 2001-09-28 21:37:23 +00:00
Родитель 4e12e44b2f
Коммит f36caa8fdd
1 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -62,6 +62,7 @@ class NS_COM nsHashKey {
enum nsHashKeyType {
UnknownKey,
SupportsKey,
PRUint32Key,
VoidKey,
IDKey,
CStringKey,
@ -227,6 +228,31 @@ class NS_COM nsISupportsKey : public nsHashKey {
nsresult Write(nsIObjectOutputStream* aStream) const;
};
class nsPRUint32Key : public nsHashKey {
protected:
PRUint32 mKey;
public:
nsPRUint32Key(PRUint32 key) {
#ifdef DEBUG
mKeyType = PRUint32Key;
#endif
mKey = key;
}
PRUint32 HashCode(void) const {
return mKey;
}
PRBool Equals(const nsHashKey *aKey) const {
return mKey == ((const nsPRUint32Key *) aKey)->mKey;
}
nsHashKey *Clone() const {
return new nsPRUint32Key(mKey);
}
PRUint32 GetValue() { return mKey; }
};
////////////////////////////////////////////////////////////////////////////////
// nsVoidKey: Where keys are void* objects that don't get refcounted.