Public Types | Public Member Functions

nsRefPtrHashtable< KeyClass, RefPtr > Class Template Reference

templated hashtable class maps keys to reference pointers. More...

#include <nsRefPtrHashtable.h>

Inheritance diagram for nsRefPtrHashtable< KeyClass, RefPtr >:
Collaboration diagram for nsRefPtrHashtable< KeyClass, RefPtr >:

List of all members.

Public Types

typedef KeyClass::KeyType KeyType
 KeyType is typedef'ed for ease of use.
typedef RefPtr * UserDataType

Public Member Functions

PRBool Get (KeyType aKey, UserDataType *pData) const
RefPtr * GetWeak (KeyType aKey, PRBool *aFound=0) const
 Gets a weak reference to the hashtable entry.

Detailed Description

template<class KeyClass, class RefPtr>
class nsRefPtrHashtable< KeyClass, RefPtr >

templated hashtable class maps keys to reference pointers.

See nsBaseHashtable for complete declaration.

Parameters:
KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h for a complete specification.
RefPtr the reference-type being wrapped
See also:
nsDataHashtable, nsClassHashtable

Member Typedef Documentation

template<class KeyClass, class RefPtr>
typedef KeyClass::KeyType nsRefPtrHashtable< KeyClass, RefPtr >::KeyType

KeyType is typedef'ed for ease of use.

Reimplemented from nsBaseHashtable< KeyClass, nsRefPtr< RefPtr >, RefPtr * >.

template<class KeyClass, class RefPtr>
typedef RefPtr* nsRefPtrHashtable< KeyClass, RefPtr >::UserDataType

Member Function Documentation

template<class KeyClass , class RefPtr >
PRBool nsRefPtrHashtable< KeyClass, RefPtr >::Get ( KeyType  aKey,
UserDataType pData 
) const

retrieve the value for a key.

Parameters:
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.
Returns:
PR_TRUE if the key exists. If key does not exist, pData is not modified.
Parameters:
pData This is an XPCOM getter, so pData is already_addrefed. If the key doesn't exist, pData will be set to nsnull.
template<class KeyClass , class RefPtr >
RefPtr * nsRefPtrHashtable< KeyClass, RefPtr >::GetWeak ( KeyType  aKey,
PRBool aFound = 0 
) const

Gets a weak reference to the hashtable entry.

Parameters:
aFound If not nsnull, will be set to PR_TRUE if the entry is found, to PR_FALSE otherwise.
Returns:
The entry, or nsnull if not found. Do not release this pointer!

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