Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Protected Attributes | Friends
InstantiationSet Class Reference

A collection of intantiations. More...

#include <nsRuleNetwork.h>

Collaboration diagram for InstantiationSet:
Collaboration graph
[legend]

List of all members.

Classes

class  ConstIterator
class  Iterator
class  List

Public Member Functions

 InstantiationSet ()
 InstantiationSet (const InstantiationSet &aInstantiationSet)
InstantiationSetoperator= (const InstantiationSet &aInstantiationSet)
 ~InstantiationSet ()
ConstIterator First () const
ConstIterator Last () const
Iterator First ()
Iterator Last ()
PRBool Empty () const
Iterator Append (const Instantiation &aInstantiation)
Iterator Insert (Iterator aBefore, const Instantiation &aInstantiation)
Iterator Erase (Iterator aElement)
void Clear ()
PRBool HasAssignmentFor (PRInt32 aVariable) const

Protected Attributes

List mHead

Friends

class ConstIterator
class Iterator

Detailed Description

A collection of intantiations.

Definition at line 654 of file nsRuleNetwork.h.


Constructor & Destructor Documentation

Definition at line 661 of file nsRuleNetwork.cpp.

Definition at line 668 of file nsRuleNetwork.cpp.

{
    mHead.mPrev = mHead.mNext = &mHead;

    // XXX replace with copy-on-write foo
    ConstIterator last = aInstantiationSet.Last();
    for (ConstIterator inst = aInstantiationSet.First(); inst != last; ++inst)
        Append(*inst);

    MOZ_COUNT_CTOR(InstantiationSet);
}

Here is the call graph for this function:

Definition at line 661 of file nsRuleNetwork.h.

Here is the call graph for this function:


Member Function Documentation

Iterator InstantiationSet::Append ( const Instantiation aInstantiation) [inline]

Definition at line 776 of file nsRuleNetwork.h.

                                                         {
        return Insert(Last(), aInstantiation); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 695 of file nsRuleNetwork.cpp.

{
    Iterator inst = First();
    while (inst != Last())
        Erase(inst++);
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool InstantiationSet::Empty ( ) const [inline]

Definition at line 774 of file nsRuleNetwork.h.

{ return First() == Last(); }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 721 of file nsRuleNetwork.cpp.

{
    Iterator result = aIterator;
    ++result;
    aIterator.mCurrent->mNext->mPrev = aIterator.mCurrent->mPrev;
    aIterator.mCurrent->mPrev->mNext = aIterator.mCurrent->mNext;
    delete aIterator.mCurrent;
    return result;
}

Here is the caller graph for this function:

Definition at line 731 of file nsRuleNetwork.h.

{ return ConstIterator(mHead.mNext); }

Here is the caller graph for this function:

Definition at line 771 of file nsRuleNetwork.h.

{ return Iterator(mHead.mNext); }

Definition at line 733 of file nsRuleNetwork.cpp.

{
    return !Empty() ? First()->mAssignments.HasAssignmentFor(aVariable) : PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 704 of file nsRuleNetwork.cpp.

{
    List* newelement = new List();
    if (newelement) {
        newelement->mInstantiation = aInstantiation;

        aIterator.mCurrent->mPrev->mNext = newelement;

        newelement->mNext = aIterator.mCurrent;
        newelement->mPrev = aIterator.mCurrent->mPrev;

        aIterator.mCurrent->mPrev = newelement;
    }
    return aIterator;
}

Here is the caller graph for this function:

Definition at line 732 of file nsRuleNetwork.h.

Here is the caller graph for this function:

Definition at line 772 of file nsRuleNetwork.h.

{ return Iterator(&mHead); }
InstantiationSet & InstantiationSet::operator= ( const InstantiationSet aInstantiationSet)

Definition at line 681 of file nsRuleNetwork.cpp.

{
    // XXX replace with copy-on-write foo
    Clear();

    ConstIterator last = aInstantiationSet.Last();
    for (ConstIterator inst = aInstantiationSet.First(); inst != last; ++inst)
        Append(*inst);

    return *this;
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class ConstIterator [friend]

Definition at line 665 of file nsRuleNetwork.h.

friend class Iterator [friend]

Definition at line 668 of file nsRuleNetwork.h.


Member Data Documentation

Definition at line 682 of file nsRuleNetwork.h.


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