Dillo v3.1.1-98-g318d1f14
|
A stack (LIFO). 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. | |
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. | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. | |
virtual int | hashValue () |
Return a hash value for the object. | |
virtual Object * | clone () |
Return an exact copy of the object. | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. | |
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.
Definition at line 336 of file container.hh.
lout::container::untyped::Stack::Stack | ( | bool | ownerOfObjects | ) |
Definition at line 721 of file container.cc.
References bottom, numElements, ownerOfObjects, and top.
lout::container::untyped::Stack::~Stack | ( | ) |
Definition at line 728 of file container.cc.
|
protectedvirtual |
Implements lout::container::untyped::Collection0.
Definition at line 800 of file container.cc.
References top.
|
inline |
Definition at line 373 of file container.hh.
References lout::container::untyped::Stack::Node::object, and top.
void lout::container::untyped::Stack::pop | ( | ) |
Definition at line 767 of file container.cc.
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 | ) |
Definition at line 739 of file container.cc.
References bottom, numElements, lout::container::untyped::Stack::Node::object, lout::container::untyped::Stack::Node::prev, and top.
void lout::container::untyped::Stack::pushUnder | ( | object::Object * | object | ) |
Definition at line 752 of file container.cc.
References bottom, numElements, lout::container::untyped::Stack::Node::object, lout::container::untyped::Stack::Node::prev, and top.
|
virtual |
Implements lout::container::untyped::Collection.
Definition at line 734 of file container.cc.
References numElements.
|
inline |
Definition at line 375 of file container.hh.
References numElements.
|
friend |
Definition at line 338 of file container.hh.
|
private |
Definition at line 358 of file container.hh.
Referenced by pop(), push(), pushUnder(), and Stack().
|
private |
Definition at line 360 of file container.hh.
Referenced by pop(), push(), pushUnder(), size(), size(), and Stack().
|
private |
Definition at line 359 of file container.hh.
|
private |
Definition at line 358 of file container.hh.
Referenced by createIterator(), getTop(), pop(), push(), pushUnder(), Stack(), and ~Stack().