Orxonox
0.0.5 Codename: Arcturus
|
The ObjectListBase contains all objects of a given class. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/object/ObjectListBase.h>
Public Member Functions | |
ObjectListBase () | |
Constructor: Sets default values. More... | |
~ObjectListBase () | |
Destructor: Detaches all list-elements, but doesn't delete them (nor the objects). More... | |
void | addElement (ObjectListBaseElement *element) |
Adds a new object to the end of the list. More... | |
ObjectListBaseElement * | begin () const |
Returns a pointer to the first element in the list. Works only with Iterator. More... | |
ObjectListBaseElement * | end () const |
Returns a pointer to the element after the last element in the list. Works only with Iterator. More... | |
ObjectListBaseElement * | rbegin () const |
Returns a pointer to the last element in the list. Works only with Iterator. More... | |
void | registerRemovalListener (ObjectListElementRemovalListener *listener) |
void | removeElement (ObjectListBaseElement *element) |
Removes the element from the list. More... | |
ObjectListBaseElement * | rend () const |
Returns a pointer to the element in front of the first element in the list. Works only with Iterator. More... | |
size_t | size () const |
void | unregisterRemovalListener (ObjectListElementRemovalListener *listener) |
Private Member Functions | |
void | notifyRemovalListeners (ObjectListBaseElement *element) const |
Notifies all listeners that the given element is about to get removed. More... | |
Private Attributes | |
ObjectListBaseElement * | first_ |
The first element in the list. More... | |
ObjectListBaseElement * | last_ |
The last element in the list. More... | |
std::vector< ObjectListElementRemovalListener * > | listeners_ |
A list of Iterators pointing on an element in this list. More... | |
size_t | size_ |
The number of elements in the list. More... | |
The ObjectListBase contains all objects of a given class.
The ObjectListBase is used by Identifiers to store all objects of their class. You can use Identifier::getObjects() to get the object-list from an Identifier. Use Iterator<T> to iterate through them.
Alternatively you can also use the static helper class ObjectList<T> to get the list of all objects of type T. Use ObjectListIterator<T> or Iterator<T> to iterate through them.
orxonox::ObjectListBase::ObjectListBase | ( | ) |
Constructor: Sets default values.
orxonox::ObjectListBase::~ObjectListBase | ( | ) |
Destructor: Detaches all list-elements, but doesn't delete them (nor the objects).
void orxonox::ObjectListBase::addElement | ( | ObjectListBaseElement * | element | ) |
Adds a new object to the end of the list.
element | The element to add |
|
inline |
Returns a pointer to the first element in the list. Works only with Iterator.
|
inline |
Returns a pointer to the element after the last element in the list. Works only with Iterator.
|
private |
Notifies all listeners that the given element is about to get removed.
element | The element that gets removed This is mainly used for iterators which point at the removed element |
|
inline |
Returns a pointer to the last element in the list. Works only with Iterator.
|
inline |
void orxonox::ObjectListBase::removeElement | ( | ObjectListBaseElement * | element | ) |
Removes the element from the list.
|
inline |
Returns a pointer to the element in front of the first element in the list. Works only with Iterator.
|
inline |
|
inline |
|
private |
The first element in the list.
|
private |
The last element in the list.
|
private |
A list of Iterators pointing on an element in this list.
|
private |
The number of elements in the list.