Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Member Functions | Private Attributes
CompositeAssertionEnumeratorImpl Class Reference
Inheritance diagram for CompositeAssertionEnumeratorImpl:
Inheritance graph
[legend]
Collaboration diagram for CompositeAssertionEnumeratorImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual nsresult GetEnumerator (nsIRDFDataSource *aDataSource, nsISimpleEnumerator **aResult)
virtual nsresult HasNegation (nsIRDFDataSource *aDataSource, nsIRDFNode *aNode, PRBool *aResult)
virtual void Destroy ()
boolean hasMoreElements ()
 Called to determine whether or not the enumerator has any elements that can be returned via getNext().
nsISupports getNext ()
 Called to retrieve the next element in the enumerator.

Static Public Member Functions

static
CompositeAssertionEnumeratorImpl
Create (nsFixedSizeAllocator &aAllocator, CompositeDataSourceImpl *aCompositeDataSource, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, PRBool aTruthValue, PRBool aAllowNegativeAssertions, PRBool aCoalesceDuplicateArcs)

Protected Member Functions

 CompositeAssertionEnumeratorImpl (CompositeDataSourceImpl *aCompositeDataSource, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, PRBool aTruthValue, PRBool aAllowNegativeAssertions, PRBool aCoalesceDuplicateArcs)
virtual ~CompositeAssertionEnumeratorImpl ()

Protected Attributes

CompositeDataSourceImplmCompositeDataSource
nsISimpleEnumeratormCurrent
nsIRDFNodemResult
PRInt32 mNext
nsAutoVoidArray mAlreadyReturned

Static Private Member Functions

static voidoperator new (size_t) CPP_THROW_NEW
static void operator delete (void *, size_t)

Private Attributes

nsIRDFResourcemSource
nsIRDFResourcemProperty
nsIRDFNodemTarget
PRBool mTruthValue
PRBool mAllowNegativeAssertions
PRBool mCoalesceDuplicateArcs

Detailed Description

Definition at line 483 of file nsCompositeDataSource.cpp.


Constructor & Destructor Documentation

CompositeAssertionEnumeratorImpl::CompositeAssertionEnumeratorImpl ( CompositeDataSourceImpl aCompositeDataSource,
nsIRDFResource aSource,
nsIRDFResource aProperty,
nsIRDFNode aTarget,
PRBool  aTruthValue,
PRBool  aAllowNegativeAssertions,
PRBool  aCoalesceDuplicateArcs 
) [protected]

Definition at line 538 of file nsCompositeDataSource.cpp.

    : CompositeEnumeratorImpl(aCompositeDataSource, aAllowNegativeAssertions, aCoalesceDuplicateArcs),
      mSource(aSource),
      mProperty(aProperty),
      mTarget(aTarget),
      mTruthValue(aTruthValue),
      mAllowNegativeAssertions(aAllowNegativeAssertions),
      mCoalesceDuplicateArcs(aCoalesceDuplicateArcs)
{
    NS_IF_ADDREF(mSource);
    NS_ADDREF(mProperty); // always must be specified
    NS_IF_ADDREF(mTarget);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 559 of file nsCompositeDataSource.cpp.

Here is the caller graph for this function:


Member Function Documentation

static CompositeAssertionEnumeratorImpl* CompositeAssertionEnumeratorImpl::Create ( nsFixedSizeAllocator &  aAllocator,
CompositeDataSourceImpl aCompositeDataSource,
nsIRDFResource aSource,
nsIRDFResource aProperty,
nsIRDFNode aTarget,
PRBool  aTruthValue,
PRBool  aAllowNegativeAssertions,
PRBool  aCoalesceDuplicateArcs 
) [inline, static]

Definition at line 487 of file nsCompositeDataSource.cpp.

                                          {
        void* place = aAllocator.Alloc(sizeof(CompositeAssertionEnumeratorImpl));
        return place
            ? ::new (place) CompositeAssertionEnumeratorImpl(aCompositeDataSource,
                                                             aSource, aProperty, aTarget,
                                                             aTruthValue,
                                                             aAllowNegativeAssertions,
                                                             aCoalesceDuplicateArcs)
            : nsnull; }

Here is the call graph for this function:

Implements CompositeEnumeratorImpl.

Definition at line 596 of file nsCompositeDataSource.cpp.

{
    // Keep the datasource alive for the duration of the stack
    // frame so its allocator stays valid.
    nsCOMPtr<nsIRDFCompositeDataSource> kungFuDeathGrip = mCompositeDataSource;

    nsFixedSizeAllocator& pool = mCompositeDataSource->mAllocator;
    this->~CompositeAssertionEnumeratorImpl();
    pool.Free(this, sizeof(*this));
}

Here is the call graph for this function:

Implements CompositeEnumeratorImpl.

Definition at line 568 of file nsCompositeDataSource.cpp.

{
    if (mSource) {
        return aDataSource->GetTargets(mSource, mProperty, mTruthValue, aResult);
    }
    else {
        return aDataSource->GetSources(mProperty, mTarget, mTruthValue, aResult);
    }
}

Here is the call graph for this function:

nsISupports nsISimpleEnumerator::getNext ( ) [inherited]

Called to retrieve the next element in the enumerator.

The "next" element is the first element upon the first call. Must be pre-ceeded by a call to hasMoreElements() which returns PR_TRUE. This method is generally called within a loop to iterate over the elements in the enumerator.

See also:
hasMoreElements()
Returns:
NS_OK if the call succeeded in returning a non-null value through the out parameter. NS_ERROR_FAILURE if there are no more elements to enumerate.
the next element in the enumeration.

Here is the caller graph for this function:

Called to determine whether or not the enumerator has any elements that can be returned via getNext().

This method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getNext() calls. Does not affect internal state of enumerator.

See also:
getNext()
Returns:
PR_TRUE if there are remaining elements in the enumerator. PR_FALSE if there are no more elements in the enumerator.

Here is the caller graph for this function:

nsresult CompositeAssertionEnumeratorImpl::HasNegation ( nsIRDFDataSource aDataSource,
nsIRDFNode aNode,
PRBool aResult 
) [virtual]

Implements CompositeEnumeratorImpl.

Definition at line 581 of file nsCompositeDataSource.cpp.

{
    if (mSource) {
        return aDataSource->HasAssertion(mSource, mProperty, aNode, !mTruthValue, aResult);
    }
    else {
        nsCOMPtr<nsIRDFResource> source( do_QueryInterface(aNode) );
        return aDataSource->HasAssertion(source, mProperty, mTarget, !mTruthValue, aResult);
    }
}

Here is the call graph for this function:

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

Definition at line 534 of file nsCompositeDataSource.cpp.

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

Definition at line 533 of file nsCompositeDataSource.cpp.

{ return 0; }

Member Data Documentation

Reimplemented from CompositeEnumeratorImpl.

Definition at line 528 of file nsCompositeDataSource.cpp.

nsAutoVoidArray CompositeEnumeratorImpl::mAlreadyReturned [protected, inherited]

Definition at line 175 of file nsCompositeDataSource.cpp.

Reimplemented from CompositeEnumeratorImpl.

Definition at line 529 of file nsCompositeDataSource.cpp.

Definition at line 170 of file nsCompositeDataSource.cpp.

Definition at line 172 of file nsCompositeDataSource.cpp.

PRInt32 CompositeEnumeratorImpl::mNext [protected, inherited]

Definition at line 174 of file nsCompositeDataSource.cpp.

Definition at line 525 of file nsCompositeDataSource.cpp.

Definition at line 173 of file nsCompositeDataSource.cpp.

Definition at line 524 of file nsCompositeDataSource.cpp.

Definition at line 526 of file nsCompositeDataSource.cpp.

Definition at line 527 of file nsCompositeDataSource.cpp.


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