Orxonox  0.0.5 Codename: Arcturus
Classes | Namespaces
ObjectListIterator.h File Reference

Definition of the ObjectListIterator class, used to iterate through object-lists. More...

#include "core/CorePrereqs.h"
#include "core/class/Identifier.h"
#include "ObjectList.h"
#include "IteratorBase.h"

Go to the source code of this file.

Classes

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

Namespaces

 orxonox
 Die Wagnis Klasse hat die folgenden Aufgaben:
 

Detailed Description

Definition of the ObjectListIterator class, used to iterate through object-lists.

ObjectListIterator<T> allows to iterate through ObjectList<T>, containing all objects of type T. In contrast to Iterator<T>, this iterator is limited to the object-list of type T. It is, however, much faster as it doesn't need a dynamic_cast.

Usage:

ObjectList<myClass> list;
for (ObjectListIterator<myClass> it = list.begin(); it != list.end(); ++it)
{
it->someFunction(...);
myClass* myObject = *it;
}
Note
ObjectList<T>::iterator is identical to ObjectListIterator<T> (it's just a typedef).