Orxonox: orxonox::ObjectListIterator< T > Class Template Reference

# orxonox::ObjectListIterator< T > Class Template Reference

The Iterator allows to iterate through the ObjectList of a given class. More...

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

List of all members.

## Public Member Functions

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

## Private Attributes

ObjectListElement< T > * | element_
| The element the Iterator points at.

## Friends

class | Iterator

## Detailed Description

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

The Iterator allows to iterate through the ObjectList of a given class.

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

  | element | The element to start with

template<class T>

orxonox::ObjectListIterator< T >::ObjectListIterator | ( | const ObjectListIterator< T > & | other | ) | `[inline]`

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

Parameters:

  | other | The other ObjectListIterator

template<class T>

orxonox::ObjectListIterator< T >::~ObjectListIterator | ( |  | ) | `[inline]`

Unregisters the ObjectListIterator from the ObjectList.

## Member Function Documentation

template<class T>

void orxonox::ObjectListIterator< T >::incrementIfEqual | ( | OrxonoxClass * | object | ) | `[inline]`

Increments the ObjectListIterator if it points at the given object.

Parameters:

  | object | The object to compare with

template<class T>

orxonox::ObjectListIterator< T >::operator bool | ( |  | ) | const`[inline]`

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

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

template<class T>

bool orxonox::ObjectListIterator< T >::operator!= | ( | const ObjectListIterator< T > & | compare | ) | const`[inline]`

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

Parameters:

  | compare | The other ObjectListIterator

Returns:
  True if the ObjectListIterator point to different elements

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>

ObjectListIterator<T> orxonox::ObjectListIterator< T >::operator++ | ( | int | i | ) | `[inline]`

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

Returns:
  The ObjectListIterator itself

template<class T>

const ObjectListIterator<T>& orxonox::ObjectListIterator< T >::operator++ | ( |  | ) | `[inline]`

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

Returns:
  The ObjectListIterator itself

Referenced by orxonox::ObjectListIterator< orxonox::RadarViewable >::incrementIfEqual().

template<class T>

ObjectListIterator<T> orxonox::ObjectListIterator< T >::operator-- | ( | int | i | ) | `[inline]`

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

Returns:
  The ObjectListIterator itself

template<class T>

const ObjectListIterator<T>& orxonox::ObjectListIterator< T >::operator-- | ( |  | ) | `[inline]`

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

Returns:
  The ObjectListIterator itself

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>

const ObjectListIterator<T>& orxonox::ObjectListIterator< T >::operator= | ( | const ObjectListIterator< T > & | other | ) | `[inline]`

Assigns the element of another ObjectListIterator.

Parameters:

  | element | The other ObjectListIterator

template<class T>

const ObjectListIterator<T>& orxonox::ObjectListIterator< T >::operator= | ( | ObjectListElement< T > * | element | ) | `[inline]`

Assigns an ObjectListElement.

Parameters:

  | element | The ObjectListElement

template<class T>

bool orxonox::ObjectListIterator< T >::operator== | ( | const ObjectListIterator< T > & | compare | ) | const`[inline]`

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

Parameters:

  | compare | The other ObjectListIterator

Returns:
  True if the ObjectListIterator point to the same element

## Friends And Related Function Documentation

template<class T>

friend class Iterator`[friend]`

## Member Data Documentation

template<class T>

ObjectListElement<T>* orxonox::ObjectListIterator< T >::element_`[private]`

The element the Iterator points at.

Referenced by orxonox::ObjectListIterator< orxonox::RadarViewable >::incrementIfEqual(), orxonox::Iterator< orxonox::BaseObject >::Iterator(), orxonox::ObjectListIterator< orxonox::RadarViewable >::ObjectListIterator(), orxonox::ObjectListIterator< orxonox::RadarViewable >::operator bool(), orxonox::ObjectListIterator< orxonox::RadarViewable >::operator!=(), orxonox::ObjectListIterator< orxonox::RadarViewable >::operator*(), orxonox::ObjectListIterator< orxonox::RadarViewable >::operator++(), orxonox::ObjectListIterator< orxonox::RadarViewable >::operator--(), orxonox::ObjectListIterator< orxonox::RadarViewable >::operator->(), orxonox::ObjectListIterator< orxonox::RadarViewable >::operator=(), orxonox::Iterator< orxonox::BaseObject >::operator=(), and orxonox::ObjectListIterator< orxonox::RadarViewable >::operator==().

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

- src/core/ObjectListIterator.h