Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
nsTemplateMatch Class Reference

#include <nsTemplateMatch.h>

Collaboration diagram for nsTemplateMatch:
Collaboration graph
[legend]

List of all members.

Public Member Functions

PRBool operator== (const nsTemplateMatch &aMatch) const
PRBool operator!= (const nsTemplateMatch &aMatch) const
PRBool GetAssignmentFor (nsConflictSet &aConflictSet, PRInt32 aVariable, Value *aValue)
 Get the assignment for the specified variable, computing the value using the rule's bindings, if necessary.
PRInt32 AddRef ()
PRInt32 Release (nsFixedSizeAllocator &aPool)

Static Public Member Functions

static nsTemplateMatchCreate (nsFixedSizeAllocator &aPool, const nsTemplateRule *aRule, const Instantiation &aInstantiation, const nsAssignmentSet &aAssignments)
static void Destroy (nsFixedSizeAllocator &aPool, nsTemplateMatch *aMatch)

Public Attributes

const nsTemplateRulemRule
 The rule that this match applies for.
Instantiation mInstantiation
 The fully bound instantiation (variable-to-value assignments, with memory element support) that match the rule's conditions.
nsAssignmentSet mAssignments
 Any additional assignments that apply because of the rule's bindings.
nsResourceSet mBindingDependencies
 The set of resources that the nsTemplateMatch's bindings depend on.

Protected Member Functions

 nsTemplateMatch (const nsTemplateRule *aRule, const Instantiation &aInstantiation, const nsAssignmentSet &aAssignments)

Protected Attributes

PRInt32 mRefCnt

Private Member Functions

voidoperator new (size_t) CPP_THROW_NEW
void operator delete (void *, size_t)
 nsTemplateMatch (const nsTemplateMatch &aMatch)
void operator= (const nsTemplateMatch &aMatch)

Detailed Description

Definition at line 60 of file nsTemplateMatch.h.


Constructor & Destructor Documentation

nsTemplateMatch::nsTemplateMatch ( const nsTemplateRule aRule,
const Instantiation aInstantiation,
const nsAssignmentSet aAssignments 
) [inline, protected]

Definition at line 70 of file nsTemplateMatch.h.

        : mRefCnt(0),
          mRule(aRule),
          mInstantiation(aInstantiation),
          mAssignments(aAssignments) {}

Here is the caller graph for this function:


Member Function Documentation

Definition at line 135 of file nsTemplateMatch.h.

                     {
        ++mRefCnt;
        NS_LOG_ADDREF(this, mRefCnt, "nsTemplateMatch", sizeof(*this));
        return mRefCnt; }

Here is the caller graph for this function:

static nsTemplateMatch* nsTemplateMatch::Create ( nsFixedSizeAllocator &  aPool,
const nsTemplateRule aRule,
const Instantiation aInstantiation,
const nsAssignmentSet aAssignments 
) [inline, static]

Definition at line 80 of file nsTemplateMatch.h.

                                                {
        void* place = aPool.Alloc(sizeof(nsTemplateMatch));
        return place ? ::new (place) nsTemplateMatch(aRule, aInstantiation, aAssignments) : nsnull; }

Here is the call graph for this function:

static void nsTemplateMatch::Destroy ( nsFixedSizeAllocator &  aPool,
nsTemplateMatch aMatch 
) [inline, static]

Definition at line 88 of file nsTemplateMatch.h.

                                                                  {
        aMatch->~nsTemplateMatch();
        aPool.Free(aMatch, sizeof(*aMatch)); }

Here is the caller graph for this function:

PRBool nsTemplateMatch::GetAssignmentFor ( nsConflictSet aConflictSet,
PRInt32  aVariable,
Value aValue 
)

Get the assignment for the specified variable, computing the value using the rule's bindings, if necessary.

Parameters:
aConflictSet
aVariablethe variable for which to determine the assignment
aValuean out parameter that receives the value assigned to aVariable.
Returns:
PR_TRUE if aVariable has an assignment, PR_FALSE otherwise.

Definition at line 48 of file nsTemplateMatch.cpp.

{
    if (mAssignments.GetAssignmentFor(aVariable, aValue)) {
        return PR_TRUE;
    }
    else {
        return mRule->ComputeAssignmentFor(aConflictSet, this, aVariable, aValue);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsTemplateMatch::operator delete ( void ,
size_t   
) [inline, private]

Definition at line 65 of file nsTemplateMatch.h.

{}
void* nsTemplateMatch::operator new ( size_t  ) [inline, private]

Definition at line 64 of file nsTemplateMatch.h.

{ return 0; }
PRBool nsTemplateMatch::operator!= ( const nsTemplateMatch aMatch) const [inline]

Definition at line 95 of file nsTemplateMatch.h.

                                                           {
        return !(*this == aMatch); }
void nsTemplateMatch::operator= ( const nsTemplateMatch aMatch) [private]
PRBool nsTemplateMatch::operator== ( const nsTemplateMatch aMatch) const [inline]

Definition at line 92 of file nsTemplateMatch.h.

                                                           {
        return mRule == aMatch.mRule && mInstantiation == aMatch.mInstantiation; }
PRInt32 nsTemplateMatch::Release ( nsFixedSizeAllocator &  aPool) [inline]

Definition at line 140 of file nsTemplateMatch.h.

                                                 {
        NS_PRECONDITION(mRefCnt > 0, "bad refcnt");
        PRInt32 refcnt = --mRefCnt;
        NS_LOG_RELEASE(this, mRefCnt, "nsTemplateMatch");
        if (refcnt == 0)
            Destroy(aPool, this);
        return refcnt; }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Any additional assignments that apply because of the rule's bindings.

These are computed lazily.

Definition at line 124 of file nsTemplateMatch.h.

The set of resources that the nsTemplateMatch's bindings depend on.

Should the assertions relating to these resources change, then the rule will still match (i.e., this match object is still "good"); however, we may need to recompute the assignments that have been made using the rule's bindings.

Definition at line 133 of file nsTemplateMatch.h.

The fully bound instantiation (variable-to-value assignments, with memory element support) that match the rule's conditions.

Definition at line 118 of file nsTemplateMatch.h.

Definition at line 68 of file nsTemplateMatch.h.

The rule that this match applies for.

Definition at line 112 of file nsTemplateMatch.h.


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