Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | List of all members
orxonox::ObjectListIterator< T > Class Template Reference

ObjectListIterator<T> allows to iterate through the ObjectList of class T. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/CorePrereqs.h>

Inheritance diagram for orxonox::ObjectListIterator< T >:
orxonox::IteratorBase< T, ObjectListIterator< T > > orxonox::ObjectListElementRemovalListener

Public Member Functions

 ObjectListIterator ()
 Constructor: Sets the element, whereon the ObjectListIterator points, to zero. More...
 
 ObjectListIterator (ObjectListElement< T > *element)
 Constructor: Sets this element to a given element. More...
 
template<class OI >
 ObjectListIterator (const IteratorBase< T, OI > &other)
 Constructor: Sets this element to the element of another ObjectListIterator. More...
 
T * operator* () const
 Overloading of the *it operator: returns the pointer to the object. More...
 
T * operator-> () const
 Overloading of the it-> operator: returns the pointer to the object. More...
 
- Public Member Functions inherited from orxonox::IteratorBase< T, ObjectListIterator< T > >
 IteratorBase (ObjectListElement< T > *element=nullptr)
 Constructor: Sets the element, whereon the iterator points, to the given element. More...
 
 IteratorBase (const IteratorBase< OT, OI > &other)
 Constructor: Sets the element, whereon the iterator points, to the given element of another type. More...
 
 ~IteratorBase ()
 Unregisters the Iterator from the ObjectList. More...
 
ObjectListBaseElementgetElement () const
 
 operator bool () const
 Overloading of the typecast-operator to bool: returns true if the iterator points to an existing object. More...
 
bool operator!= (const IteratorBase< T, ObjectListIterator< T > > &compare) const
 Overloading of the != operator to compare with another Iterator. More...
 
const IteratorBase< T, ObjectListIterator< T > > & operator++ ()
 Overloading of the ++it operator: Iterator points to the next object in the list. More...
 
ObjectListIterator< T > operator++ (int)
 Overloading of the it++ operator: Iterator points to the next object in the list. More...
 
const IteratorBase< T, ObjectListIterator< T > > & operator-- ()
 Overloading of the –it operator: Iterator points to the previous object in the list. More...
 
ObjectListIterator< T > operator-- (int i)
 Overloading of the it– operator: Iterator points to the previous object in the list. More...
 
IteratorBase< T, ObjectListIterator< T > > & operator= (ObjectListElement< T > *element)
 Assigns a given element. More...
 
IteratorBase< T, ObjectListIterator< T > > & operator= (const IteratorBase< T, ObjectListIterator< T > > &other)
 Assigns the element of another Iterator. More...
 
bool operator== (const IteratorBase< T, ObjectListIterator< T > > &compare) const
 Overloading of the == operator to compare with another Iterator. More...
 
virtual void removedElement (ObjectListBaseElement *element) override
 Increments the Iterator if it points at the given element. More...
 
- Public Member Functions inherited from orxonox::ObjectListElementRemovalListener
 ObjectListElementRemovalListener ()=default
 
virtual ~ObjectListElementRemovalListener ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from orxonox::IteratorBase< T, ObjectListIterator< T > >
void registerIterator ()
 Registers the Iterator at the list to which it belongs. More...
 
void setElement (ObjectListBaseElement *element)
 
void unregisterIterator ()
 Unregisters the Iterator from the list (if any) More...
 
- Protected Attributes inherited from orxonox::IteratorBase< T, ObjectListIterator< T > >
ObjectListBaseElementelement_
 The element the Iterator points at. More...
 
ObjectListBaselist_
 The list in which the Iterator registered itself. More...
 

Detailed Description

template<class T>
class orxonox::ObjectListIterator< T >

ObjectListIterator<T> allows to iterate through the ObjectList of class T.

See also
See ObjectListIterator.h for more information an example.

Constructor & Destructor Documentation

template<class T >
orxonox::ObjectListIterator< T >::ObjectListIterator ( )
inline

Constructor: Sets the element, whereon the ObjectListIterator points, to zero.

template<class T >
orxonox::ObjectListIterator< T >::ObjectListIterator ( ObjectListElement< T > *  element)
inline

Constructor: Sets this element to a given element.

Parameters
elementThe element to start with
template<class T >
template<class OI >
orxonox::ObjectListIterator< T >::ObjectListIterator ( const IteratorBase< T, OI > &  other)
inline

Constructor: Sets this element to the element of another ObjectListIterator.

Parameters
otherThe other ObjectListIterator

Member Function Documentation

template<class T >
T* orxonox::ObjectListIterator< T >::operator* ( ) const
inline

Overloading of the *it operator: returns the pointer to the object.

Returns
The object the ObjectListIterator points at
template<class T >
T* orxonox::ObjectListIterator< T >::operator-> ( ) const
inline

Overloading of the it-> operator: returns the pointer to the object.

Returns
The object the ObjectListIterator points at

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