Dillo
|
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::Object * | getTop () 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 Object * | clone () |
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 | |
AbstractIterator * | createIterator () |
Private Attributes | |
Node * | bottom |
Node * | top |
bool | ownerOfObjects |
int | numElements |
Friends | |
class | StackIterator |
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.
lout::container::untyped::Stack::Stack | ( | bool | ownerOfObjects | ) |
References bottom, numElements, ownerOfObjects, and top.
|
protectedvirtual |
Implements lout::container::untyped::Collection0.
References StackIterator, and top.
|
inline |
References lout::container::untyped::Stack::Node::object.
void lout::container::untyped::Stack::pop | ( | ) |
References bottom, numElements, lout::container::untyped::Stack::Node::object, ownerOfObjects, lout::container::untyped::Stack::Node::prev, and top.
Referenced by ~Stack().
void lout::container::untyped::Stack::push | ( | object::Object * | object | ) |
void lout::container::untyped::Stack::pushUnder | ( | object::Object * | object | ) |
|
virtual |
Implements lout::container::untyped::Collection.
References numElements.
|
inline |
References numElements.
|
friend |
Referenced by createIterator().
|
private |
Referenced by pop(), push(), pushUnder(), and Stack().
|
private |
Referenced by pop(), push(), pushUnder(), size(), and Stack().
|
private |
Referenced by createIterator(), pop(), push(), pushUnder(), Stack(), and ~Stack().