Index: /code/branches/objecthierarchie/src/BaseObject.h
===================================================================
--- /code/branches/objecthierarchie/src/BaseObject.h	(revision 220)
+++ /code/branches/objecthierarchie/src/BaseObject.h	(revision 221)
@@ -64,4 +64,6 @@
                 { this->getIdentifier()->isDirectParentOf(object->getIdentifier()); }
 
+            std::string name_; // test
+
     };
 }
Index: /code/branches/objecthierarchie/src/CMakeLists.txt
===================================================================
--- /code/branches/objecthierarchie/src/CMakeLists.txt	(revision 220)
+++ /code/branches/objecthierarchie/src/CMakeLists.txt	(revision 221)
@@ -3,5 +3,5 @@
 # create a few variables to simplify life
 SET(SRC_FILES orxonox.cc IdentifierList.cc ObjectList.cc Identifier.cc Factory.cc OrxonoxClass.cc BaseObject.cc test1.cc test2.cc test3.cc)
-SET(INC_FILES IdentifierIncludes.h Identifier.h Factory.h IdentifierList.h ObjectList.h OrxonoxClass.h BaseObject.h Test.h test1.h test2.h test3.h)
+SET(INC_FILES IdentifierIncludes.h Identifier.h Factory.h IdentifierList.h ObjectList.h Iterator.h OrxonoxClass.h BaseObject.h Test.h test1.h test2.h test3.h)
 
 #Creates an executable
Index: /code/branches/objecthierarchie/src/Identifier.cc
===================================================================
--- /code/branches/objecthierarchie/src/Identifier.cc	(revision 220)
+++ /code/branches/objecthierarchie/src/Identifier.cc	(revision 221)
@@ -84,6 +84,12 @@
     void Identifier::removeObject(OrxonoxClass* object)
     {
-        std::cout << "*** Removed object from " << this->name_ << "-list.\n";
-        this->objects_.remove(object);
+        bool bIterateForwards = !Identifier::isCreatingHierarchy();
+
+        if (bIterateForwards)
+            std::cout << "*** Removed object from " << this->name_ << "-list, iterating forwards.\n";
+        else
+            std::cout << "*** Removed object from " << this->name_ << "-list, iterating backwards.\n";
+
+        this->objects_.remove(object, bIterateForwards);
 
         IdentifierListElement* temp = this->directParents_.first_;
Index: /code/branches/objecthierarchie/src/Identifier.h
===================================================================
--- /code/branches/objecthierarchie/src/Identifier.h	(revision 220)
+++ /code/branches/objecthierarchie/src/Identifier.h	(revision 221)
@@ -35,4 +35,7 @@
         friend class BaseIdentifier;
 
+        template <class T>
+        friend class Iterator;
+
         public:
             void addObject(OrxonoxClass* object);
@@ -172,6 +175,6 @@
             Identifier::startCreatingHierarchy();
             T* temp = new T();
+            delete temp;
             Identifier::stopCreatingHierarchy();
-            delete temp;
         }
 
@@ -186,5 +189,5 @@
             BaseIdentifier();
 
-            BaseIdentifier<B>& operator= (Identifier* identifier)
+            BaseIdentifier<B>& operator=(Identifier* identifier)
             {
                 if (!identifier->isA(ClassIdentifier<B>::getIdentifier()))
@@ -199,10 +202,10 @@
             }
 
-            Identifier* operator* ()
+            Identifier* operator*()
             {
                 return this->identifier_;
             }
 
-            Identifier* operator-> () const
+            Identifier* operator->() const
             {
                 return this->identifier_;
Index: /code/branches/objecthierarchie/src/IdentifierIncludes.h
===================================================================
--- /code/branches/objecthierarchie/src/IdentifierIncludes.h	(revision 220)
+++ /code/branches/objecthierarchie/src/IdentifierIncludes.h	(revision 221)
@@ -3,4 +3,5 @@
 #include "IdentifierList.h"
 #include "ObjectList.h"
+#include "Iterator.h"
 #include "OrxonoxClass.h"
 
Index: /code/branches/objecthierarchie/src/Iterator.h
===================================================================
--- /code/branches/objecthierarchie/src/Iterator.h	(revision 221)
+++ /code/branches/objecthierarchie/src/Iterator.h	(revision 221)
@@ -0,0 +1,94 @@
+#ifndef _Iterator_H__
+#define _Iterator_H__
+
+namespace orxonox
+{
+    template <class T>
+    class Iterator
+    {
+        public:
+            Iterator()
+            {
+                this->elementForwards_ = ClassIdentifier<T>::getIdentifier()->objects_.first_;
+                this->elementBackwards_ = ClassIdentifier<T>::getIdentifier()->objects_.last_;
+                this->iteratingForwards_ = true;
+            }
+
+            Iterator<T> operator++(int step)
+            {
+                Iterator<T> copy = *this;
+
+                if (step < 1)
+                    step = 1;
+
+                for (int i = 0; i < step; i++)
+                    this->elementForwards_ = this->elementForwards_->next_;
+
+                return copy;
+            }
+
+            Iterator<T> operator--(int step)
+            {
+                Iterator<T> copy = *this;
+
+                if (this->iteratingForwards_)
+                {
+                    this->iteratingForwards_ = false;
+                }
+                else
+                {
+                    if (step < 1)
+                        step = 1;
+
+                    for (int i = 0; i < step; i++)
+                        this->elementBackwards_ = this->elementBackwards_->prev_;
+                }
+
+                return copy;
+            }
+
+            T* operator*()
+            {
+                if (this->iteratingForwards_)
+                    return dynamic_cast<T*>(this->elementForwards_->object_);
+                else
+                    return dynamic_cast<T*>(this->elementBackwards_->object_);
+            }
+
+            T* operator->() const
+            {
+                if (this->iteratingForwards_)
+                    return dynamic_cast<T*>(this->elementForwards_->object_);
+                else
+                    return dynamic_cast<T*>(this->elementBackwards_->object_);
+
+            }
+
+            operator bool()
+            {
+                if (this->iteratingForwards_)
+                    return (this->elementForwards_ != 0);
+                else
+                    return (this->elementBackwards_->prev_ != 0);
+            }
+
+            bool operator!=(int compare)
+            {
+                if (compare != 0)
+                    std::cout << "Warning: Comparing the " << ClassIdentifier<T>::getIdentifier()->getName() << "-List-Iterator with " << compare << " has no effect. Only comparison with 0 works.\n";
+
+                if (this->iteratingForwards_)
+                    return (this->elementForwards_ != 0);
+                else
+                    return (this->elementBackwards_->prev_ != 0);
+            }
+
+
+        private:
+            ObjectListElement* elementForwards_;
+            ObjectListElement* elementBackwards_;
+            bool iteratingForwards_;
+    };
+}
+
+#endif
Index: /code/branches/objecthierarchie/src/ObjectList.cc
===================================================================
--- /code/branches/objecthierarchie/src/ObjectList.cc	(revision 220)
+++ /code/branches/objecthierarchie/src/ObjectList.cc	(revision 221)
@@ -9,4 +9,5 @@
     {
         this->first_ = 0;
+        this->last_ = 0;
     }
 
@@ -24,36 +25,88 @@
     void ObjectList::add(OrxonoxClass* object)
     {
-        ObjectListElement* temp = this->first_;
-        this->first_ = new ObjectListElement(object);
-        this->first_->next_ = temp;
+        if (!this->last_)
+        {
+            this->last_ = new ObjectListElement(object);
+            this->first_ = this->last_;
+        }
+        else
+        {
+            ObjectListElement* temp = this->last_;
+            this->last_ = new ObjectListElement(object);
+            this->last_->prev_ = temp;
+            temp->next_ = this->last_;
+        }
     }
 
-    void ObjectList::remove(OrxonoxClass* object)
+    void ObjectList::remove(OrxonoxClass* object, bool bIterateForwards)
     {
-        if (!object)
+        if (!object || !this->first_ || !this->last_)
             return;
 
-        if (this->first_->object_ == object)
+        if (this->first_ == this->last_)
         {
-            ObjectListElement* temp = this->first_->next_;
-            delete this->first_;
-            this->first_ = temp;
+            if (this->first_->object_ == object)
+            {
+                delete this->first_;
+                this->first_ = 0;
+                this->last_ = 0;
+            }
 
             return;
         }
 
-        ObjectListElement* temp = this->first_;
-        while (temp->next_)
+        if (bIterateForwards)
         {
-            if (temp->next_->object_ == object)
+            if (this->first_->object_ == object)
             {
-                ObjectListElement* temp2 = temp->next_->next_;
-                delete temp->next_;
-                temp->next_ = temp2;
+                ObjectListElement* temp = this->first_->next_;
+                delete this->first_;
+                this->first_ = temp;
 
                 return;
             }
 
-            temp = temp->next_;
+            ObjectListElement* temp = this->first_;
+            while (temp->next_)
+            {
+                if (temp->next_->object_ == object)
+                {
+                    ObjectListElement* temp2 = temp->next_->next_;
+                    delete temp->next_;
+                    temp->next_ = temp2;
+                    temp2->prev_ = temp;
+
+                    return;
+                }
+
+                temp = temp->next_;
+            }
+        }
+        else
+        {
+            if (this->last_->object_ == object)
+            {
+                ObjectListElement* temp = this->last_->prev_;
+                delete this->last_;
+                this->last_ = temp;
+
+                return;
+            }
+
+            ObjectListElement* temp = this->last_;
+            while (temp->prev_)
+            {
+                if (temp->prev_->object_ == object)
+                {
+                    ObjectListElement* temp2 = temp->prev_->prev_;
+                    delete temp->prev_;
+                    temp->prev_ = temp2;
+                    temp2->next_ = temp;
+
+                    return;
+                }
+
+                temp = temp->prev_;
+            }
         }
     }
@@ -67,4 +120,5 @@
         this->object_ = object;
         this->next_ = 0;
+        this->prev_ = 0;
     }
 
Index: /code/branches/objecthierarchie/src/ObjectList.h
===================================================================
--- /code/branches/objecthierarchie/src/ObjectList.h	(revision 220)
+++ /code/branches/objecthierarchie/src/ObjectList.h	(revision 221)
@@ -14,4 +14,5 @@
             OrxonoxClass* object_;
             ObjectListElement* next_;
+            ObjectListElement* prev_;
     };
 
@@ -22,7 +23,8 @@
             ~ObjectList();
             void add(OrxonoxClass* object);
-            void remove(OrxonoxClass* object);
+            void remove(OrxonoxClass* object, bool bIterateForwards = true);
 
             ObjectListElement* first_;
+            ObjectListElement* last_;
     };
 }
Index: /code/branches/objecthierarchie/src/orxonox.cc
===================================================================
--- /code/branches/objecthierarchie/src/orxonox.cc	(revision 220)
+++ /code/branches/objecthierarchie/src/orxonox.cc	(revision 221)
@@ -500,5 +500,5 @@
         delete test8_03;
 */
-
+/*
         std::cout << "Test 9\n";
         std::cout << "1\n";
@@ -526,4 +526,63 @@
         delete test9_05;
         delete test9_06;
+*/
+        std::cout << "Test 10\n";
+        Identifier* test9_01 = Class(A1B2);
+        Identifier* test9_02 = Class(A2);
+        Identifier* test9_03 = Class(A3B1C1);
+
+
+        BaseObject* test9_04 = test9_01->fabricate();
+        BaseObject* test9_05 = test9_02->fabricate();
+        BaseObject* test9_06 = test9_03->fabricate();
+
+        BaseObject* test9_07;
+        for (int i = 0; i < 10; i++)
+            test9_07 = Factory("A1B1C1");
+
+        std::cout << "1\n";
+        int count = 0;
+        for (Iterator<BaseObject> it; it != 0; it++)
+            count++;
+        std::cout << "Anzahl BaseObjects: " << count << "\n";
+
+        count = 0;
+        for (Iterator<A1> it; it != 0; it++)
+            count++;
+        std::cout << "Anzahl A1: " << count << "\n";
+
+        count = 0;
+        for (Iterator<A1B1> it; it; it++)
+            count++;
+        std::cout << "Anzahl A1B1: " << count << "\n";
+
+        count = 0;
+        for (Iterator<A1B1C1> it; it; it++)
+            count++;
+        std::cout << "Anzahl A1B1C1: " << count << "\n";
+
+        count = 0;
+        for (Iterator<A2> it; it; it++)
+            count++;
+        std::cout << "Anzahl A2: " << count << "\n";
+
+
+        std::cout << "2\n";
+        BaseObject* test9_08;
+        for (int i = 0; i < 10; i++)
+        {
+            test9_08 = Factory("A2B1C1");
+            test9_08->name_ = "A2B1C1#";
+            test9_08->name_ += ('0' + i);
+        }
+
+        for (Iterator<A2B1C1> it; it; it++)
+            std::cout << "Name: " << it->name_ << "\n";
+
+        std::cout << "3\n";
+        for (Iterator<A2B1C1> it; it; it--)
+            std::cout << "Name: " << it->name_ << "\n";
+
+        std::cout << "4\n";
 
       }
