#include <nsBaseHashtable.h>
| 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* |
Public Types | |
| typedef KeyClass::KeyType | KeyType |
| KeyType is typedef'ed for ease of use. | |
| typedef nsBaseHashtableET < KeyClass, DataType > | EntryType |
| typedef PLDHashOperator(* | PR_CALLBACK )(KeyType aKey, UserDataType aData, void *userArg) |
| function type provided by the application for enumeration. | |
| typedef PLDHashOperator(* | PR_CALLBACK )(KeyType aKey, DataType &aData, void *userArg) |
| function type provided by the application for enumeration. | |
Public Member Functions | |
| PRBool | Init (PRUint32 initSize=PL_DHASH_MIN_SIZE) |
| Initialize the object. | |
| PRBool | IsInitialized () const |
| Check whether the table has been initialized. | |
| PRUint32 | Count () const |
| Return the number of entries in the table. | |
| PRBool | Get (KeyType aKey, UserDataType *pData) const |
| retrieve the value for a key. | |
| PRBool | Put (KeyType aKey, UserDataType aData) |
| put a new value for the associated key | |
| void | Remove (KeyType aKey) |
| remove the data for the associated key | |
| PRUint32 | EnumerateRead (EnumReadFunction enumFunc, void *userArg) const |
| enumerate entries in the hashtable, without allowing changes | |
| PRUint32 | Enumerate (EnumFunction enumFunc, void *userArg) |
| enumerate entries in the hashtable, allowing changes. | |
| void | Clear () |
| reset the hashtable, removing all entries | |
Static Protected Member Functions | |
| static PLDHashOperator | s_EnumReadStub (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg) |
| static PLDHashOperator | s_EnumStub (PLDHashTable *table, PLDHashEntryHdr *hdr, PRUint32 number, void *arg) |
Classes | |
| struct | s_EnumArgs |
| struct | s_EnumReadArgs |
| used internally during EnumerateRead. More... | |
| typedef KeyClass::KeyType nsBaseHashtable< KeyClass, DataType, UserDataType >::KeyType |
Reimplemented from nsTHashtable< nsBaseHashtableET< KeyClass, DataType > >.
Reimplemented in nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsClassHashtable< KeyClass, T >, nsClassHashtableMT< KeyClass, T >, nsRefPtrHashtable< KeyClass, RefPtr >, nsRefPtrHashtableMT< KeyClass, RefPtr >, nsBaseHashtableMT< struct KeyClass, DataType, DataType >, nsBaseHashtableMT< struct KeyClass, nsAutoPtr< T >, T * >, nsBaseHashtableMT< struct KeyClass, nsRefPtr< RefPtr >, RefPtr * >, nsClassHashtable< nsUint32HashKey, nsMAPISession >, nsClassHashtable< nsStringHashKey, nsCString >, nsClassHashtable< nsVoidPtrHashKey, DConnectInstance >, nsClassHashtable< nsCStringHashKey, EmbedPasswordMgr::SignonHashEntry >, nsClassHashtable< nsISupportsHashKey, nsTArray >, nsClassHashtable< FunctionKey, ProfilerFunction >, nsClassHashtable< nsISupportsHashKey, nsXFormsMDGNode >, nsClassHashtable< nsCStringHashKey, nsPresState >, nsClassHashtable< nsISupportsHashKey, nsCOMArray< nsXULTemplateResultRDF > >, nsClassHashtable< nsUint32HashKey, gfxPangoFontWrapper >, nsClassHashtable< nsVoidPtrHashKey, nsOfflineCacheUpdateService::PendingUpdate >, nsClassHashtable< nsISupportsHashKey, nsString >, nsClassHashtable< nsCharPtrHashKey, nsCOMArray< nsIObserver > >, nsClassHashtable< nsISupportsHashKey, nsXFormsNodeState >, nsClassHashtable< nsHashableHashKey, mozJSComponentLoader::ModuleEntry >, nsClassHashtable< nsStringHashKey, nsCounterList >, nsClassHashtable< nsUint32HashKey, nsCOMArray< nsXULTemplateResultRDF > >, nsClassHashtable< nsDepCharHashKey, CategoryNode >, nsClassHashtable< nsCharPtrHashKey, ProfilerFile >, nsClassHashtable< nsStringHashKey, nsSVGFilterInstance::ImageEntry >, nsClassHashtable< nsStringHashKey, nsRadioGroupStruct >, nsRefPtrHashtable< nsStringHashKey, MacOSFamilyEntry >, nsRefPtrHashtable< nsURIHashKey, nsXULPrototypeDocument >, nsRefPtrHashtable< nsCStringHashKey, nsDownload >, nsRefPtrHashtable< nsISupportsHashKey, nsXFormsControlListItem >, nsRefPtrHashtable< nsISupportsHashKey, nsXMLBindingSet >, nsRefPtrHashtable< nsVoidPtrHashKey, nsThread >, nsRefPtrHashtable< nsISupportsHashKey, RDFBindingSet >, nsRefPtrHashtable< nsISupportsHashKey, gfxASurface >, nsRefPtrHashtable< nsISupportsHashKey, nsXBLBinding >, and nsRefPtrHashtable< nsIDHashKey, ipcTargetData >.
| typedef nsBaseHashtableET<KeyClass,DataType> nsBaseHashtable< KeyClass, DataType, UserDataType >::EntryType |
| typedef PLDHashOperator(* nsBaseHashtable< KeyClass, DataType, UserDataType >::PR_CALLBACK)(KeyType aKey, UserDataType aData, void *userArg) |
| aKey | the key being enumerated | |
| aData | data being enumerated userArg passed unchanged from Enumerate |
Reimplemented from nsTHashtable< nsBaseHashtableET< KeyClass, DataType > >.
| typedef PLDHashOperator(* nsBaseHashtable< KeyClass, DataType, UserDataType >::PR_CALLBACK)(KeyType aKey, DataType &aData, void *userArg) |
| aKey | the key being enumerated | |
| aData | Reference to data being enumerated, may be altered. e.g. for nsInterfaceHashtable this is an nsCOMPtr reference... userArg passed unchanged from Enumerate |
Reimplemented from nsTHashtable< nsBaseHashtableET< KeyClass, DataType > >.
| PRBool nsBaseHashtable< KeyClass, DataType, UserDataType >::Init | ( | PRUint32 | initSize = PL_DHASH_MIN_SIZE |
) | [inline] |
| initSize | the initial number of buckets in the hashtable, default 16 locking on all class methods |
Reimplemented from nsTHashtable< nsBaseHashtableET< KeyClass, DataType > >.
Reimplemented in nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< struct KeyClass, DataType, DataType >, nsBaseHashtableMT< struct KeyClass, nsAutoPtr< T >, T * >, and nsBaseHashtableMT< struct KeyClass, nsRefPtr< RefPtr >, RefPtr * >.
| PRBool nsBaseHashtable< KeyClass, DataType, UserDataType >::IsInitialized | ( | ) | const [inline] |
This function is especially useful for static hashtables.
Reimplemented from nsTHashtable< nsBaseHashtableET< KeyClass, DataType > >.
Reimplemented in nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< struct KeyClass, DataType, DataType >, nsBaseHashtableMT< struct KeyClass, nsAutoPtr< T >, T * >, and nsBaseHashtableMT< struct KeyClass, nsRefPtr< RefPtr >, RefPtr * >.
| PRUint32 nsBaseHashtable< KeyClass, DataType, UserDataType >::Count | ( | ) | const [inline] |
Reimplemented from nsTHashtable< nsBaseHashtableET< KeyClass, DataType > >.
Reimplemented in nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< struct KeyClass, DataType, DataType >, nsBaseHashtableMT< struct KeyClass, nsAutoPtr< T >, T * >, and nsBaseHashtableMT< struct KeyClass, nsRefPtr< RefPtr >, RefPtr * >.
| PRBool nsBaseHashtable< KeyClass, DataType, UserDataType >::Get | ( | KeyType | aKey, | |
| UserDataType * | pData | |||
| ) | const [inline] |
| aKey | the key to retreive | |
| pData | data associated with this key will be placed at this pointer. If you only need to check if the key exists, pData may be null. |
Reimplemented in nsBaseHashtableMT< KeyClass, DataType, UserDataType >.
| PRBool nsBaseHashtable< KeyClass, DataType, UserDataType >::Put | ( | KeyType | aKey, | |
| UserDataType | aData | |||
| ) | [inline] |
| aKey | the key to put | |
| aData | the new data |
Reimplemented in nsBaseHashtableMT< KeyClass, DataType, UserDataType >.
| void nsBaseHashtable< KeyClass, DataType, UserDataType >::Remove | ( | KeyType | aKey | ) | [inline] |
| aKey | the key to remove from the hashtable |
Reimplemented in nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< struct KeyClass, DataType, DataType >, nsBaseHashtableMT< struct KeyClass, nsAutoPtr< T >, T * >, and nsBaseHashtableMT< struct KeyClass, nsRefPtr< RefPtr >, RefPtr * >.
| PRUint32 nsBaseHashtable< KeyClass, DataType, UserDataType >::EnumerateRead | ( | EnumReadFunction | enumFunc, | |
| void * | userArg | |||
| ) | const [inline] |
| enumFunc | enumeration callback | |
| userArg | passed unchanged to the EnumReadFunction |
| PRUint32 nsBaseHashtable< KeyClass, DataType, UserDataType >::Enumerate | ( | EnumFunction | enumFunc, | |
| void * | userArg | |||
| ) | [inline] |
This functions write-locks the hashtable.
| enumFunc | enumeration callback | |
| userArg | passed unchanged to the EnumFunction |
| void nsBaseHashtable< KeyClass, DataType, UserDataType >::Clear | ( | ) | [inline] |
Reimplemented from nsTHashtable< nsBaseHashtableET< KeyClass, DataType > >.
Reimplemented in nsBaseHashtableMT< KeyClass, DataType, UserDataType >, nsBaseHashtableMT< struct KeyClass, DataType, DataType >, nsBaseHashtableMT< struct KeyClass, nsAutoPtr< T >, T * >, and nsBaseHashtableMT< struct KeyClass, nsRefPtr< RefPtr >, RefPtr * >.
| PLDHashOperator nsBaseHashtable< KeyClass, DataType, UserDataType >::s_EnumReadStub | ( | PLDHashTable * | table, | |
| PLDHashEntryHdr * | hdr, | |||
| PRUint32 | number, | |||
| void * | arg | |||
| ) | [inline, static, protected] |
| PLDHashOperator nsBaseHashtable< KeyClass, DataType, UserDataType >::s_EnumStub | ( | PLDHashTable * | table, | |
| PLDHashEntryHdr * | hdr, | |||
| PRUint32 | number, | |||
| void * | arg | |||
| ) | [inline, static, protected] |
Reimplemented from nsTHashtable< nsBaseHashtableET< KeyClass, DataType > >.
1.5.6