Orxonox: orxonox::ObjectListBase Class Reference

# orxonox::ObjectListBase Class Reference

The ObjectListBase contains all objects of a given class. More...

`#include <src/core/ObjectListBase.h>`

List of all members.

## 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

## Detailed Description

The ObjectListBase contains all objects of a given class.

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.

## Constructor & Destructor Documentation

orxonox::ObjectListBase::ObjectListBase | ( | Identifier * | identifier | ) |

Constructor: Sets default values.

References first_, identifier_, and last_.

orxonox::ObjectListBase::~ObjectListBase | ( |  | ) |

Destructor: Deletes all list-elements, but NOT THE OBJECTS.

References first_, and orxonox::ObjectListBaseElement::next_.

## Member Function Documentation

ObjectListBaseElement * orxonox::ObjectListBase::add | ( | ObjectListBaseElement * | element | ) |

Adds a new object to the end of the list.

Parameters:

  | object | The object to add

Returns:
  The pointer to the new ObjectListBaseElement, needed by the MetaObjectList of the added object

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.

Returns:
  The element

Export orxonox::ObjectListBase::end | ( |  | ) | `[inline]`

Returns a pointer to the element after the last element in the list.

Returns:
  The element

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).

Parameters:

  | 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.

Returns:
  The element

void orxonox::ObjectListBase::registerIterator | ( | void * | iterator | ) | `[inline]`

Referenced by orxonox::Iterator< orxonox::BaseObject >::Iterator(), and orxonox::Iterator< orxonox::BaseObject >::operator=().

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.

Returns:
  The element

void orxonox::ObjectListBase::unregisterIterator | ( | void * | iterator | ) | `[inline]`

Referenced by orxonox::Iterator< orxonox::BaseObject >::operator=(), and orxonox::Iterator< orxonox::BaseObject >::~Iterator().

void orxonox::ObjectListBase::unregisterObjectListIterator | ( | void * | iterator | ) | `[inline]`

## Friends And Related Function Documentation

friend class MetaObjectListElement`[friend]`

## Member Data Documentation

ObjectListBaseElement* orxonox::ObjectListBase::first_`[private]`

The first element in the list.

Referenced by add(), ObjectListBase(), orxonox::MetaObjectListElement::~MetaObjectListElement(), and ~ObjectListBase().

Identifier* orxonox::ObjectListBase::identifier_`[private]`

The Iterator owning this list.

Referenced by ObjectListBase().

std::vector<void*> orxonox::ObjectListBase::iterators_`[private]`

A list of Iterators pointing on an element in this list.

Referenced by notifyIterators().

ObjectListBaseElement* orxonox::ObjectListBase::last_`[private]`

The last element in the list.

Referenced by add(), ObjectListBase(), and orxonox::MetaObjectListElement::~MetaObjectListElement().

std::vector<void*> orxonox::ObjectListBase::objectListIterators_`[private]`

A list of ObjectListIterators pointing on an element in this list.

Referenced by notifyIterators().

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

- src/core/ObjectListBase.h
- src/core/ObjectListBase.cc