Classes | Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes

nsTHashtable< EntryType > Class Template Reference

a base class for templated hashtables. More...

#include <nsTHashtable.h>

Inheritance diagram for nsTHashtable< EntryType >:
Collaboration diagram for nsTHashtable< EntryType >:

List of all members.

Classes

struct  s_EnumArgs
 passed internally during enumeration. More...

Public Types

typedef EntryType::KeyType KeyType
 KeyType is typedef'ed for ease of use.
typedef EntryType::KeyTypePointer KeyTypePointer
 KeyTypePointer is typedef'ed for ease of use.
typedef PLDHashOperator(* Enumerator )(EntryType *aEntry, void *userArg)
 client must provide an Enumerator function for EnumerateEntries

Public Member Functions

 nsTHashtable ()
 A dummy constructor; you must call Init() before using this class.
 ~nsTHashtable ()
 destructor, cleans up and deallocates
PRBool Init (PRUint32 initSize=16)
 Initialize the table.
PRBool IsInitialized () const
 Check whether the table has been initialized.
PRUint32 GetGeneration () const
 Return the generation number for the table.
PRUint32 Count () const
 Return the number of entries in the table.
EntryType * GetEntry (KeyType aKey) const
 Get the entry associated with a key.
EntryType * PutEntry (KeyType aKey)
 Get the entry associated with a key, or create a new entry,.
void RemoveEntry (KeyType aKey)
 Remove the entry associated with a key.
void RawRemoveEntry (EntryType *aEntry)
 Remove the entry associated with a key, but don't resize the hashtable.
PRUint32 EnumerateEntries (Enumerator enumFunc, void *userArg)
 Enumerate all the entries of the function.
void Clear ()
 remove all entries, return hashtable to "pristine" state ;)

Static Protected Member Functions

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

Protected Attributes

PLDHashTable mTable

Detailed Description

template<class EntryType>
class nsTHashtable< EntryType >

a base class for templated hashtables.

Clients will rarely need to use this class directly. Check the derived classes first, to see if they will meet your needs.

Parameters:
EntryType the templated entry-type class that is managed by the hashtable. EntryType must extend the following declaration, and must not declare any virtual functions or derive from classes with virtual functions. Any vtable pointer would break the PLDHashTable code.

   class EntryType : public PLDHashEntryHdr
   {
   public: or friend nsTHashtable<EntryType>;
     // KeyType is what we use when Get()ing or Put()ing this entry
     // this should either be a simple datatype (PRUint32, nsISupports*) or
     // a const reference (const nsAString&)
     typedef something KeyType;
     // KeyTypePointer is the pointer-version of KeyType, because pldhash.h
     // requires keys to cast to const void*
     typedef const something* KeyTypePointer;

EntryType(KeyTypePointer aKey);

     // the copy constructor must be defined, even if AllowMemMove() == true
     // or you will cause link errors!
     EntryType(const EntryType& aEnt);
     // the destructor must be defined... or you will cause link errors!
     ~EntryType();
     // KeyEquals(): does this entry match this key?
     PRBool KeyEquals(KeyTypePointer aKey) const;
     // KeyToPointer(): Convert KeyType to KeyTypePointer
     static KeyTypePointer KeyToPointer(KeyType aKey);
     // HashKey(): calculate the hash number
     static PLDHashNumber HashKey(KeyTypePointer aKey);
     // ALLOW_MEMMOVE can we move this class with memmove(), or do we have
     // to use the copy constructor?
     enum { ALLOW_MEMMOVE = PR_(TRUE or FALSE) };
   }
See also:
nsInterfaceHashtable
nsDataHashtable
nsClassHashtable
Author:
"Benjamin Smedberg <bsmedberg@covad.net>"

Member Typedef Documentation

template<class EntryType>
typedef PLDHashOperator(* nsTHashtable< EntryType >::Enumerator)(EntryType *aEntry, void *userArg)

client must provide an Enumerator function for EnumerateEntries

Parameters:
aEntry the entry being enumerated
userArg passed unchanged from EnumerateEntries
Returns:
combination of flags PL_DHASH_NEXT , PL_DHASH_STOP , PL_DHASH_REMOVE
template<class EntryType>
typedef EntryType::KeyType nsTHashtable< EntryType >::KeyType

KeyType is typedef'ed for ease of use.

Reimplemented in nsBaseHashtable< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsClassHashtable< KeyClass, T >, nsClassHashtableMT< KeyClass, T >, nsRefPtrHashtable< KeyClass, RefPtr >, nsRefPtrHashtableMT< KeyClass, RefPtr >, nsBaseHashtable< nsStringHashKey, nsAutoPtr< RecList >, RecList * >, nsBaseHashtable< nsISupportsHashKey, nsAutoPtr< nsInsertionPointList >, nsInsertionPointList * >, nsBaseHashtable< URIAndPrincipalHashKey, nsRefPtr< nsCSSStyleSheet >, nsCSSStyleSheet * >, nsBaseHashtable< nsCStringHashKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, void *, void * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsUint32HashKey, nsAutoPtr< nsKeyFrameIndex >, nsKeyFrameIndex * >, nsBaseHashtable< nsPrefObserverHashKey, nsRefPtr< nsPrefOldCallback >, nsPrefOldCallback * >, nsBaseHashtable< nsVoidPtrHashKey, PluginScriptableObjectParent *, PluginScriptableObjectParent * >, nsBaseHashtable< nsPtrHashKey< JSObject >, nsAutoPtr< PObjectWrapperChild >, PObjectWrapperChild * >, nsBaseHashtable< IDKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, nsRefPtr< nsImageLoader >, nsImageLoader * >, nsBaseHashtable< nsISupportsHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< URIAndPrincipalHashKey, SheetLoadData *, SheetLoadData * >, nsBaseHashtable< nsUint32HashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< nsStringHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< IDKey, nsTArray< nsCString_external > *, nsTArray< nsCString_external > * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< KeyClass, DataType, DataType >, nsBaseHashtable< nsISupportsHashKey, nsRefPtr< nsXBLBinding >, nsXBLBinding * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< nsTArray< IDBDatabase * > >, nsTArray< IDBDatabase * > * >, nsBaseHashtable< nsStringHashKey, nsRefPtr< gfxMixedFontFamily >, gfxMixedFontFamily * >, nsBaseHashtable< nsCStringHashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsVoidPtrHashKey, PluginIdentifierParent *, PluginIdentifierParent * >, nsBaseHashtable< nsURIHashKey, nsRefPtr< nsXBLDocumentInfo >, nsXBLDocumentInfo * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< CacheEntry >, CacheEntry * >, nsBaseHashtableMT< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtableMT< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtableMT< KeyClass, DataType, DataType >, nsClassHashtable< nsPtrHashKey< JSObject >, PObjectWrapperChild >, nsClassHashtable< nsCStringHashKey, nsTArray< IDBDatabase * > >, nsClassHashtable< nsCStringHashKey, CacheEntry >, nsClassHashtable< nsStringHashKey, RecList >, nsClassHashtable< nsUint32HashKey, nsKeyFrameIndex >, nsClassHashtable< nsISupportsHashKey, nsInsertionPointList >, nsRefPtrHashtable< nsPrefObserverHashKey, nsPrefOldCallback >, nsRefPtrHashtable< URIAndPrincipalHashKey, nsCSSStyleSheet >, nsRefPtrHashtable< nsURIHashKey, nsXBLDocumentInfo >, nsRefPtrHashtable< nsStringHashKey, gfxMixedFontFamily >, nsRefPtrHashtable< nsISupportsHashKey, nsXBLBinding >, and nsRefPtrHashtable< nsVoidPtrHashKey, nsImageLoader >.

template<class EntryType>
typedef EntryType::KeyTypePointer nsTHashtable< EntryType >::KeyTypePointer

KeyTypePointer is typedef'ed for ease of use.


Constructor & Destructor Documentation

template<class EntryType >
nsTHashtable< EntryType >::nsTHashtable (  ) 

A dummy constructor; you must call Init() before using this class.

template<class EntryType >
nsTHashtable< EntryType >::~nsTHashtable (  ) 

destructor, cleans up and deallocates


Member Function Documentation

template<class EntryType>
void nsTHashtable< EntryType >::Clear (  )  [inline]

remove all entries, return hashtable to "pristine" state ;)

Reimplemented in nsBaseHashtable< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtable< nsStringHashKey, nsAutoPtr< RecList >, RecList * >, nsBaseHashtable< nsISupportsHashKey, nsAutoPtr< nsInsertionPointList >, nsInsertionPointList * >, nsBaseHashtable< URIAndPrincipalHashKey, nsRefPtr< nsCSSStyleSheet >, nsCSSStyleSheet * >, nsBaseHashtable< nsCStringHashKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, void *, void * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsUint32HashKey, nsAutoPtr< nsKeyFrameIndex >, nsKeyFrameIndex * >, nsBaseHashtable< nsPrefObserverHashKey, nsRefPtr< nsPrefOldCallback >, nsPrefOldCallback * >, nsBaseHashtable< nsVoidPtrHashKey, PluginScriptableObjectParent *, PluginScriptableObjectParent * >, nsBaseHashtable< nsPtrHashKey< JSObject >, nsAutoPtr< PObjectWrapperChild >, PObjectWrapperChild * >, nsBaseHashtable< IDKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, nsRefPtr< nsImageLoader >, nsImageLoader * >, nsBaseHashtable< nsISupportsHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< URIAndPrincipalHashKey, SheetLoadData *, SheetLoadData * >, nsBaseHashtable< nsUint32HashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< nsStringHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< IDKey, nsTArray< nsCString_external > *, nsTArray< nsCString_external > * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< KeyClass, DataType, DataType >, nsBaseHashtable< nsISupportsHashKey, nsRefPtr< nsXBLBinding >, nsXBLBinding * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< nsTArray< IDBDatabase * > >, nsTArray< IDBDatabase * > * >, nsBaseHashtable< nsStringHashKey, nsRefPtr< gfxMixedFontFamily >, gfxMixedFontFamily * >, nsBaseHashtable< nsCStringHashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsVoidPtrHashKey, PluginIdentifierParent *, PluginIdentifierParent * >, nsBaseHashtable< nsURIHashKey, nsRefPtr< nsXBLDocumentInfo >, nsXBLDocumentInfo * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< CacheEntry >, CacheEntry * >, nsBaseHashtableMT< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtableMT< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, and nsBaseHashtableMT< KeyClass, DataType, DataType >.

template<class EntryType>
PRUint32 nsTHashtable< EntryType >::Count (  )  const [inline]

Return the number of entries in the table.

Returns:
number of entries

Reimplemented in nsBaseHashtable< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtable< nsStringHashKey, nsAutoPtr< RecList >, RecList * >, nsBaseHashtable< nsISupportsHashKey, nsAutoPtr< nsInsertionPointList >, nsInsertionPointList * >, nsBaseHashtable< URIAndPrincipalHashKey, nsRefPtr< nsCSSStyleSheet >, nsCSSStyleSheet * >, nsBaseHashtable< nsCStringHashKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, void *, void * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsUint32HashKey, nsAutoPtr< nsKeyFrameIndex >, nsKeyFrameIndex * >, nsBaseHashtable< nsPrefObserverHashKey, nsRefPtr< nsPrefOldCallback >, nsPrefOldCallback * >, nsBaseHashtable< nsVoidPtrHashKey, PluginScriptableObjectParent *, PluginScriptableObjectParent * >, nsBaseHashtable< nsPtrHashKey< JSObject >, nsAutoPtr< PObjectWrapperChild >, PObjectWrapperChild * >, nsBaseHashtable< IDKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, nsRefPtr< nsImageLoader >, nsImageLoader * >, nsBaseHashtable< nsISupportsHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< URIAndPrincipalHashKey, SheetLoadData *, SheetLoadData * >, nsBaseHashtable< nsUint32HashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< nsStringHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< IDKey, nsTArray< nsCString_external > *, nsTArray< nsCString_external > * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< KeyClass, DataType, DataType >, nsBaseHashtable< nsISupportsHashKey, nsRefPtr< nsXBLBinding >, nsXBLBinding * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< nsTArray< IDBDatabase * > >, nsTArray< IDBDatabase * > * >, nsBaseHashtable< nsStringHashKey, nsRefPtr< gfxMixedFontFamily >, gfxMixedFontFamily * >, nsBaseHashtable< nsCStringHashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsVoidPtrHashKey, PluginIdentifierParent *, PluginIdentifierParent * >, nsBaseHashtable< nsURIHashKey, nsRefPtr< nsXBLDocumentInfo >, nsXBLDocumentInfo * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< CacheEntry >, CacheEntry * >, nsBaseHashtableMT< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtableMT< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, and nsBaseHashtableMT< KeyClass, DataType, DataType >.

template<class EntryType>
PRUint32 nsTHashtable< EntryType >::EnumerateEntries ( Enumerator  enumFunc,
void *  userArg 
) [inline]

Enumerate all the entries of the function.

Parameters:
enumFunc the Enumerator function to call
userArg a pointer to pass to the Enumerator function
Returns:
the number of entries actually enumerated
template<class EntryType>
EntryType* nsTHashtable< EntryType >::GetEntry ( KeyType  aKey  )  const [inline]

Get the entry associated with a key.

Parameters:
aKey the key to retrieve
Returns:
pointer to the entry class, if the key exists; nsnull if the key doesn't exist
template<class EntryType>
PRUint32 nsTHashtable< EntryType >::GetGeneration (  )  const [inline]

Return the generation number for the table.

This increments whenever the table data items are moved.

template<class EntryType >
PRBool nsTHashtable< EntryType >::Init ( PRUint32  initSize = 16  ) 

Initialize the table.

This function must be called before any other class operations. This can fail due to OOM conditions.

Parameters:
initSize the initial number of buckets in the hashtable, default 16
Returns:
PR_TRUE if the class was initialized properly.

Reimplemented in nsBaseHashtable< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtable< nsStringHashKey, nsAutoPtr< RecList >, RecList * >, nsBaseHashtable< nsISupportsHashKey, nsAutoPtr< nsInsertionPointList >, nsInsertionPointList * >, nsBaseHashtable< URIAndPrincipalHashKey, nsRefPtr< nsCSSStyleSheet >, nsCSSStyleSheet * >, nsBaseHashtable< nsCStringHashKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, void *, void * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsUint32HashKey, nsAutoPtr< nsKeyFrameIndex >, nsKeyFrameIndex * >, nsBaseHashtable< nsPrefObserverHashKey, nsRefPtr< nsPrefOldCallback >, nsPrefOldCallback * >, nsBaseHashtable< nsVoidPtrHashKey, PluginScriptableObjectParent *, PluginScriptableObjectParent * >, nsBaseHashtable< nsPtrHashKey< JSObject >, nsAutoPtr< PObjectWrapperChild >, PObjectWrapperChild * >, nsBaseHashtable< IDKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, nsRefPtr< nsImageLoader >, nsImageLoader * >, nsBaseHashtable< nsISupportsHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< URIAndPrincipalHashKey, SheetLoadData *, SheetLoadData * >, nsBaseHashtable< nsUint32HashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< nsStringHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< IDKey, nsTArray< nsCString_external > *, nsTArray< nsCString_external > * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< KeyClass, DataType, DataType >, nsBaseHashtable< nsISupportsHashKey, nsRefPtr< nsXBLBinding >, nsXBLBinding * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< nsTArray< IDBDatabase * > >, nsTArray< IDBDatabase * > * >, nsBaseHashtable< nsStringHashKey, nsRefPtr< gfxMixedFontFamily >, gfxMixedFontFamily * >, nsBaseHashtable< nsCStringHashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsVoidPtrHashKey, PluginIdentifierParent *, PluginIdentifierParent * >, nsBaseHashtable< nsURIHashKey, nsRefPtr< nsXBLDocumentInfo >, nsXBLDocumentInfo * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< CacheEntry >, CacheEntry * >, nsBaseHashtableMT< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtableMT< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, and nsBaseHashtableMT< KeyClass, DataType, DataType >.

template<class EntryType>
PRBool nsTHashtable< EntryType >::IsInitialized (  )  const [inline]

Check whether the table has been initialized.

This can be useful for static hashtables.

Returns:
the initialization state of the class.

Reimplemented in nsBaseHashtable< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtable< nsStringHashKey, nsAutoPtr< RecList >, RecList * >, nsBaseHashtable< nsISupportsHashKey, nsAutoPtr< nsInsertionPointList >, nsInsertionPointList * >, nsBaseHashtable< URIAndPrincipalHashKey, nsRefPtr< nsCSSStyleSheet >, nsCSSStyleSheet * >, nsBaseHashtable< nsCStringHashKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, void *, void * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsUint32HashKey, nsAutoPtr< nsKeyFrameIndex >, nsKeyFrameIndex * >, nsBaseHashtable< nsPrefObserverHashKey, nsRefPtr< nsPrefOldCallback >, nsPrefOldCallback * >, nsBaseHashtable< nsVoidPtrHashKey, PluginScriptableObjectParent *, PluginScriptableObjectParent * >, nsBaseHashtable< nsPtrHashKey< JSObject >, nsAutoPtr< PObjectWrapperChild >, PObjectWrapperChild * >, nsBaseHashtable< IDKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, nsRefPtr< nsImageLoader >, nsImageLoader * >, nsBaseHashtable< nsISupportsHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< URIAndPrincipalHashKey, SheetLoadData *, SheetLoadData * >, nsBaseHashtable< nsUint32HashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< nsStringHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< IDKey, nsTArray< nsCString_external > *, nsTArray< nsCString_external > * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< KeyClass, DataType, DataType >, nsBaseHashtable< nsISupportsHashKey, nsRefPtr< nsXBLBinding >, nsXBLBinding * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< nsTArray< IDBDatabase * > >, nsTArray< IDBDatabase * > * >, nsBaseHashtable< nsStringHashKey, nsRefPtr< gfxMixedFontFamily >, gfxMixedFontFamily * >, nsBaseHashtable< nsCStringHashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsVoidPtrHashKey, PluginIdentifierParent *, PluginIdentifierParent * >, nsBaseHashtable< nsURIHashKey, nsRefPtr< nsXBLDocumentInfo >, nsXBLDocumentInfo * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< CacheEntry >, CacheEntry * >, nsBaseHashtableMT< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtableMT< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, and nsBaseHashtableMT< KeyClass, DataType, DataType >.

template<class EntryType>
EntryType* nsTHashtable< EntryType >::PutEntry ( KeyType  aKey  )  [inline]

Get the entry associated with a key, or create a new entry,.

Parameters:
aKey the key to retrieve
Returns:
pointer to the entry class retreived; nsnull only if memory can't be allocated
template<class EntryType>
void nsTHashtable< EntryType >::RawRemoveEntry ( EntryType *  aEntry  )  [inline]

Remove the entry associated with a key, but don't resize the hashtable.

This is a low-level method, and is not recommended unless you know what you're doing and you need the extra performance. This method can be used during enumeration, while RemoveEntry() cannot.

Parameters:
aEntry the entry-pointer to remove (obtained from GetEntry or the enumerator
template<class EntryType>
void nsTHashtable< EntryType >::RemoveEntry ( KeyType  aKey  )  [inline]

Remove the entry associated with a key.

Parameters:
aKey of the entry to remove
template<class EntryType >
void nsTHashtable< EntryType >::s_ClearEntry ( PLDHashTable table,
PLDHashEntryHdr entry 
) [static, protected]
template<class EntryType >
void nsTHashtable< EntryType >::s_CopyEntry ( PLDHashTable table,
const PLDHashEntryHdr from,
PLDHashEntryHdr to 
) [static, protected]
template<class EntryType >
PLDHashOperator nsTHashtable< EntryType >::s_EnumStub ( PLDHashTable table,
PLDHashEntryHdr entry,
PRUint32  number,
void *  arg 
) [static, protected]

Reimplemented in nsBaseHashtable< KeyClass, DataType, UserDataType >, nsBaseHashtable< nsStringHashKey, nsAutoPtr< RecList >, RecList * >, nsBaseHashtable< nsISupportsHashKey, nsAutoPtr< nsInsertionPointList >, nsInsertionPointList * >, nsBaseHashtable< URIAndPrincipalHashKey, nsRefPtr< nsCSSStyleSheet >, nsCSSStyleSheet * >, nsBaseHashtable< nsCStringHashKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, void *, void * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsUint32HashKey, nsAutoPtr< nsKeyFrameIndex >, nsKeyFrameIndex * >, nsBaseHashtable< nsPrefObserverHashKey, nsRefPtr< nsPrefOldCallback >, nsPrefOldCallback * >, nsBaseHashtable< nsVoidPtrHashKey, PluginScriptableObjectParent *, PluginScriptableObjectParent * >, nsBaseHashtable< nsPtrHashKey< JSObject >, nsAutoPtr< PObjectWrapperChild >, PObjectWrapperChild * >, nsBaseHashtable< IDKey, nsCString_external, nsCString_external >, nsBaseHashtable< nsVoidPtrHashKey, nsRefPtr< nsImageLoader >, nsImageLoader * >, nsBaseHashtable< nsISupportsHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< URIAndPrincipalHashKey, SheetLoadData *, SheetLoadData * >, nsBaseHashtable< nsUint32HashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< nsStringHashKey, EventNameMapping, EventNameMapping >, nsBaseHashtable< IDKey, nsTArray< nsCString_external > *, nsTArray< nsCString_external > * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsBaseHashtable< KeyClass, DataType, DataType >, nsBaseHashtable< nsISupportsHashKey, nsRefPtr< nsXBLBinding >, nsXBLBinding * >, nsBaseHashtable< nsCStringHashKey, nsAutoPtr< nsTArray< IDBDatabase * > >, nsTArray< IDBDatabase * > * >, nsBaseHashtable< nsStringHashKey, nsRefPtr< gfxMixedFontFamily >, gfxMixedFontFamily * >, nsBaseHashtable< nsCStringHashKey, PluginIdentifierChild *, PluginIdentifierChild * >, nsBaseHashtable< KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtable< nsVoidPtrHashKey, PluginIdentifierParent *, PluginIdentifierParent * >, nsBaseHashtable< nsURIHashKey, nsRefPtr< nsXBLDocumentInfo >, nsXBLDocumentInfo * >, nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >, and nsBaseHashtable< nsCStringHashKey, nsAutoPtr< CacheEntry >, CacheEntry * >.

template<class EntryType>
static const void* nsTHashtable< EntryType >::s_GetKey ( PLDHashTable table,
PLDHashEntryHdr entry 
) [static, protected]
template<class EntryType >
PLDHashNumber nsTHashtable< EntryType >::s_HashKey ( PLDHashTable table,
const void *  key 
) [static, protected]
template<class EntryType >
PRBool nsTHashtable< EntryType >::s_InitEntry ( PLDHashTable table,
PLDHashEntryHdr entry,
const void *  key 
) [static, protected]
template<class EntryType >
PRBool nsTHashtable< EntryType >::s_MatchEntry ( PLDHashTable table,
const PLDHashEntryHdr entry,
const void *  key 
) [static, protected]

Member Data Documentation

template<class EntryType>
PLDHashTable nsTHashtable< EntryType >::mTable [protected]

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