Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
TokenEnumeration Class Reference

Helper class to enumerate Token objects in a PLDHashTable safely and without copying (see bugzilla #174859). More...

#include <nsBayesianFilter.h>

List of all members.

Public Member Functions

 TokenEnumeration (PLDHashTable *table)
PRBool hasMoreTokens ()
TokennextToken ()

Private Attributes

PRUint32 mEntrySize
PRUint32 mEntryCount
PRUint32 mEntryOffset
char * mEntryAddr
char * mEntryLimit

Detailed Description

Helper class to enumerate Token objects in a PLDHashTable safely and without copying (see bugzilla #174859).

The enumeration is safe to use until a PL_DHASH_ADD or PL_DHASH_REMOVE is performed on the table.

Definition at line 67 of file nsBayesianFilter.h.


Constructor & Destructor Documentation


Member Function Documentation

Definition at line 123 of file nsBayesianFilter.cpp.

{
    return (mEntryOffset < mEntryCount);
}

Here is the caller graph for this function:

Definition at line 128 of file nsBayesianFilter.cpp.

{
    Token* token = NULL;
    PRUint32 entrySize = mEntrySize;
    char *entryAddr = mEntryAddr, *entryLimit = mEntryLimit;
    while (entryAddr < entryLimit) {
        PLDHashEntryHdr* entry = (PLDHashEntryHdr*) entryAddr;
        entryAddr += entrySize;
        if (PL_DHASH_ENTRY_IS_LIVE(entry)) {
            token = NS_STATIC_CAST(Token*, entry);
            ++mEntryOffset;
            break;
        }
    }
    mEntryAddr = entryAddr;
    return token;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 75 of file nsBayesianFilter.h.

Definition at line 74 of file nsBayesianFilter.h.

Definition at line 75 of file nsBayesianFilter.h.

Definition at line 74 of file nsBayesianFilter.h.

Definition at line 74 of file nsBayesianFilter.h.


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