Dillo
Classes | Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
lout::container::untyped::Stack Class Reference

A stack (LIFO). Can be used as Queue (FIFO) when pushUnder() is used instead of push(). More...

#include <container.hh>

Classes

class  Node
 
class  StackIterator
 

Public Member Functions

 Stack (bool ownerOfObjects)
 
 ~Stack ()
 
int size ()
 
void push (object::Object *object)
 
void pushUnder (object::Object *object)
 
object::ObjectgetTop () const
 
void pop ()
 
int size () const
 
- Public Member Functions inherited from lout::container::untyped::Collection
void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer. More...
 
Iterator iterator ()
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More...
 
virtual bool equals (Object *other)
 Returns, whether two objects are equal. More...
 
virtual int hashValue ()
 Return a hash value for the object. More...
 
virtual Objectclone ()
 Return an exact copy of the object. More...
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object. More...
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses. More...
 

Protected Member Functions

AbstractIteratorcreateIterator ()
 

Private Attributes

Nodebottom
 
Nodetop
 
bool ownerOfObjects
 
int numElements
 

Friends

class StackIterator
 

Detailed Description

A stack (LIFO). Can be used as Queue (FIFO) when pushUnder() is used instead of push().

Note that the iterator returns all elements in the reversed order they have been put on the stack.

Constructor & Destructor Documentation

lout::container::untyped::Stack::Stack ( bool  ownerOfObjects)

References bottom, numElements, ownerOfObjects, and top.

lout::container::untyped::Stack::~Stack ( )

References pop(), and top.

Member Function Documentation

Collection0::AbstractIterator * lout::container::untyped::Stack::createIterator ( )
protectedvirtual
object::Object* lout::container::untyped::Stack::getTop ( ) const
inline
void lout::container::untyped::Stack::pop ( )
void lout::container::untyped::Stack::push ( object::Object object)
void lout::container::untyped::Stack::pushUnder ( object::Object object)
int lout::container::untyped::Stack::size ( )
virtual
int lout::container::untyped::Stack::size ( ) const
inline

References numElements.

Friends And Related Function Documentation

friend class StackIterator
friend

Referenced by createIterator().

Member Data Documentation

Node* lout::container::untyped::Stack::bottom
private

Referenced by pop(), push(), pushUnder(), and Stack().

int lout::container::untyped::Stack::numElements
private

Referenced by pop(), push(), pushUnder(), size(), and Stack().

bool lout::container::untyped::Stack::ownerOfObjects
private

Referenced by pop(), and Stack().

Node * lout::container::untyped::Stack::top
private

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