Back to index

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

A collection of nodes in the rule network. More...

#include <nsRuleNetwork.h>

Collaboration diagram for ReteNodeSet:
Collaboration graph
[legend]

List of all members.

Classes

class  ConstIterator
class  Iterator

Public Member Functions

 ReteNodeSet ()
 ~ReteNodeSet ()
nsresult Add (ReteNode *aNode)
nsresult Clear ()
ConstIterator First () const
ConstIterator Last () const
Iterator First ()
Iterator Last ()

Protected Attributes

ReteNode ** mNodes
PRInt32 mCount
PRInt32 mCapacity

Detailed Description

A collection of nodes in the rule network.

Definition at line 830 of file nsRuleNetwork.h.


Constructor & Destructor Documentation

Definition at line 1114 of file nsRuleNetwork.cpp.

    : mNodes(nsnull), mCount(0), mCapacity(0)
{
}

Definition at line 1119 of file nsRuleNetwork.cpp.

{
    Clear();
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 1125 of file nsRuleNetwork.cpp.

{
    NS_PRECONDITION(aNode != nsnull, "null ptr");
    if (! aNode)
        return NS_ERROR_NULL_POINTER;

    if (mCount >= mCapacity) {
        PRInt32 capacity = mCapacity + 4;
        ReteNode** nodes = new ReteNode*[capacity];
        if (! nodes)
            return NS_ERROR_OUT_OF_MEMORY;

        for (PRInt32 i = mCount - 1; i >= 0; --i)
            nodes[i] = mNodes[i];

        delete[] mNodes;

        mNodes = nodes;
        mCapacity = capacity;
    }

    mNodes[mCount++] = aNode;
    return NS_OK;
}

Here is the caller graph for this function:

Definition at line 1151 of file nsRuleNetwork.cpp.

{
    delete[] mNodes;
    mNodes = nsnull;
    mCount = mCapacity = 0;
    return NS_OK;
}

Here is the caller graph for this function:

ConstIterator ReteNodeSet::First ( ) const [inline]

Definition at line 878 of file nsRuleNetwork.h.

{ return ConstIterator(mNodes); }

Here is the caller graph for this function:

Definition at line 907 of file nsRuleNetwork.h.

{ return Iterator(mNodes); }

Here is the call graph for this function:

ConstIterator ReteNodeSet::Last ( ) const [inline]

Definition at line 879 of file nsRuleNetwork.h.

{ return ConstIterator(mNodes + mCount); }

Here is the caller graph for this function:

Definition at line 908 of file nsRuleNetwork.h.

{ return Iterator(mNodes + mCount); }

Here is the call graph for this function:


Member Data Documentation

Definition at line 913 of file nsRuleNetwork.h.

Definition at line 912 of file nsRuleNetwork.h.

Definition at line 911 of file nsRuleNetwork.h.


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