Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
AtomHashTable Class Reference
Collaboration diagram for AtomHashTable:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AtomHashTable ()
 ~AtomHashTable ()
const voidGet (nsIAtom *aKey)
 Get the data associated with a Atom.
const voidPut (nsIAtom *aKey, const void *aValue)
 Create an association between a Atom and some data.
const voidRemove (nsIAtom *aKey)
 Remove an association between a Atom and it's data.

Protected Attributes

PLHashTablemTable

Detailed Description

Definition at line 94 of file nsWebCrawler.cpp.


Constructor & Destructor Documentation

Definition at line 107 of file nsWebCrawler.cpp.

Here is the call graph for this function:

Definition at line 122 of file nsWebCrawler.cpp.

Here is the call graph for this function:


Member Function Documentation

Get the data associated with a Atom.

Definition at line 132 of file nsWebCrawler.cpp.

{
  PRInt32 hashCode = NS_PTR_TO_INT32(aKey);
  PLHashEntry** hep = PL_HashTableRawLookup(mTable, hashCode, aKey);
  PLHashEntry* he = *hep;
  if (nsnull != he) {
    return he->value;
  }
  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const void * AtomHashTable::Put ( nsIAtom aKey,
const void aData 
)

Create an association between a Atom and some data.

This call returns an old association if there was one (or nsnull if there wasn't).

Definition at line 149 of file nsWebCrawler.cpp.

{
  PRInt32 hashCode = NS_PTR_TO_INT32(aKey);
  PLHashEntry** hep = PL_HashTableRawLookup(mTable, hashCode, aKey);
  PLHashEntry* he = *hep;
  if (nsnull != he) {
    const void* oldValue = he->value;
    he->value = NS_CONST_CAST(void*, aData);
    return oldValue;
  }
  NS_ADDREF(aKey);
  PL_HashTableRawAdd(mTable, hep, hashCode, aKey, NS_CONST_CAST(void*, aData));
  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Remove an association between a Atom and it's data.

This returns the old associated data.

Definition at line 169 of file nsWebCrawler.cpp.

{
  PRInt32 hashCode = NS_PTR_TO_INT32(aKey);
  PLHashEntry** hep = PL_HashTableRawLookup(mTable, hashCode, aKey);
  PLHashEntry* he = *hep;
  void* oldValue = nsnull;
  if (nsnull != he) {
    oldValue = he->value;
    PL_HashTableRawRemove(mTable, hep, he);
  }
  return oldValue;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 104 of file nsWebCrawler.cpp.


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