|
Dillo v3.2.0-93-g6a586845
|
A single-linked list. More...
#include <container.hh>
Classes | |
| class | ListIterator |
| struct | Node |
Public Member Functions | |
| List (bool ownerOfObjects) | |
| ~List () | |
| bool | equals (Object *other) |
| Returns, whether two objects are equal. | |
| int | hashValue () |
| Return a hash value for the object. | |
| int | size () |
| void | clear () |
| void | append (object::Object *element) |
| bool | insertBefore (object::Object *beforeThis, object::Object *neew) |
| bool | removeRef (object::Object *element) |
| bool | remove (object::Object *element) |
| bool | detachRef (object::Object *element) |
| int | size () const |
| bool | isEmpty () const |
| object::Object * | getFirst () const |
| object::Object * | getLast () 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 Object * | clone () |
| Return an exact copy of the object. | |
| 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 Member Functions | |
| bool | remove0 (object::Object *element, bool compare, bool doNotDeleteAtAll) |
Private Attributes | |
| Node * | first |
| Node * | last |
| bool | ownerOfObjects |
| int | numElements |
Friends | |
| class | ListIterator |
A single-linked list.
Definition at line 186 of file container.hh.
| lout::container::untyped::List::List | ( | bool | ownerOfObjects | ) |
Definition at line 303 of file container.cc.
References lout::container::untyped::Vector::numElements, and lout::container::untyped::Vector::ownerOfObjects.
| lout::container::untyped::List::~List | ( | ) |
Definition at line 310 of file container.cc.
References lout::container::untyped::Vector::clear().
| void lout::container::untyped::List::append | ( | object::Object * | element | ) |
Definition at line 355 of file container.cc.
References lout::container::untyped::List::Node::next, lout::container::untyped::Vector::numElements, and lout::container::untyped::List::Node::object.
| void lout::container::untyped::List::clear | ( | ) |
Definition at line 341 of file container.cc.
References lout::container::untyped::List::Node::next, lout::container::untyped::Vector::numElements, and lout::container::untyped::Vector::ownerOfObjects.
|
protectedvirtual |
Implements lout::container::untyped::Collection0.
Definition at line 441 of file container.cc.
|
inline |
Definition at line 233 of file container.hh.
References remove0().
|
virtual |
Returns, whether two objects are equal.
The caller should ensure, that this and the object have the same class; this makes casting of "other" safe. Typically, an implementation should check this == other first, the caller can assume a fast implementation.
Reimplemented from lout::object::Object.
Definition at line 320 of file container.cc.
References lout::object::Object::equals(), first, lout::container::untyped::List::Node::next, and lout::container::untyped::List::Node::object.
|
inline |
Definition at line 237 of file container.hh.
References first, and lout::container::untyped::List::Node::object.
|
inline |
Definition at line 238 of file container.hh.
References last, and lout::container::untyped::List::Node::object.
|
virtual |
Return a hash value for the object.
Reimplemented from lout::object::Object.
Definition at line 333 of file container.cc.
References lout::object::Object::hashValue(), lout::container::untyped::List::Node::next, and lout::container::untyped::List::Node::object.
| bool lout::container::untyped::List::insertBefore | ( | object::Object * | beforeThis, |
| object::Object * | neew | ||
| ) |
Definition at line 370 of file container.cc.
References lout::container::untyped::List::Node::next, lout::container::untyped::Vector::numElements, and lout::container::untyped::List::Node::object.
|
inline |
Definition at line 236 of file container.hh.
References numElements.
|
inline |
Definition at line 231 of file container.hh.
References remove0().
|
private |
Definition at line 393 of file container.cc.
References lout::object::Object::equals(), lout::container::untyped::List::Node::next, lout::container::untyped::Vector::numElements, lout::container::untyped::List::Node::object, and lout::container::untyped::Vector::ownerOfObjects.
Referenced by detachRef(), remove(), and removeRef().
|
inline |
Definition at line 229 of file container.hh.
References remove0().
|
virtual |
Implements lout::container::untyped::Collection.
Definition at line 315 of file container.cc.
References lout::container::untyped::Vector::numElements.
|
inline |
Definition at line 235 of file container.hh.
References numElements.
|
friend |
Definition at line 188 of file container.hh.
|
private |
Definition at line 208 of file container.hh.
Referenced by equals(), and getFirst().
|
private |
Definition at line 208 of file container.hh.
Referenced by getLast().
|
private |
Definition at line 210 of file container.hh.
|
private |
Definition at line 209 of file container.hh.