Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes
Instantiation Class Reference

A collection of varible-to-value bindings, with the memory elements that support those bindings. More...

#include <nsRuleNetwork.h>

Collaboration diagram for Instantiation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Instantiation ()
 Instantiation (const Instantiation &aInstantiation)
Instantiationoperator= (const Instantiation &aInstantiation)
 ~Instantiation ()
nsresult AddAssignment (PRInt32 aVariable, const Value &aValue)
 Add the specified variable-to-value assignment to the instantiation's set of assignments.
nsresult AddSupportingElement (MemoryElement *aMemoryElement)
 Add a memory element to the set of memory elements that are supporting the instantiation.
PRBool Equals (const Instantiation &aInstantiation) const
PRBool operator== (const Instantiation &aInstantiation) const
PRBool operator!= (const Instantiation &aInstantiation) const

Static Public Member Functions

static PLHashNumber Hash (const void *aKey)
static PRIntn Compare (const void *aLeft, const void *aRight)

Public Attributes

nsAssignmentSet mAssignments
 The variable-to-value bindings.
MemoryElementSet mSupport
 The memory elements that support the bindings.

Detailed Description

A collection of varible-to-value bindings, with the memory elements that support those bindings.

An instantiation object is typically created by "extending" another instantiation object. That is, using the copy constructor, and adding bindings and support to the instantiation.

Definition at line 584 of file nsRuleNetwork.h.


Constructor & Destructor Documentation

Definition at line 597 of file nsRuleNetwork.h.

Instantiation::Instantiation ( const Instantiation aInstantiation) [inline]

Definition at line 599 of file nsRuleNetwork.h.

        : mAssignments(aInstantiation.mAssignments),
          mSupport(aInstantiation.mSupport) {
        MOZ_COUNT_CTOR(Instantiation); }

Definition at line 609 of file nsRuleNetwork.h.


Member Function Documentation

nsresult Instantiation::AddAssignment ( PRInt32  aVariable,
const Value aValue 
) [inline]

Add the specified variable-to-value assignment to the instantiation's set of assignments.

Parameters:
aVariablethe variable to which is being assigned
aValuethe value that is being assigned
Returns:
NS_OK if no errors, NS_ERROR_OUT_OF_MEMORY if there is not enough memory to perform the operation

Definition at line 619 of file nsRuleNetwork.h.

                                                                   {
        mAssignments.Add(nsAssignment(aVariable, aValue));
        return NS_OK; }

Here is the call graph for this function:

Here is the caller graph for this function:

Add a memory element to the set of memory elements that are supporting the instantiation.

Parameters:
aMemoryElementthe memory element to add to the instantiation's set of support
Returns:
NS_OK if no errors occurred, NS_ERROR_OUT_OF_MEMORY if there is not enough memory to perform the operation.

Definition at line 631 of file nsRuleNetwork.h.

                                                                 {
        mSupport.Add(aMemoryElement);
        return NS_OK; }

Here is the call graph for this function:

Here is the caller graph for this function:

PRIntn Instantiation::Compare ( const void aLeft,
const void aRight 
) [static]

Definition at line 647 of file nsRuleNetwork.cpp.

{
    const Instantiation* left  = NS_STATIC_CAST(const Instantiation*, aLeft);
    const Instantiation* right = NS_STATIC_CAST(const Instantiation*, aRight);

    return *left == *right;
}
PRBool Instantiation::Equals ( const Instantiation aInstantiation) const [inline]

Definition at line 635 of file nsRuleNetwork.h.

                                                             {
        return mAssignments == aInstantiation.mAssignments; }

Here is the caller graph for this function:

Definition at line 632 of file nsRuleNetwork.cpp.

{
    const Instantiation* inst = NS_STATIC_CAST(const Instantiation*, aKey);

    PLHashNumber result = 0;

    nsAssignmentSet::ConstIterator last = inst->mAssignments.Last();
    for (nsAssignmentSet::ConstIterator assignment = inst->mAssignments.First(); assignment != last; ++assignment)
        result ^= assignment->Hash();

    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool Instantiation::operator!= ( const Instantiation aInstantiation) const [inline]

Definition at line 641 of file nsRuleNetwork.h.

                                                                 {
        return !Equals(aInstantiation); }

Here is the call graph for this function:

Instantiation& Instantiation::operator= ( const Instantiation aInstantiation) [inline]

Definition at line 604 of file nsRuleNetwork.h.

                                                                  {
        mAssignments = aInstantiation.mAssignments;
        mSupport  = aInstantiation.mSupport;
        return *this; }
PRBool Instantiation::operator== ( const Instantiation aInstantiation) const [inline]

Definition at line 638 of file nsRuleNetwork.h.

                                                                 {
        return Equals(aInstantiation); }

Here is the call graph for this function:


Member Data Documentation

The variable-to-value bindings.

Definition at line 590 of file nsRuleNetwork.h.

The memory elements that support the bindings.

Definition at line 595 of file nsRuleNetwork.h.


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