orxonox::Iterator< T > Class Template Reference

The Iterator allows to iterate through a given ObjectList. More...

#include <src/core/Iterator.h>

List of all members.

Public Member Functions

void incrementIfEqual (OrxonoxClass *object)
 Increments the Iterator if it points at the given object.
template<class O>
 Iterator (const ObjectListIterator< O > &other)
 Constructor: Sets this element to the element an ObjectListIterator.
template<class O>
 Iterator (ObjectListElement< O > *element)
 Constructor: Sets this element to a given element.
 Iterator (const Iterator< T > &other)
 Constructor: Sets this element to the element of another Iterator.
 Iterator (const ObjectListBase::Export &exp)
 Constructor: Sets this element to the exported element.
 Iterator ()
 Constructor: Sets the element, whereon the iterator points, to zero.
 operator bool () const
 Overloading of the typecast-operator to bool: returns true if the iterator points to an existing object.
bool operator!= (const Iterator< T > &compare) const
 Overloading of the != operator to compare with another Iterator.
T * operator* () const
 Overloading of the *it operator: returns the pointer to the object.
Iterator< T > operator++ (int i)
 Overloading of the it++ operator: Iterator points to the next object in the list.
const Iterator< T > & operator++ ()
 Overloading of the ++it operator: Iterator points to the next object in the list.
Iterator< T > operator-- (int i)
 Overloading of the it-- operator: Iterator points to the previous object in the list.
const Iterator< T > & operator-- ()
 Overloading of the --it operator: Iterator points to the previous object in the list.
T * operator-> () const
 Overloading of the it-> operator: returns the pointer to the object.
template<class O>
const Iterator< T > & operator= (const ObjectListIterator< O > &other)
 Assigns the element of an ObjectListIterator.
template<class O>
const Iterator< T > & operator= (ObjectListElement< O > *element)
 Assigns a given element.
const Iterator< T > & operator= (const Iterator< T > &other)
 Assigns the element of another Iterator.
const Iterator< T > & operator= (const ObjectListBase::Export &exp)
 Assigns an exported element.
bool operator== (const Iterator< T > &compare) const
 Overloading of the == operator to compare with another Iterator.
 ~Iterator ()
 Unregisters the Iterator from the ObjectList.

Protected Attributes

ObjectListBaseElementelement_
 The element the Iterator points at.
ObjectListBaselist_
 The list wherein the element is.


Detailed Description

template<class T = OrxonoxClass>
class orxonox::Iterator< T >

The Iterator allows to iterate through a given ObjectList.

Constructor & Destructor Documentation

template<class T = OrxonoxClass>
orxonox::Iterator< T >::Iterator (  )  [inline]

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

template<class T = OrxonoxClass>
orxonox::Iterator< T >::Iterator ( const ObjectListBase::Export exp  )  [inline]

Constructor: Sets this element to the exported element.

Parameters:
exp The exported element

template<class T = OrxonoxClass>
orxonox::Iterator< T >::Iterator ( const Iterator< T > &  other  )  [inline]

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

Parameters:
other The other Iterator

template<class T = OrxonoxClass>
template<class O>
orxonox::Iterator< T >::Iterator ( ObjectListElement< O > *  element  )  [inline]

Constructor: Sets this element to a given element.

Parameters:
element The element

template<class T = OrxonoxClass>
template<class O>
orxonox::Iterator< T >::Iterator ( const ObjectListIterator< O > &  other  )  [inline]

Constructor: Sets this element to the element an ObjectListIterator.

Parameters:
other The ObjectListIterator

template<class T = OrxonoxClass>
orxonox::Iterator< T >::~Iterator (  )  [inline]

Unregisters the Iterator from the ObjectList.


Member Function Documentation

template<class T = OrxonoxClass>
void orxonox::Iterator< T >::incrementIfEqual ( OrxonoxClass object  )  [inline]

Increments the Iterator if it points at the given object.

Parameters:
object The object to compare with

template<class T = OrxonoxClass>
orxonox::Iterator< T >::operator bool (  )  const [inline]

Overloading of the typecast-operator to bool: returns true if the iterator points to an existing object.

Returns:
True if the Iterator points to an existing object.

template<class T = OrxonoxClass>
bool orxonox::Iterator< T >::operator!= ( const Iterator< T > &  compare  )  const [inline]

Overloading of the != operator to compare with another Iterator.

Parameters:
compare The other Iterator
Returns:
True if the iterators point to different elements

template<class T = OrxonoxClass>
T* orxonox::Iterator< T >::operator* (  )  const [inline]

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

Returns:
The object the Iterator points at

template<class T = OrxonoxClass>
Iterator<T> orxonox::Iterator< T >::operator++ ( int  i  )  [inline]

Overloading of the it++ operator: Iterator points to the next object in the list.

Returns:
The Iterator itself

template<class T = OrxonoxClass>
const Iterator<T>& orxonox::Iterator< T >::operator++ (  )  [inline]

Overloading of the ++it operator: Iterator points to the next object in the list.

Returns:
The Iterator itself

Referenced by orxonox::Iterator< orxonox::BaseObject >::incrementIfEqual().

template<class T = OrxonoxClass>
Iterator<T> orxonox::Iterator< T >::operator-- ( int  i  )  [inline]

Overloading of the it-- operator: Iterator points to the previous object in the list.

Returns:
The Iterator itself

template<class T = OrxonoxClass>
const Iterator<T>& orxonox::Iterator< T >::operator-- (  )  [inline]

Overloading of the --it operator: Iterator points to the previous object in the list.

Returns:
The Iterator itself

template<class T = OrxonoxClass>
T* orxonox::Iterator< T >::operator-> (  )  const [inline]

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

Returns:
The object the Iterator points at

template<class T = OrxonoxClass>
template<class O>
const Iterator<T>& orxonox::Iterator< T >::operator= ( const ObjectListIterator< O > &  other  )  [inline]

Assigns the element of an ObjectListIterator.

Parameters:
other The ObjectListIterator

template<class T = OrxonoxClass>
template<class O>
const Iterator<T>& orxonox::Iterator< T >::operator= ( ObjectListElement< O > *  element  )  [inline]

Assigns a given element.

Parameters:
element The element

template<class T = OrxonoxClass>
const Iterator<T>& orxonox::Iterator< T >::operator= ( const Iterator< T > &  other  )  [inline]

Assigns the element of another Iterator.

Parameters:
other The other Iterator

template<class T = OrxonoxClass>
const Iterator<T>& orxonox::Iterator< T >::operator= ( const ObjectListBase::Export exp  )  [inline]

Assigns an exported element.

Parameters:
exp The exported element

template<class T = OrxonoxClass>
bool orxonox::Iterator< T >::operator== ( const Iterator< T > &  compare  )  const [inline]

Overloading of the == operator to compare with another Iterator.

Parameters:
compare The other Iterator
Returns:
True if the iterators point to the same element


Member Data Documentation

template<class T = OrxonoxClass>
ObjectListBaseElement* orxonox::Iterator< T >::element_ [protected]

template<class T = OrxonoxClass>
ObjectListBase* orxonox::Iterator< T >::list_ [protected]


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

Generated on Tue Jul 28 16:22:40 2009 for Orxonox by  doxygen 1.5.6