35 #ifndef _IteratorBase_H__ 36 #define _IteratorBase_H__ 48 template <
class T,
class I>
51 static_assert(std::is_base_of<Listable, T>::value,
"IteratorBase can only be used with Listables");
67 template <
class OT,
class OI>
148 inline explicit operator bool()
const 207 this->
list_ =
nullptr;
IteratorBase< T, I > & operator=(ObjectListElement< T > *element)
Assigns a given element.
Definition: IteratorBase.h:86
The list-element that actually contains the object.
Definition: CorePrereqs.h:208
virtual void removedElement(ObjectListBaseElement *element) override
Increments the Iterator if it points at the given element.
Definition: IteratorBase.h:177
Declaration of the ObjectListBase class which stores all objects of each class.
~IteratorBase()
Unregisters the Iterator from the ObjectList.
Definition: IteratorBase.h:77
Shared library macros, enums, constants and forward declarations for the core library ...
void setElement(ObjectListBaseElement *element)
Definition: IteratorBase.h:189
Gets called by the object list if an element is removed.
Definition: ObjectListBase.h:103
ObjectListBaseElement * element_
The element the Iterator points at.
Definition: IteratorBase.h:219
The ObjectListBase contains all objects of a given class.
Definition: ObjectListBase.h:125
The Iterator allows to iterate through object lists.
Definition: IteratorBase.h:49
const IteratorBase< T, I > & operator++()
Overloading of the ++it operator: Iterator points to the next object in the list. ...
Definition: IteratorBase.h:106
void unregisterIterator()
Unregisters the Iterator from the list (if any)
Definition: IteratorBase.h:213
ObjectListBaseElement * prev_
The previous element in the list.
Definition: ObjectListBase.h:65
const IteratorBase< T, I > & operator--()
Overloading of the –it operator: Iterator points to the previous object in the list.
Definition: IteratorBase.h:127
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
I operator++(int)
Overloading of the it++ operator: Iterator points to the next object in the list. ...
Definition: IteratorBase.h:116
IteratorBase< T, I > & operator=(const IteratorBase< T, I > &other)
Assigns the element of another Iterator.
Definition: IteratorBase.h:96
Definition: InputPrereqs.h:81
void registerIterator()
Registers the Iterator at the list to which it belongs.
Definition: IteratorBase.h:199
bool operator==(const IteratorBase< T, I > &compare) const
Overloading of the == operator to compare with another Iterator.
Definition: IteratorBase.h:158
bool operator!=(const IteratorBase< T, I > &compare) const
Overloading of the != operator to compare with another Iterator.
Definition: IteratorBase.h:168
IteratorBase(const IteratorBase< OT, OI > &other)
Constructor: Sets the element, whereon the iterator points, to the given element of another type...
Definition: IteratorBase.h:68
ObjectListBaseElement * getElement() const
Definition: IteratorBase.h:183
IteratorBase(ObjectListElement< T > *element=nullptr)
Constructor: Sets the element, whereon the iterator points, to the given element. ...
Definition: IteratorBase.h:57
The list-element of the ObjectListBase.
Definition: ObjectListBase.h:52
ObjectListBase * list_
The list in which the Iterator registered itself.
Definition: IteratorBase.h:220
I operator--(int i)
Overloading of the it– operator: Iterator points to the previous object in the list.
Definition: IteratorBase.h:137
ObjectListBaseElement * next_
The next element in the list.
Definition: ObjectListBase.h:64
void registerRemovalListener(ObjectListElementRemovalListener *listener)
Definition: ObjectListBase.h:145
void unregisterRemovalListener(ObjectListElementRemovalListener *listener)
Definition: ObjectListBase.h:146
ObjectListBase * list_
The list.
Definition: ObjectListBase.h:67