Back to index

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

List of all members.

Public Member Functions

 ContainerEnumeratorImpl (nsIRDFDataSource *ds, nsIRDFResource *container)
virtual ~ContainerEnumeratorImpl ()
nsresult Init ()
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.

Private Attributes

nsCOMPtr< nsIRDFDataSourcemDataSource
nsCOMPtr< nsIRDFResourcemContainer
nsCOMPtr< nsIRDFResourcemOrdinalProperty
nsCOMPtr< nsISimpleEnumeratormCurrent
nsCOMPtr< nsIRDFNodemResult
PRInt32 mNextIndex

Static Private Attributes

static nsrefcnt gRefCnt
static nsIRDFResourcekRDF_nextVal
static nsIRDFContainerUtilsgRDFC

Detailed Description

Definition at line 77 of file nsContainerEnumerator.cpp.


Constructor & Destructor Documentation

Definition at line 107 of file nsContainerEnumerator.cpp.

    : mDataSource(aDataSource),
      mContainer(aContainer),
      mNextIndex(1)
{
}

Definition at line 137 of file nsContainerEnumerator.cpp.


Member Function Documentation

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:

Definition at line 116 of file nsContainerEnumerator.cpp.

{
    if (gRefCnt++ == 0) {
        nsresult rv;
        nsCOMPtr<nsIRDFService> rdf = do_GetService(kRDFServiceCID);
        NS_ASSERTION(rdf != nsnull, "unable to acquire resource manager");
        if (! rdf)
            return NS_ERROR_FAILURE;

        rv = rdf->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "nextVal"), &kRDF_nextVal);
        NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");
        if (NS_FAILED(rv)) return rv;

        rv = CallGetService(kRDFContainerUtilsCID, &gRDFC);
        if (NS_FAILED(rv)) return rv;
    }

    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 82 of file nsContainerEnumerator.cpp.

Definition at line 80 of file nsContainerEnumerator.cpp.

Definition at line 81 of file nsContainerEnumerator.cpp.

Definition at line 85 of file nsContainerEnumerator.cpp.

Definition at line 88 of file nsContainerEnumerator.cpp.

Definition at line 84 of file nsContainerEnumerator.cpp.

Definition at line 90 of file nsContainerEnumerator.cpp.

Definition at line 86 of file nsContainerEnumerator.cpp.

Definition at line 89 of file nsContainerEnumerator.cpp.


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