Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Friends
txStack Class Reference

#include <txStack.h>

List of all members.

Public Member Functions

voidpeek ()
 Returns the specified object from the top of this stack, without removing it from the stack.
nsresult push (void *aObject)
 Adds the specified object to the top of this stack.
voidpop ()
 Removes and returns the specified object from the top of this stack.
PRBool isEmpty ()
 Returns true if there are no objects in the stack.
PRInt32 size ()
 Returns the number of elements in the Stack.

Friends

class txStackIterator

Detailed Description

Definition at line 44 of file txStack.h.


Member Function Documentation

PRBool txStack::isEmpty ( ) [inline]

Returns true if there are no objects in the stack.

Returns:
true if there are no objects in the stack.

Definition at line 91 of file txStack.h.

    {
        return (Count() <= 0);
    }

Here is the caller graph for this function:

void* txStack::peek ( ) [inline]

Returns the specified object from the top of this stack, without removing it from the stack.

Returns:
a pointer to the object that is the top of this stack.

Definition at line 53 of file txStack.h.

    {
        NS_ASSERTION(!isEmpty(), "peeking at empty stack");
        return ElementAt(Count() - 1);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void* txStack::pop ( ) [inline]

Removes and returns the specified object from the top of this stack.

Returns:
a pointer to the object that was the top of this stack.

Definition at line 77 of file txStack.h.

    {
        NS_ASSERTION(!isEmpty(), "popping from empty stack");
        const PRInt32 count = Count() - 1;
        void* object = ElementAt(count);
        RemoveElementsAt(count, 1);
        return object;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult txStack::push ( void aObject) [inline]

Adds the specified object to the top of this stack.

Parameters:
obja pointer to the object that is to be added to the top of this stack.

Definition at line 65 of file txStack.h.

    {
        return InsertElementAt(aObject, Count()) ? NS_OK :
                                                   NS_ERROR_OUT_OF_MEMORY;
    }

Here is the caller graph for this function:

PRInt32 txStack::size ( ) [inline]

Returns the number of elements in the Stack.

Returns:
the number of elements in the Stack.

Definition at line 101 of file txStack.h.

    {
        return Count();
    }

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class txStackIterator [friend]

Definition at line 107 of file txStack.h.


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