#include <src/core/ObjectListBase.h>
Public Member Functions | |
ObjectListBaseElement * | add (ObjectListBaseElement *element) |
Adds a new object to the end of the list. | |
Export | begin () |
Returns a pointer to the first element in the list. | |
Export | end () |
Returns a pointer to the element after the last element in the list. | |
Identifier * | getIdentifier () const |
void | notifyIterators (OrxonoxClass *object) const |
Increases all Iterators that currently point on the given element (because it gets removed). | |
ObjectListBase (Identifier *identifier) | |
Constructor: Sets default values. | |
Export | rbegin () |
Returns a pointer to the last element in the list. | |
void | registerIterator (void *iterator) |
void | registerObjectListIterator (void *iterator) |
Export | rend () |
Returns a pointer to the element in front of the first element in the list. | |
void | unregisterIterator (void *iterator) |
void | unregisterObjectListIterator (void *iterator) |
~ObjectListBase () | |
Destructor: Deletes all list-elements, but NOT THE OBJECTS. | |
Private Attributes | |
ObjectListBaseElement * | first_ |
The first element in the list. | |
Identifier * | identifier_ |
The Iterator owning this list. | |
std::vector< void * > | iterators_ |
A list of Iterators pointing on an element in this list. | |
ObjectListBaseElement * | last_ |
The last element in the list. | |
std::vector< void * > | objectListIterators_ |
A list of ObjectListIterators pointing on an element in this list. | |
Friends | |
class | MetaObjectListElement |
Classes | |
struct | Export |
The ObjectListBase is used by Identifiers to store all objects of their given class. Use ObjectList<T> to get the list of all T's and Iterator<T> to iterate through them.
orxonox::ObjectListBase::ObjectListBase | ( | Identifier * | identifier | ) |
orxonox::ObjectListBase::~ObjectListBase | ( | ) |
Destructor: Deletes all list-elements, but NOT THE OBJECTS.
References first_, and orxonox::ObjectListBaseElement::next_.
ObjectListBaseElement * orxonox::ObjectListBase::add | ( | ObjectListBaseElement * | element | ) |
Adds a new object to the end of the list.
object | The object to add |
References first_, last_, orxonox::ObjectListBaseElement::next_, and orxonox::ObjectListBaseElement::prev_.
Export orxonox::ObjectListBase::begin | ( | ) | [inline] |
Returns a pointer to the first element in the list.
Export orxonox::ObjectListBase::end | ( | ) | [inline] |
Returns a pointer to the element after the last element in the list.
Identifier* orxonox::ObjectListBase::getIdentifier | ( | ) | const [inline] |
Referenced by orxonox::MetaObjectListElement::~MetaObjectListElement().
void orxonox::ObjectListBase::notifyIterators | ( | OrxonoxClass * | object | ) | const |
Increases all Iterators that currently point on the given element (because it gets removed).
element | The element that gets removed |
References iterators_, and objectListIterators_.
Referenced by orxonox::MetaObjectListElement::~MetaObjectListElement().
Export orxonox::ObjectListBase::rbegin | ( | ) | [inline] |
Returns a pointer to the last element in the list.
void orxonox::ObjectListBase::registerIterator | ( | void * | iterator | ) | [inline] |
void orxonox::ObjectListBase::registerObjectListIterator | ( | void * | iterator | ) | [inline] |
Export orxonox::ObjectListBase::rend | ( | ) | [inline] |
Returns a pointer to the element in front of the first element in the list.
void orxonox::ObjectListBase::unregisterIterator | ( | void * | iterator | ) | [inline] |
void orxonox::ObjectListBase::unregisterObjectListIterator | ( | void * | iterator | ) | [inline] |
friend class MetaObjectListElement [friend] |
The first element in the list.
Referenced by add(), ObjectListBase(), orxonox::MetaObjectListElement::~MetaObjectListElement(), and ~ObjectListBase().
Identifier* orxonox::ObjectListBase::identifier_ [private] |
std::vector<void*> orxonox::ObjectListBase::iterators_ [private] |
The last element in the list.
Referenced by add(), ObjectListBase(), and orxonox::MetaObjectListElement::~MetaObjectListElement().
std::vector<void*> orxonox::ObjectListBase::objectListIterators_ [private] |