Index: code/branches/core/src/orxonox/core/CMakeLists.txt
===================================================================
--- code/branches/core/src/orxonox/core/CMakeLists.txt	(revision 804)
+++ code/branches/core/src/orxonox/core/CMakeLists.txt	(revision 805)
@@ -14,4 +14,5 @@
   Language.cc
   ClassTreeMask.cc
+  IdentifierDistributor.cc
 )
 
Index: code/branches/core/src/orxonox/core/ClassFactory.h
===================================================================
--- code/branches/core/src/orxonox/core/ClassFactory.h	(revision 804)
+++ code/branches/core/src/orxonox/core/ClassFactory.h	(revision 805)
@@ -73,6 +73,6 @@
     {
         COUT(4) << "*** Create entry for " << name << " in Factory." << std::endl;
-        ClassIdentifier<T>::getIdentifier()->addFactory(new ClassFactory<T>);
-        Factory::add(name, ClassIdentifier<T>::getIdentifier());
+        ClassManager<T>::getIdentifier(name)->addFactory(new ClassFactory<T>);
+        Factory::add(name, ClassManager<T>::getIdentifier(name));
 
         return true;
Index: code/branches/core/src/orxonox/core/ClassManager.h
===================================================================
--- code/branches/core/src/orxonox/core/ClassManager.h	(revision 805)
+++ code/branches/core/src/orxonox/core/ClassManager.h	(revision 805)
@@ -0,0 +1,111 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _ClassManager_H__
+#define _ClassManager_H__
+
+#include <string>
+
+#include "Identifier.h"
+#include "IdentifierDistributor.h"
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    template <class T>
+    class ClassManager
+    {
+        public:
+            static ClassManager<T>* getSingleton();
+            static ClassIdentifier<T>* getIdentifier(const std::string& name);
+            static const std::string& getName();
+
+        private:
+            ClassManager();
+            ClassManager(const ClassIdentifier<T>& identifier) {}    // don't copy
+            ~ClassManager() {}                                       // don't delete
+
+            bool bInitialized_;
+//            std::string name_;
+            ClassIdentifier<T>* identifier_;
+    };
+
+    /**
+        @brief Constructor: Marks the ClassManager as uninitialized.
+    */
+    template <class T>
+    ClassManager<T>::ClassManager()
+    {
+        this->bInitialized_ = false;
+    }
+
+    template <class T>
+    ClassManager<T>* ClassManager<T>::getSingleton()
+    {
+        static ClassManager<T> theOneAndOnlyInstance = ClassManager<T>();
+        return &theOneAndOnlyInstance;
+    }
+
+    /**
+        @brief Creates the only instance of this class for the template class T and retrieves a unique Identifier.
+        @return The unique Identifier
+    */
+    template <class T>
+    ClassIdentifier<T>* ClassManager<T>::getIdentifier(const std::string& name)
+    {
+        if (!ClassManager<T>::getSingleton()->bInitialized_)
+        {
+
+            COUT(4) << "*** Create Identifier Singleton." << std::endl;
+            ClassIdentifier<T>* temp = new ClassIdentifier<T>();
+            ClassManager<T>::getSingleton()->identifier_ = (ClassIdentifier<T>*)IdentifierDistributor::getIdentifier(name, temp);
+            if (temp != ClassManager<T>::getSingleton()->identifier_)
+                delete temp;
+            ClassManager<T>::getSingleton()->bInitialized_ = true;
+        }
+
+        return ClassManager<T>::getSingleton()->identifier_;
+    }
+
+    /**
+        @brief Returns the name of the class the ClassManager belongs to.
+        @return The name
+    */
+    template <class T>
+    const std::string& ClassManager<T>::getName()
+    {
+        static std::string unknownClassName = std::string("unknown");
+
+        if (ClassManager<T>::getSingleton()->bInitialized)
+            return ClassManager<T>::getSingleton()->identifier_->getName();
+        else
+            return unknownClassName;
+    }
+}
+
+#endif /* _ClassManager_H__ */
Index: code/branches/core/src/orxonox/core/ClassTreeMask.cc
===================================================================
--- code/branches/core/src/orxonox/core/ClassTreeMask.cc	(revision 804)
+++ code/branches/core/src/orxonox/core/ClassTreeMask.cc	(revision 805)
@@ -156,5 +156,5 @@
     ClassTreeMask::ClassTreeMask()
     {
-        this->root_ = new ClassTreeMaskNode(ClassIdentifier<BaseObject>::getIdentifier(), true);
+        this->root_ = new ClassTreeMaskNode(ClassManager<BaseObject>::getIdentifier("BaseObject"), true);
     }
 
@@ -227,5 +227,5 @@
     {
         delete this->root_;
-        this->root_ = new ClassTreeMaskNode(ClassIdentifier<BaseObject>::getIdentifier(), true);
+        this->root_ = new ClassTreeMaskNode(ClassManager<BaseObject>::getIdentifier("BaseObject"), true);
     }
 
@@ -237,5 +237,4 @@
     bool ClassTreeMask::isIncluded(ClassTreeMaskNode* node, const Identifier* subclass) const
     {
-std::cout << "1_0: " << ClassIdentifier<BaseObject>::getIdentifier() << std::endl;
 std::cout << "1_1: " << subclass->getName() << " (" << subclass << ") / " << node->getClass()->getName() << " (" << node->getClass() << ")" << std::endl;
         // Check if the searched subclass is of the same type as the class in the current node or a derivative
Index: code/branches/core/src/orxonox/core/CoreIncludes.h
===================================================================
--- code/branches/core/src/orxonox/core/CoreIncludes.h	(revision 804)
+++ code/branches/core/src/orxonox/core/CoreIncludes.h	(revision 805)
@@ -44,4 +44,5 @@
 // All needed header-files
 #include "Identifier.h"
+#include "ClassManager.h"
 #include "Factory.h"
 #include "ClassFactory.h"
@@ -57,8 +58,8 @@
 */
 #define InternRegisterObject(ClassName, bRootClass) \
-    this->setIdentifier(orxonox::ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, bRootClass)); \
+    this->setIdentifier(orxonox::ClassManager<ClassName>::getIdentifier(#ClassName)->registerClass(this->getParents(), #ClassName, bRootClass)); \
     if (orxonox::Identifier::isCreatingHierarchy() && this->getParents()) \
         this->getParents()->add(this->getIdentifier()); \
-    orxonox::ClassIdentifier<ClassName>::addObject(this)
+    orxonox::ClassManager<ClassName>::getIdentifier(#ClassName)->addObject(this)
 
 /**
@@ -111,5 +112,5 @@
 */
 #define Class(ClassName) \
-    ClassIdentifier<ClassName>::getIdentifier()
+    ClassManager<ClassName>::getIdentifier(#ClassName)
 
 /**
Index: code/branches/core/src/orxonox/core/CorePrereqs.h
===================================================================
--- code/branches/core/src/orxonox/core/CorePrereqs.h	(revision 804)
+++ code/branches/core/src/orxonox/core/CorePrereqs.h	(revision 805)
@@ -70,4 +70,6 @@
   template <class T>
   class ClassIdentifier;
+  template <class T>
+  class ClassManager;
   class ConfigValueContainer;
   class DebugLevel;
@@ -75,4 +77,5 @@
   class Factory;
   class Identifier;
+  class IdentifierDistributor;
   class IdentifierList;
   class IdentifierListElement;
Index: code/branches/core/src/orxonox/core/Identifier.cc
===================================================================
--- code/branches/core/src/orxonox/core/Identifier.cc	(revision 804)
+++ code/branches/core/src/orxonox/core/Identifier.cc	(revision 805)
@@ -118,10 +118,10 @@
     /**
         @returns a reference to the Identifier map, containing all Identifiers.
-    */
+    *//*
     std::map<std::string, Identifier*>& Identifier::getIdentifierMap()
     {
         static std::map<std::string, Identifier*> identifierMapStaticReference = std::map<std::string, Identifier*>();
         return identifierMapStaticReference;
-    }
+    }*/
 
     /**
Index: code/branches/core/src/orxonox/core/Identifier.h
===================================================================
--- code/branches/core/src/orxonox/core/Identifier.h	(revision 804)
+++ code/branches/core/src/orxonox/core/Identifier.h	(revision 805)
@@ -89,10 +89,10 @@
     {
         template <class T>
-        friend class ClassIdentifier; // Forward declaration
+        friend class ClassIdentifier;
 
         template <class T>
-        friend class SubclassIdentifier; // Forward declaration
-
-        friend class Factory; // Forward declaration
+        friend class SubclassIdentifier;
+
+        friend class Factory;
 
         public:
@@ -106,5 +106,5 @@
             bool isParentOf(const Identifier* identifier) const;
 
-            static std::map<std::string, Identifier*>& getIdentifierMap();
+//            static std::map<std::string, Identifier*>& getIdentifierMap();
 
             /** @brief Removes all objects of the corresponding class. */
@@ -186,8 +186,11 @@
     class ClassIdentifier : public Identifier
     {
+        template <class TT>
+        friend class ClassManager;
+
         public:
-            static ClassIdentifier<T>* registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass);
-            static void addObject(T* object);
-            static ClassIdentifier<T>* getIdentifier();
+            ClassIdentifier<T>* registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass);
+            void addObject(T* object);
+//            static ClassIdentifier<T>* getIdentifier();
             void removeObjects() const;
             void setName(const std::string& name);
@@ -225,17 +228,17 @@
 
         // Check if at least one object of the given type was created
-        if (!getIdentifier()->bCreatedOneObject_)
+        if (!this->bCreatedOneObject_)
         {
             // If no: We have to store the informations and initialize the Identifier
-            getIdentifier()->setName(name);
+            this->setName(name);
 
             COUT(4) << "*** Register Class in " << name << "-Singleton -> Initialize Singleton." << std::endl;
             if (bRootClass)
-                getIdentifier()->initialize(NULL); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case.
+                this->initialize(NULL); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case.
             else
-                getIdentifier()->initialize(parents);
+                this->initialize(parents);
         }
 
-        return getIdentifier();
+        return this;
     }
 
@@ -243,5 +246,5 @@
         @brief Creates the only instance of this class for the template class T.
         @return The Identifier itself
-    */
+    *//*
     template <class T>
     ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
@@ -258,5 +261,5 @@
         return &theOneAndOnlyInstance;
     }
-
+*/
     /**
         @brief Sets the name of the class.
@@ -266,9 +269,9 @@
     void ClassIdentifier<T>::setName(const std::string& name)
     {
-        // Make sure we didn't already set the name, to avoid duplicate entries in the Identifier map
+//        // Make sure we didn't already set the name, to avoid duplicate entries in the Identifier map
         if (!this->bSetName_)
         {
             this->name_ = name;
-            this->getIdentifierMap().insert(std::pair<std::string, Identifier*>(name, this));
+//            this->getIdentifierMap().insert(std::pair<std::string, Identifier*>(name, this));
             this->bSetName_ = true;
         }
@@ -282,6 +285,6 @@
     void ClassIdentifier<T>::addObject(T* object)
     {
-        COUT(4) << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list." << std::endl;
-        object->getMetaList().add(ClassIdentifier<T>::getIdentifier()->objects_, ClassIdentifier<T>::getIdentifier()->objects_->add(object));
+        COUT(4) << "*** Added object to " << this->getName() << "-list." << std::endl;
+        object->getMetaList().add(this->objects_, this->objects_->add(object));
     }
 
@@ -314,5 +317,9 @@
             SubclassIdentifier()
             {
-                this->identifier_ = ClassIdentifier<T>::getIdentifier();
+                T* temp = new T;
+                this->subclassIdentifier_ = temp->getIdentifier();
+                delete temp;
+
+                this->identifier_ = this->subclassIdentifier_;
             }
 
@@ -324,8 +331,8 @@
             SubclassIdentifier<T>& operator=(Identifier* identifier)
             {
-                if (!identifier->isA(ClassIdentifier<T>::getIdentifier()))
+                if (!identifier->isA(this->subclassIdentifier_))
                 {
-                    COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!" << std::endl;
-                    COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
+                    COUT(1) << "Error: Class " << identifier->getName() << " is not a " << this->subclassIdentifier_->getName() << "!" << std::endl;
+                    COUT(1) << "Error: SubclassIdentifier<" << this->subclassIdentifier_->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl;
                     COUT(1) << "Aborting..." << std::endl;
                     abort();
@@ -372,5 +379,5 @@
                     if (this->identifier_)
                     {
-                        COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!" << std::endl;
+                        COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << this->subclassIdentifier_->getName() << "!" << std::endl;
                         COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl;
                         COUT(1) << "Aborting..." << std::endl;
@@ -407,5 +414,6 @@
 
         private:
-            Identifier* identifier_;        //!< The assigned identifier
+            Identifier* identifier_;            //!< The assigned identifier
+            Identifier* subclassIdentifier_;    //!< The identifier of the subclass
     };
 }
Index: code/branches/core/src/orxonox/core/IdentifierDistributor.cc
===================================================================
--- code/branches/core/src/orxonox/core/IdentifierDistributor.cc	(revision 805)
+++ code/branches/core/src/orxonox/core/IdentifierDistributor.cc	(revision 805)
@@ -0,0 +1,48 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "IdentifierDistributor.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    Identifier* IdentifierDistributor::getIdentifier(const std::string& name, Identifier* proposal)
+    {
+        static IdentifierDistributor theOneAndOnlyInstance = IdentifierDistributor();
+
+        std::map<std::string, Identifier*>::const_iterator it = theOneAndOnlyInstance.identifiers_.find(name);
+        if (it != theOneAndOnlyInstance.identifiers_.end())
+        {
+            return (*it).second;
+        }
+        else
+        {
+            theOneAndOnlyInstance.identifiers_[name] = proposal;
+            return proposal;
+        }
+    }
+}
Index: code/branches/core/src/orxonox/core/IdentifierDistributor.h
===================================================================
--- code/branches/core/src/orxonox/core/IdentifierDistributor.h	(revision 805)
+++ code/branches/core/src/orxonox/core/IdentifierDistributor.h	(revision 805)
@@ -0,0 +1,51 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _IdentifierDistributor_H__
+#define _IdentifierDistributor_H__
+
+#include <map>
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+    class IdentifierDistributor
+    {
+        public:
+            static Identifier* getIdentifier(const std::string& name, Identifier* proposal);
+
+        private:
+            IdentifierDistributor() {};
+            IdentifierDistributor(const IdentifierDistributor& distributor) {}
+            ~IdentifierDistributor() {}
+
+            std::map<std::string, Identifier*> identifiers_;
+    };
+}
+
+#endif /* _IdentifierDistributor_H__ */
Index: code/branches/core/src/orxonox/core/Iterator.h
===================================================================
--- code/branches/core/src/orxonox/core/Iterator.h	(revision 804)
+++ code/branches/core/src/orxonox/core/Iterator.h	(revision 805)
@@ -150,11 +150,7 @@
                 @return True if the iterator points to an existing object.
             */
-            bool operator!=(int compare)
+            bool operator!=(ObjectListElement<T>* compare)
             {
-                // Comparing with anything except zero makes no sense
-                if (compare != 0)
-                    COUT(2) << "Warning: Comparing the " << ClassIdentifier<T>::getIdentifier()->getName() << "-List-Iterator with " << compare << " has no effect. Only comparison with 0 works." << std::endl;
-
-                return (this->element_ != 0);
+                return (this->element_ != compare);
             }
 
Index: code/branches/core/src/orxonox/core/MetaObjectList.h
===================================================================
--- code/branches/core/src/orxonox/core/MetaObjectList.h	(revision 804)
+++ code/branches/core/src/orxonox/core/MetaObjectList.h	(revision 805)
@@ -99,5 +99,5 @@
 
 
-        COUT(4) << "*** Removing Object from " << ClassIdentifier<T>::getIdentifier()->getName() << "-list." << std::endl;
+        COUT(4) << "*** Removing Object from " << this->element_->object_->getIdentifier()->getName() << "-list." << std::endl;
         delete this->element_;
     }
