Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
nsTemplateMatchRefSet::ConstIterator Class Reference

An iterator that can be used to enumerate the contents of the set. More...

#include <nsTemplateMatchSet.h>

Collaboration diagram for nsTemplateMatchRefSet::ConstIterator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConstIterator ()
 ConstIterator (const ConstIterator &aConstIterator)
ConstIteratoroperator= (const ConstIterator &aConstIterator)
ConstIteratoroperator++ ()
ConstIterator operator++ (int)
ConstIteratoroperator-- ()
ConstIterator operator-- (int)
nsTemplateMatchoperator* () const
nsTemplateMatchoperator-> () const
PRBool operator== (const ConstIterator &aConstIterator) const
PRBool operator!= (const ConstIterator &aConstIterator) const

Protected Member Functions

void Next ()
void Prev ()
 ConstIterator (const nsTemplateMatchRefSet *aSet, Entry *aTableEntry)
 ConstIterator (const nsTemplateMatchRefSet *aSet, nsTemplateMatch **aInlineEntry)
nsTemplateMatchget () const

Protected Attributes

const nsTemplateMatchRefSetmSet
union {
EntrymTableEntry
nsTemplateMatch ** mInlineEntry
}; 

Friends

class nsTemplateMatchRefSet

Detailed Description

An iterator that can be used to enumerate the contents of the set.

Definition at line 250 of file nsTemplateMatchSet.h.


Constructor & Destructor Documentation

nsTemplateMatchRefSet::ConstIterator::ConstIterator ( const nsTemplateMatchRefSet aSet,
Entry aTableEntry 
) [inline, protected]

Definition at line 257 of file nsTemplateMatchSet.h.

            : mSet(aSet), mTableEntry(aTableEntry) {}

Definition at line 260 of file nsTemplateMatchSet.h.

            : mSet(aSet), mInlineEntry(aInlineEntry) {}

Definition at line 275 of file nsTemplateMatchSet.h.

: mSet(nsnull), mTableEntry(nsnull) {}

Definition at line 277 of file nsTemplateMatchSet.h.

            : mSet(aConstIterator.mSet),
              mTableEntry(aConstIterator.mTableEntry) {}

Member Function Documentation

Definition at line 269 of file nsTemplateMatchSet.h.

                                     {
            return mSet->mStorageElements.mInlineMatches.mCount > PRUint32(kMaxInlineMatches)
                ? mTableEntry->mMatch
                : *mInlineEntry; }

Definition at line 334 of file nsTemplateMatchSet.cpp.

{
    if (mSet->mStorageElements.mInlineMatches.mCount <= kMaxInlineMatches)
        ++mInlineEntry;
    else {
        const PLDHashTable& table = mSet->mStorageElements.mTable;
        Entry* limit = NS_REINTERPRET_CAST(Entry*, table.entryStore);
        limit += PL_DHASH_TABLE_SIZE(&table);
        while (++mTableEntry < limit) {
            if (ENTRY_IS_LIVE(mTableEntry))
                break;
        }
    }
}

Here is the caller graph for this function:

PRBool nsTemplateMatchRefSet::ConstIterator::operator!= ( const ConstIterator aConstIterator) const [inline]

Definition at line 312 of file nsTemplateMatchSet.h.

                                                                     {
            return ! aConstIterator.operator==(*this); }
nsTemplateMatch& nsTemplateMatchRefSet::ConstIterator::operator* ( ) const [inline]

Definition at line 304 of file nsTemplateMatchSet.h.

                                             {
            return *get(); }
ConstIterator& nsTemplateMatchRefSet::ConstIterator::operator++ ( ) [inline]

Definition at line 286 of file nsTemplateMatchSet.h.

                                    {
            Next();
            return *this; }

Here is the call graph for this function:

ConstIterator nsTemplateMatchRefSet::ConstIterator::operator++ ( int  ) [inline]

Definition at line 290 of file nsTemplateMatchSet.h.

                                      {
            ConstIterator result(*this);
            Next();
            return result; }

Here is the call graph for this function:

ConstIterator& nsTemplateMatchRefSet::ConstIterator::operator-- ( ) [inline]

Definition at line 295 of file nsTemplateMatchSet.h.

                                    {
            Prev();
            return *this; }

Here is the call graph for this function:

ConstIterator nsTemplateMatchRefSet::ConstIterator::operator-- ( int  ) [inline]

Definition at line 299 of file nsTemplateMatchSet.h.

                                      {
            ConstIterator result(*this);
            Prev();
            return result; }

Here is the call graph for this function:

nsTemplateMatch* nsTemplateMatchRefSet::ConstIterator::operator-> ( ) const [inline]

Definition at line 307 of file nsTemplateMatchSet.h.

                                              {
            return get(); }
ConstIterator& nsTemplateMatchRefSet::ConstIterator::operator= ( const ConstIterator aConstIterator) [inline]

Definition at line 281 of file nsTemplateMatchSet.h.

                                                                      {
            mSet = aConstIterator.mSet;
            mTableEntry = aConstIterator.mTableEntry;
            return *this; }
PRBool nsTemplateMatchRefSet::ConstIterator::operator== ( const ConstIterator aConstIterator) const

Definition at line 365 of file nsTemplateMatchSet.cpp.

{
    if (mSet != aConstIterator.mSet)
        return PR_FALSE;

    PRUint32 count = mSet->mStorageElements.mInlineMatches.mCount;
    if (count <= kMaxInlineMatches)
        return mInlineEntry == aConstIterator.mInlineEntry;

    return mTableEntry == aConstIterator.mTableEntry;
}

Definition at line 350 of file nsTemplateMatchSet.cpp.

{
    if (mSet->mStorageElements.mInlineMatches.mCount <= kMaxInlineMatches)
        --mInlineEntry;
    else {
        const PLDHashTable& table = mSet->mStorageElements.mTable;
        Entry* limit = NS_REINTERPRET_CAST(Entry*, table.entryStore);
        while (--mTableEntry > limit) {
            if (ENTRY_IS_LIVE(mTableEntry))
                break;
        }
    }
}

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class nsTemplateMatchRefSet [friend]

Definition at line 252 of file nsTemplateMatchSet.h.


Member Data Documentation

union { ... } [protected]

Definition at line 263 of file nsTemplateMatchSet.h.


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