Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

nsBaseHashtable< KeyClass, DataType, UserDataType > Class Template Reference

#include <nsBaseHashtable.h>

Inheritance diagram for nsBaseHashtable< KeyClass, DataType, UserDataType >:

nsTHashtable< nsBaseHashtableET< KeyClass, DataType > > nsBaseHashtableMT< KeyClass, DataType, UserDataType > nsBaseHashtableMT< KeyClass, DataType, DataType > nsBaseHashtableMT< KeyClass, nsAutoPtr< T >, T * > nsBaseHashtableMT< KeyClass, nsCOMPtr< Interface >, Interface * > nsBaseHashtableMT< KeyClass, nsRefPtr< RefPtr >, RefPtr * > nsClassHashtableMT< KeyClass, T > nsInterfaceHashtableMT< KeyClass, Interface > nsRefPtrHashtableMT< KeyClass, RefPtr >

List of all members.

Detailed Description

template<class KeyClass, class DataType, class UserDataType>
class nsBaseHashtable< KeyClass, DataType, UserDataType >

templated hashtable for simple data types This class manages simple data types that do not need construction or destruction. Thread-safety is optional, via a flag in Init()

KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h for a complete specification.
DataType the datatype stored in the hashtable, for example, PRUint32 or nsCOMPtr. If UserDataType is not the same, DataType must implicitly cast to UserDataType
UserDataType the user sees, for example PRUint32 or nsISupports*

Definition at line 82 of file nsBaseHashtable.h.

Public Types

typedef nsBaseHashtableET
< KeyClass, DataType > 
typedef KeyClass::KeyType KeyType
typedef PLDHashOperator(* PR_CALLBACK )(KeyType aKey, DataType &aData, void *userArg)
typedef PLDHashOperator(* PR_CALLBACK )(KeyType aKey, UserDataType aData, void *userArg)

Public Member Functions

void Clear ()
PRUint32 Count () const
PRUint32 Enumerate (EnumFunction enumFunc, void *userArg)
PRUint32 EnumerateRead (EnumReadFunction enumFunc, void *userArg) const
PRBool Get (KeyType aKey, UserDataType *pData) const
PRBool Init (PRUint32 initSize=PL_DHASH_MIN_SIZE)
PRBool IsInitialized () const
PRBool Put (KeyType aKey, UserDataType aData)
void Remove (KeyType aKey)

Protected Types

typedef nsBaseHashtableET
< KeyClass, DataType >

Protected Member Functions

PRUint32 EnumerateEntries (Enumerator enumFunc, void *userArg)
nsBaseHashtableET< KeyClass,
DataType > * 
GetEntry (KeyType aKey) const
nsBaseHashtableET< KeyClass,
DataType > * 
PutEntry (KeyType aKey)
void RawRemoveEntry (nsBaseHashtableET< KeyClass, DataType > *aEntry)
void RemoveEntry (KeyType aKey)

Static Protected Member Functions

static void PR_CALLBACK s_ClearEntry (PLDHashTable *table, PLDHashEntryHdr *entry)
static void PR_CALLBACK s_CopyEntry (PLDHashTable *table, const PLDHashEntryHdr *from, PLDHashEntryHdr *to)
static PLDHashOperator s_EnumReadStub (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)
static PLDHashOperator s_EnumStub (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg)
static const void *PR_CALLBACK s_GetKey (PLDHashTable *table, PLDHashEntryHdr *entry)
static PLDHashNumber PR_CALLBACK s_HashKey (PLDHashTable *table, const void *key)
static PRBool PR_CALLBACK s_InitEntry (PLDHashTable *table, PLDHashEntryHdr *entry, const void *key)
static PRBool PR_CALLBACK s_MatchEntry (PLDHashTable *table, const PLDHashEntryHdr *entry, const void *key)

Protected Attributes

PLDHashTable mTable


struct  s_EnumArgs
struct  s_EnumReadArgs

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index