Back to index

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

List of all members.

Public Types

enum  Type { eArcsIn, eArcsOut }

Public Member Functions

virtual ~CompositeArcsInOutEnumeratorImpl ()
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
CompositeArcsInOutEnumeratorImpl
Create (nsFixedSizeAllocator &aAllocator, CompositeDataSourceImpl *aCompositeDataSource, nsIRDFNode *aNode, Type aType, PRBool aAllowNegativeAssertions, PRBool aCoalesceDuplicateArcs)

Protected Member Functions

 CompositeArcsInOutEnumeratorImpl (CompositeDataSourceImpl *aCompositeDataSource, nsIRDFNode *aNode, Type aType, PRBool aAllowNegativeAssertions, PRBool aCoalesceDuplicateArcs)

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

nsIRDFNodemNode
Type mType
PRBool mAllowNegativeAssertions
PRBool mCoalesceDuplicateArcs

Detailed Description

Definition at line 370 of file nsCompositeDataSource.cpp.


Member Enumeration Documentation

Enumerator:
eArcsIn 
eArcsOut 

Definition at line 373 of file nsCompositeDataSource.cpp.


Constructor & Destructor Documentation

Definition at line 435 of file nsCompositeDataSource.cpp.

Here is the caller graph for this function:

CompositeArcsInOutEnumeratorImpl::CompositeArcsInOutEnumeratorImpl ( CompositeDataSourceImpl aCompositeDataSource,
nsIRDFNode aNode,
Type  aType,
PRBool  aAllowNegativeAssertions,
PRBool  aCoalesceDuplicateArcs 
) [protected]

Definition at line 420 of file nsCompositeDataSource.cpp.

    : CompositeEnumeratorImpl(aCompositeDataSource, aAllowNegativeAssertions, aCoalesceDuplicateArcs),
      mNode(aNode),
      mType(aType),
      mAllowNegativeAssertions(aAllowNegativeAssertions),
      mCoalesceDuplicateArcs(aCoalesceDuplicateArcs)
{
    NS_ADDREF(mNode);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

static CompositeArcsInOutEnumeratorImpl* CompositeArcsInOutEnumeratorImpl::Create ( nsFixedSizeAllocator &  aAllocator,
CompositeDataSourceImpl aCompositeDataSource,
nsIRDFNode aNode,
Type  aType,
PRBool  aAllowNegativeAssertions,
PRBool  aCoalesceDuplicateArcs 
) [inline, static]

Definition at line 376 of file nsCompositeDataSource.cpp.

                                          {
        void* place = aAllocator.Alloc(sizeof(CompositeArcsInOutEnumeratorImpl));
        return place
            ? ::new (place) CompositeArcsInOutEnumeratorImpl(aCompositeDataSource,
                                                             aNode, aType,
                                                             aAllowNegativeAssertions,
                                                             aCoalesceDuplicateArcs)
            : nsnull; }

Here is the call graph for this function:

Implements CompositeEnumeratorImpl.

Definition at line 466 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->~CompositeArcsInOutEnumeratorImpl();
    pool.Free(this, sizeof(*this));
}

Here is the call graph for this function:

Implements CompositeEnumeratorImpl.

Definition at line 442 of file nsCompositeDataSource.cpp.

{
    if (mType == eArcsIn) {
        return aDataSource->ArcLabelsIn(mNode, aResult);
    }
    else {
        nsCOMPtr<nsIRDFResource> resource( do_QueryInterface(mNode) );
        return aDataSource->ArcLabelsOut(resource, 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 CompositeArcsInOutEnumeratorImpl::HasNegation ( nsIRDFDataSource aDataSource,
nsIRDFNode aNode,
PRBool aResult 
) [virtual]

Implements CompositeEnumeratorImpl.

Definition at line 456 of file nsCompositeDataSource.cpp.

{
    *aResult = PR_FALSE;
    return NS_OK;
}
static void CompositeArcsInOutEnumeratorImpl::operator delete ( void ,
size_t   
) [inline, static, private]

Definition at line 416 of file nsCompositeDataSource.cpp.

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

Definition at line 415 of file nsCompositeDataSource.cpp.

{ return 0; }

Member Data Documentation

Reimplemented from CompositeEnumeratorImpl.

Definition at line 410 of file nsCompositeDataSource.cpp.

nsAutoVoidArray CompositeEnumeratorImpl::mAlreadyReturned [protected, inherited]

Definition at line 175 of file nsCompositeDataSource.cpp.

Reimplemented from CompositeEnumeratorImpl.

Definition at line 411 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 408 of file nsCompositeDataSource.cpp.

Definition at line 173 of file nsCompositeDataSource.cpp.

Definition at line 409 of file nsCompositeDataSource.cpp.


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