Index: /code/branches/objecthierarchie/src/CMakeLists.txt
===================================================================
--- /code/branches/objecthierarchie/src/CMakeLists.txt	(revision 223)
+++ /code/branches/objecthierarchie/src/CMakeLists.txt	(revision 224)
@@ -2,5 +2,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(SRC_FILES orxonox.cc IdentifierList.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 Iterator.h OrxonoxClass.h BaseObject.h Test.h test1.h test2.h test3.h)
 
Index: /code/branches/objecthierarchie/src/Identifier.cc
===================================================================
--- /code/branches/objecthierarchie/src/Identifier.cc	(revision 223)
+++ /code/branches/objecthierarchie/src/Identifier.cc	(revision 224)
@@ -11,18 +11,8 @@
     {
         this->bCreatedOneObject_ = false;
-//        this->directParents_ = new IdentifierList();
-//        this->allParents_ = new IdentifierList();
-//        this->directChildren_ = new IdentifierList();
-//        this->allChildren_ = new IdentifierList();
-//        this->objects_ = new ObjectList();
     }
 
     Identifier::~Identifier()
     {
-//        delete this->directParents_;
-//        delete this->allParents_;
-//        delete this->directChildren_;
-//        delete this->allChildren_;
-//        delete this->objects_;
         delete &this->name_;
     }
@@ -76,29 +66,4 @@
     }
 
-    void Identifier::addObject(OrxonoxClass* object)
-    {
-        std::cout << "*** Added object to " << this->name_ << "-list.\n";
-        this->objects_.add(object);
-    }
-
-    void Identifier::removeObject(OrxonoxClass* 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_;
-        while (temp)
-        {
-            temp->identifier_->removeObject(object);
-            temp = temp->next_;
-        }
-    }
-
     bool Identifier::isA(Identifier* identifier)
     {
Index: /code/branches/objecthierarchie/src/Identifier.h
===================================================================
--- /code/branches/objecthierarchie/src/Identifier.h	(revision 223)
+++ /code/branches/objecthierarchie/src/Identifier.h	(revision 224)
@@ -26,5 +26,7 @@
     class BaseObject;
 
-    // ##### Identifier #####
+    // ###############################
+    // ###       Identifier        ###
+    // ###############################
     class Identifier
     {
@@ -35,10 +37,6 @@
         friend class BaseIdentifier;
 
-        template <class T>
-        friend class Iterator;
-
         public:
-            void addObject(OrxonoxClass* object);
-            void removeObject(OrxonoxClass* object);
+            virtual void removeObject(OrxonoxClass* object) {};
 
             virtual BaseObject* fabricate() {};
@@ -73,5 +71,4 @@
             IdentifierList allChildren_;
 
-            ObjectList objects_;
             std::string name_;
 
@@ -83,8 +80,13 @@
 
 
-    // ##### ClassIdentifier #####
+    // ###############################
+    // ###     ClassIdentifier     ###
+    // ###############################
     template <class T>
     class ClassIdentifier : public Identifier
     {
+        template <class U>
+        friend class Iterator;
+
         public:
             static ClassIdentifier<T>* registerClass(IdentifierList* parents, std::string name, bool bRootClass, bool bIsAbstractClass);
@@ -92,4 +94,6 @@
             BaseObject* fabricate();
             T* fabricateClass();
+            static void addObject(T* object);
+            void removeObject(OrxonoxClass* object);
 
         private:
@@ -99,5 +103,5 @@
 
             static ClassIdentifier<T>* pointer_s;
-
+            ObjectList<T> objects_s;
     };
 
@@ -182,5 +186,35 @@
     }
 
-    // ##### BaseIdentifier #####
+    template <class T>
+    void ClassIdentifier<T>::addObject(T* object)
+    {
+        std::cout << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n";
+        ClassIdentifier<T>::getIdentifier()->objects_s.add(object);
+    }
+
+    template <class T>
+    void ClassIdentifier<T>::removeObject(OrxonoxClass* 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_s.remove(object, bIterateForwards);
+
+        IdentifierListElement* temp = this->directParents_.first_;
+        while (temp)
+        {
+            temp->identifier_->removeObject(object);
+            temp = temp->next_;
+        }
+    }
+
+
+    // ###############################
+    // ###     BaseIdentifier      ###
+    // ###############################
     template <class B>
     class BaseIdentifier
Index: /code/branches/objecthierarchie/src/IdentifierIncludes.h
===================================================================
--- /code/branches/objecthierarchie/src/IdentifierIncludes.h	(revision 223)
+++ /code/branches/objecthierarchie/src/IdentifierIncludes.h	(revision 224)
@@ -13,5 +13,5 @@
     if (Identifier::isCreatingHierarchy() && this->getParents()) \
         this->getParents()->add(this->getIdentifier()); \
-    this->getIdentifier()->addObject(this)
+    ClassIdentifier<ClassName>::addObject(this)
 
 #define registerRootObject(ClassName) \
@@ -27,5 +27,5 @@
     if (Identifier::isCreatingHierarchy() && this->getParents()) \
         this->getParents()->add(this->getIdentifier()); \
-    this->getIdentifier()->addObject(this)
+    ClassIdentifier<ClassName>::addObject(this)
 
 #define registerObject(ClassName) \
Index: /code/branches/objecthierarchie/src/Iterator.h
===================================================================
--- /code/branches/objecthierarchie/src/Iterator.h	(revision 223)
+++ /code/branches/objecthierarchie/src/Iterator.h	(revision 224)
@@ -10,6 +10,6 @@
             Iterator()
             {
-                this->elementForwards_ = ClassIdentifier<T>::getIdentifier()->objects_.first_;
-                this->elementBackwards_ = ClassIdentifier<T>::getIdentifier()->objects_.last_;
+                this->elementForwards_ = ClassIdentifier<T>::getIdentifier()->objects_s.first_;
+                this->elementBackwards_ = ClassIdentifier<T>::getIdentifier()->objects_s.last_;
                 this->iteratingForwards_ = true;
             }
@@ -51,7 +51,7 @@
             {
                 if (this->iteratingForwards_)
-                    return dynamic_cast<T*>(this->elementForwards_->object_);
+                    return /*dynamic_cast<T*>*/(this->elementForwards_->object_);
                 else
-                    return dynamic_cast<T*>(this->elementBackwards_->object_);
+                    return /*dynamic_cast<T*>*/(this->elementBackwards_->object_);
             }
 
@@ -59,7 +59,7 @@
             {
                 if (this->iteratingForwards_)
-                    return dynamic_cast<T*>(this->elementForwards_->object_);
+                    return /*dynamic_cast<T*>*/(this->elementForwards_->object_);
                 else
-                    return dynamic_cast<T*>(this->elementBackwards_->object_);
+                    return /*dynamic_cast<T*>*/(this->elementBackwards_->object_);
 
             }
@@ -86,6 +86,6 @@
 
         private:
-            ObjectListElement* elementForwards_;
-            ObjectListElement* elementBackwards_;
+            ObjectListElement<T>* elementForwards_;
+            ObjectListElement<T>* elementBackwards_;
             bool iteratingForwards_;
     };
Index: de/branches/objecthierarchie/src/ObjectList.cc
===================================================================
--- /code/branches/objecthierarchie/src/ObjectList.cc	(revision 223)
+++ 	(revision )
@@ -1,134 +1,0 @@
-#include "ObjectList.h"
-
-namespace orxonox
-{
-    // ###############################
-    // ###       ObjectList        ###
-    // ###############################
-    ObjectList::ObjectList()
-    {
-        this->first_ = 0;
-        this->last_ = 0;
-    }
-
-    ObjectList::~ObjectList()
-    {
-        ObjectListElement* temp;
-        while (this->first_)
-        {
-            temp = this->first_->next_;
-            delete this->first_;
-            this->first_ = temp;
-        }
-    }
-
-    void ObjectList::add(OrxonoxClass* object)
-    {
-        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, bool bIterateForwards)
-    {
-        if (!object || !this->first_ || !this->last_)
-            return;
-
-        if (this->first_ == this->last_)
-        {
-            if (this->first_->object_ == object)
-            {
-                delete this->first_;
-                this->first_ = 0;
-                this->last_ = 0;
-            }
-
-            return;
-        }
-
-        if (bIterateForwards)
-        {
-            if (this->first_->object_ == object)
-            {
-                ObjectListElement* temp = this->first_->next_;
-                delete this->first_;
-                this->first_ = temp;
-
-                return;
-            }
-
-            ObjectListElement* temp = this->first_;
-            while (temp->next_)
-            {
-                if (temp->next_->object_ == object)
-                {
-                    ObjectListElement* temp2 = temp->next_->next_;
-                    delete temp->next_;
-                    temp->next_ = temp2;
-                    if (temp2)
-                        temp2->prev_ = temp;
-                    else
-                        this->last_ = 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;
-                    if (temp2)
-                        temp2->next_ = temp;
-                    else
-                        this->first_ = temp;
-
-                    return;
-                }
-
-                temp = temp->prev_;
-            }
-        }
-    }
-
-
-    // ###############################
-    // ###    ObjectListElement    ###
-    // ###############################
-    ObjectListElement::ObjectListElement(OrxonoxClass* object)
-    {
-        this->object_ = object;
-        this->next_ = 0;
-        this->prev_ = 0;
-    }
-
-    ObjectListElement::~ObjectListElement()
-    {
-    }
-}
Index: /code/branches/objecthierarchie/src/ObjectList.h
===================================================================
--- /code/branches/objecthierarchie/src/ObjectList.h	(revision 223)
+++ /code/branches/objecthierarchie/src/ObjectList.h	(revision 224)
@@ -6,15 +6,37 @@
     class OrxonoxClass;
 
+    // ###############################
+    // ###    ObjectListElement    ###
+    // ###############################
+    template <class T>
     class ObjectListElement
     {
         public:
-            ObjectListElement(OrxonoxClass* object);
+            ObjectListElement(T* object);
             ~ObjectListElement();
 
-            OrxonoxClass* object_;
+            T* object_;
             ObjectListElement* next_;
             ObjectListElement* prev_;
     };
 
+    template <class T>
+    ObjectListElement<T>::ObjectListElement(T* object)
+    {
+        this->object_ = object;
+        this->next_ = 0;
+        this->prev_ = 0;
+    }
+
+    template <class T>
+    ObjectListElement<T>::~ObjectListElement()
+    {
+    }
+
+
+    // ###############################
+    // ###       ObjectList        ###
+    // ###############################
+    template <class T>
     class ObjectList
     {
@@ -22,10 +44,128 @@
             ObjectList();
             ~ObjectList();
-            void add(OrxonoxClass* object);
+            void add(T* object);
             void remove(OrxonoxClass* object, bool bIterateForwards = true);
 
-            ObjectListElement* first_;
-            ObjectListElement* last_;
+            ObjectListElement<T>* first_;
+            ObjectListElement<T>* last_;
     };
+
+    template <class T>
+    ObjectList<T>::ObjectList()
+    {
+        this->first_ = 0;
+        this->last_ = 0;
+    }
+
+    template <class T>
+    ObjectList<T>::~ObjectList()
+    {
+        ObjectListElement<T>* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    template <class T>
+    void ObjectList<T>::add(T* object)
+    {
+        if (!this->last_)
+        {
+            this->last_ = new ObjectListElement<T>(object);
+            this->first_ = this->last_;
+        }
+        else
+        {
+            ObjectListElement<T>* temp = this->last_;
+            this->last_ = new ObjectListElement<T>(object);
+            this->last_->prev_ = temp;
+            temp->next_ = this->last_;
+        }
+    }
+
+    template <class T>
+    void ObjectList<T>::remove(OrxonoxClass* object, bool bIterateForwards)
+    {
+        if (!object || !this->first_ || !this->last_)
+            return;
+
+        if (this->first_ == this->last_)
+        {
+            if (this->first_->object_ == object)
+            {
+                delete this->first_;
+                this->first_ = 0;
+                this->last_ = 0;
+            }
+
+            return;
+        }
+
+        if (bIterateForwards)
+        {
+            if (this->first_->object_ == object)
+            {
+                ObjectListElement<T>* temp = this->first_->next_;
+                delete this->first_;
+                this->first_ = temp;
+                this->first_->prev_ = 0;
+
+                return;
+            }
+
+            ObjectListElement<T>* temp = this->first_;
+            while (temp->next_)
+            {
+                if (temp->next_->object_ == object)
+                {
+                    ObjectListElement<T>* temp2 = temp->next_->next_;
+                    delete temp->next_;
+                    temp->next_ = temp2;
+                    if (temp2)
+                        temp2->prev_ = temp;
+                    else
+                        this->last_ = temp;
+
+                    return;
+                }
+
+                temp = temp->next_;
+            }
+        }
+        else
+        {
+            if (this->last_->object_ == object)
+            {
+                ObjectListElement<T>* temp = this->last_->prev_;
+                delete this->last_;
+                this->last_ = temp;
+                this->last_->next_ = 0;
+
+                return;
+            }
+
+            ObjectListElement<T>* temp = this->last_;
+            while (temp->prev_)
+            {
+                if (temp->prev_->object_ == object)
+                {
+                    ObjectListElement<T>* temp2 = temp->prev_->prev_;
+                    delete temp->prev_;
+                    temp->prev_ = temp2;
+                    if (temp2)
+                        temp2->next_ = temp;
+                    else
+                        this->first_ = temp;
+
+                    return;
+                }
+
+                temp = temp->prev_;
+            }
+        }
+    }
 }
 
Index: /code/branches/objecthierarchie/src/orxonox.cc
===================================================================
--- /code/branches/objecthierarchie/src/orxonox.cc	(revision 223)
+++ /code/branches/objecthierarchie/src/orxonox.cc	(revision 224)
@@ -528,16 +528,16 @@
 */
         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;
+        Identifier* test10_01 = Class(A1B2);
+        Identifier* test10_02 = Class(A2);
+        Identifier* test10_03 = Class(A3B1C1);
+
+
+        BaseObject* test10_04 = test10_01->fabricate();
+        BaseObject* test10_05 = test10_02->fabricate();
+        BaseObject* test10_06 = test10_03->fabricate();
+
+        BaseObject* test10_07;
         for (int i = 0; i < 10; i++)
-            test9_07 = Factory("A1B1C1");
+            test10_07 = Factory("A1B1C1");
 
         std::cout << "1\n";
@@ -569,10 +569,18 @@
 
         std::cout << "2\n";
-        BaseObject* test9_08;
+        BaseObject* test10_08;
+        BaseObject* test10_09;
+        BaseObject* test10_10;
         for (int i = 0; i < 10; i++)
         {
-            test9_08 = Factory("A2B1C1");
-            test9_08->name_ = "A2B1C1#";
-            test9_08->name_ += ('0' + i);
+            test10_08 = Factory("A2B1C1");
+            test10_08->name_ = "A2B1C1#";
+            test10_08->name_ += ('0' + i);
+
+            if (i == 0)
+                test10_09 = test10_08;
+
+            if (i == 5)
+                test10_10 = test10_08;
         }
 
@@ -585,4 +593,35 @@
 
         std::cout << "4\n";
+        delete test10_08;
+
+        std::cout << "5\n";
+        for (Iterator<A2B1C1> it; it; it++)
+            std::cout << "Name: " << it->name_ << "\n";
+
+        std::cout << "6\n";
+        for (Iterator<A2B1C1> it; it; it--)
+            std::cout << "Name: " << it->name_ << "\n";
+
+        std::cout << "7\n";
+        delete test10_09;
+
+        std::cout << "8\n";
+        for (Iterator<A2B1C1> it; it; it++)
+            std::cout << "Name: " << it->name_ << "\n";
+
+        std::cout << "9\n";
+        for (Iterator<A2B1C1> it; it; it--)
+            std::cout << "Name: " << it->name_ << "\n";
+
+        std::cout << "10\n";
+        delete test10_10;
+
+        std::cout << "11\n";
+        for (Iterator<A2B1C1> it; it; it++)
+            std::cout << "Name: " << it->name_ << "\n";
+
+        std::cout << "12\n";
+        for (Iterator<A2B1C1> it; it; it--)
+            std::cout << "Name: " << it->name_ << "\n";
 
       }
