Index: /code/branches/core6/src/libraries/core/CoreIncludes.h
===================================================================
--- /code/branches/core6/src/libraries/core/CoreIncludes.h	(revision 9645)
+++ /code/branches/core6/src/libraries/core/CoreIncludes.h	(revision 9646)
@@ -90,10 +90,45 @@
 
 /**
+    @brief Registers the class in the framework.
+    @param ClassName The name of the class
+*/
+#define RegisterClass(ClassName) \
+    RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), true)
+
+/**
+    @brief Registers the class in the framework (for classes without arguments in their constructor).
+    @param ClassName The name of the class
+*/
+#define RegisterClassNoArgs(ClassName) \
+    RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryNoArgs<ClassName>(), true)
+
+/**
+    @brief Registers the class in the framework (for classes which should not be loaded through XML).
+    @param ClassName The name of the class
+*/
+#define RegisterUnloadableClass(ClassName) \
+    RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), false)
+
+/**
+    @brief Registers an abstract class in the framework.
+    @param ClassName The name of the class
+*/
+#define RegisterAbstractClass(ClassName) \
+    RegisterClassWithFactory(ClassName, static_cast<ClassFactory<ClassName>*>(NULL), false)
+
+/**
+    @brief Registers the class in the framework with a given Factory.
+    @param ClassName The name of the class
+*/
+#define RegisterClassWithFactory(ClassName, FactoryInstance, bLoadable) \
+    Identifier& _##ClassName##Identifier = orxonox::registerClass<ClassName>(#ClassName, FactoryInstance, bLoadable)
+
+/**
     @brief Intern macro, containing the common parts of @c RegisterObject and @c RegisterRootObject.
     @param ClassName The name of the class
     @param bRootClass True if the class is directly derived from orxonox::OrxonoxClass
 */
-#define InternRegisterObject(ClassName, bRootClass) \
-    if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initializeObject(this, #ClassName, bRootClass)) \
+#define InternRegisterObject(ClassName) \
+    if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initializeObject(this)) \
         return; \
     else \
@@ -105,5 +140,5 @@
 */
 #define RegisterObject(ClassName) \
-    InternRegisterObject(ClassName, false)
+    InternRegisterObject(ClassName)
 
 /**
@@ -115,26 +150,5 @@
 */
 #define RegisterRootObject(ClassName) \
-    InternRegisterObject(ClassName, true)
-
-/**
-    @brief Registers the class in the framework.
-    @param ClassName The name of the class
-*/
-#define RegisterClass(ClassName) \
-    RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), true)
-
-/**
-    @brief Registers the class in the framework (for classes which should not be loaded through XML).
-    @param ClassName The name of the class
-*/
-#define RegisterUnloadableClass(ClassName) \
-    RegisterClassWithFactory(ClassName, new orxonox::ClassFactoryWithContext<ClassName>(), false)
-
-/**
-    @brief Registers the class in the framework with a given Factory.
-    @param ClassName The name of the class
-*/
-#define RegisterClassWithFactory(ClassName, FactoryInstance, bLoadable) \
-    Identifier* _##ClassName##Identifier = orxonox::registerClass<ClassName>(#ClassName, FactoryInstance, bLoadable)
+    InternRegisterObject(ClassName)
 
 /**
@@ -152,5 +166,5 @@
      */
     template <class T>
-    inline Identifier* registerClass(const std::string& name, ClassFactory<T>* factory, bool bLoadable = true)
+    inline Identifier& registerClass(const std::string& name, ClassFactory<T>* factory, bool bLoadable = true)
     {
         return registerClass<T>(name, static_cast<Factory*>(factory), bLoadable);
@@ -164,5 +178,5 @@
      */
     template <class T>
-    inline Identifier* registerClass(const std::string& name, Factory* factory, bool bLoadable = true)
+    inline Identifier& registerClass(const std::string& name, Factory* factory, bool bLoadable = true)
     {
         orxout(verbose, context::misc::factory) << "Create entry for " << name << " in Factory." << endl;
@@ -170,5 +184,5 @@
         identifier->setFactory(factory);
         identifier->setLoadable(bLoadable);
-        return identifier;
+        return *identifier;
     }
 
Index: /code/branches/core6/src/libraries/core/class/CMakeLists.txt
===================================================================
--- /code/branches/core6/src/libraries/core/class/CMakeLists.txt	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/CMakeLists.txt	(revision 9646)
@@ -3,3 +3,5 @@
   Identifier.cc
   IdentifierManager.cc
+  OrxonoxClass.cc
+  OrxonoxInterface.cc
 )
Index: /code/branches/core6/src/libraries/core/class/Identifiable.cc
===================================================================
--- /code/branches/core6/src/libraries/core/class/Identifiable.cc	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/Identifiable.cc	(revision 9646)
@@ -35,4 +35,5 @@
 
 #include <cassert>
+#include "core/CoreIncludes.h"
 #include "core/object/Context.h"
 #include "Identifier.h"
@@ -40,4 +41,6 @@
 namespace orxonox
 {
+    RegisterClassNoArgs(Identifiable);
+
     /**
         @brief Constructor: Sets the default values.
@@ -46,17 +49,7 @@
     {
         this->identifier_ = 0;
-        this->parents_ = 0;
-        // Optimisation
-        this->objectPointers_.reserve(6);
-    }
+        this->objectPointers_.reserve(6); // Optimisation
 
-    /**
-        @brief Destructor: Removes the object from the object-lists
-    */
-    Identifiable::~Identifiable()
-    {
-        // parents_ exists only if isCreatingHierarchy() of the associated Identifier returned true while creating the class
-        if (this->parents_)
-            delete this->parents_;
+        RegisterObject(Identifiable);
     }
 
Index: /code/branches/core6/src/libraries/core/class/Identifiable.h
===================================================================
--- /code/branches/core6/src/libraries/core/class/Identifiable.h	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/Identifiable.h	(revision 9646)
@@ -55,5 +55,5 @@
         public:
             Identifiable();
-            virtual ~Identifiable();
+            virtual ~Identifiable() {}
 
             /// Returns the Identifier of the object.
@@ -119,5 +119,4 @@
         private:
             Identifier* identifier_;               //!< The Identifier of the object
-            std::set<const Identifier*>* parents_; //!< List of all parents of the object
 
             /// 'Fast map' that holds this-pointers of all derived types
Index: /code/branches/core6/src/libraries/core/class/Identifier.cc
===================================================================
--- /code/branches/core6/src/libraries/core/class/Identifier.cc	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/Identifier.cc	(revision 9646)
@@ -37,4 +37,5 @@
 
 #include "util/StringUtils.h"
+#include "core/CoreIncludes.h"
 #include "core/config/ConfigValueContainer.h"
 #include "core/XMLPort.h"
@@ -52,7 +53,6 @@
         : classID_(IdentifierManager::getInstance().getUniqueClassId())
     {
-        this->bCreatedOneObject_ = false;
-        this->bSetName_ = false;
         this->factory_ = 0;
+        this->bInitialized_ = false;
         this->bLoadable_ = false;
 
@@ -80,80 +80,12 @@
 
     /**
-        @brief Registers a class, which means that the name and the parents get stored.
-        @param parents A list, containing the Identifiers of all parents of the class
-        @param bRootClass True if the class is either an Interface or the BaseObject itself
-    */
-    void Identifier::initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass)
-    {
-        // Check if at least one object of the given type was created
-        if (!this->bCreatedOneObject_ && IdentifierManager::getInstance().isCreatingHierarchy())
-        {
-            // If no: We have to store the information and initialize the Identifier
-            orxout(verbose, context::identifier) << "Register Class in ClassIdentifier<" << this->getName() << ">-Singleton -> Initialize Singleton." << endl;
-            if (bRootClass)
-                this->initialize(0); // 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
-                this->initialize(parents);
-        }
-    }
-
-    /**
-        @brief Initializes the Identifier with a list containing all parents of the class the Identifier belongs to.
-        @param parents A list containing all parents
-    */
-    void Identifier::initialize(std::set<const Identifier*>* parents)
-    {
-        orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << this->name_ << ">-Singleton." << endl;
-        this->bCreatedOneObject_ = true;
-
-        if (parents)
-        {
-            this->parents_ = (*parents);
-            this->directParents_ = (*parents);
-
-            // Iterate through all parents
-            for (std::set<const Identifier*>::iterator it = parents->begin(); it != parents->end(); ++it)
-            {
-                // Tell the parent we're one of it's children
-                (*it)->children_.insert((*it)->children_.end(), this);
-
-                // Erase all parents of our parent from our direct-parent-list
-                for (std::set<const Identifier*>::const_iterator it1 = (*it)->getParents().begin(); it1 != (*it)->getParents().end(); ++it1)
-                {
-                    // Search for the parent's parent in our direct-parent-list
-                    for (std::set<const Identifier*>::iterator it2 = this->directParents_.begin(); it2 != this->directParents_.end(); ++it2)
-                    {
-                        if ((*it1) == (*it2))
-                        {
-                            // We've found a non-direct parent in our list: Erase it
-                            this->directParents_.erase(it2);
-                            break;
-                        }
-                    }
-                }
-            }
-
-            // Now iterate through all direct parents
-            for (std::set<const Identifier*>::iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
-            {
-                // Tell the parent we're one of it's direct children
-                (*it)->directChildren_.insert((*it)->directChildren_.end(), this);
-
-                // Create the super-function dependencies
-                (*it)->createSuperFunctionCaller();
-            }
-        }
-    }
-
-    /**
         @brief Sets the name of the class.
     */
     void Identifier::setName(const std::string& name)
     {
-        if (!this->bSetName_)
+        if (name != this->name_)
         {
             this->name_ = name;
-            this->bSetName_ = true;
-            IdentifierManager::getInstance().registerIdentifier(this);
+            IdentifierManager::getInstance().addIdentifierToLookupMaps(this);
         }
     }
@@ -194,5 +126,103 @@
     {
         this->networkID_ = id;
-        IdentifierManager::getInstance().registerIdentifier(this);
+        IdentifierManager::getInstance().addIdentifierToLookupMaps(this);
+    }
+
+    /**
+     * @brief Used to define the direct parents of an Identifier of an abstract class.
+     */
+    Identifier& Identifier::inheritsFrom(Identifier* directParent)
+    {
+        if (this->parents_.empty())
+            this->directParents_.insert(directParent);
+        else
+            orxout(internal_error) << "Trying to add " << directParent->getName() << " as a direct parent of " << this->getName() << " after the latter was already initialized" << endl;
+
+        return *this;
+    }
+
+    /**
+     * @brief Initializes the parents of this Identifier while creating the class hierarchy.
+     * @param identifiers All identifiers that were used to create an instance of this class (including this identifier itself)
+     */
+    void Identifier::initializeParents(const std::set<const Identifier*>& identifiers)
+    {
+        if (!IdentifierManager::getInstance().isCreatingHierarchy())
+        {
+            orxout(internal_warning) << "Identifier::initializeParents() created outside of class hierarchy creation" << endl;
+            return;
+        }
+
+        for (std::set<const Identifier*>::const_iterator it = identifiers.begin(); it != identifiers.end(); ++it)
+            if (*it != this)
+                this->parents_.insert(*it);
+    }
+
+    /**
+     * @brief Initializes the direct parents of this Identifier while creating the class hierarchy. This is only intended for abstract classes.
+     */
+    void Identifier::initializeDirectParentsOfAbstractClass()
+    {
+        if (!IdentifierManager::getInstance().isCreatingHierarchy())
+        {
+            orxout(internal_warning) << "Identifier::initializeDirectParentsOfAbstractClass() created outside of class hierarchy creation" << endl;
+            return;
+        }
+
+        // only Identifiable is allowed to have no parents (even tough it's currently not abstract)
+        if (this->directParents_.empty() && !this->isExactlyA(Class(Identifiable)))
+        {
+            orxout(internal_error) << "Identifier " << this->getName() << " / " << this->getTypeidName() << " is marked as abstract but has no direct parents defined" << endl;
+            orxout(internal_error) << "  If this class is not abstract, use RegisterClass(ThisClass);" << endl;
+            orxout(internal_error) << "  If this class is abstract, use RegisterAbstractClass(ThisClass).inheritsFrom(Class(BaseClass));" << endl;
+        }
+    }
+
+    /**
+     * @brief Finishes the initialization of this Identifier after creating the class hierarchy by wiring the (direct) parent/child references correctly.
+     */
+    void Identifier::finishInitialization()
+    {
+        if (!IdentifierManager::getInstance().isCreatingHierarchy())
+        {
+            orxout(internal_warning) << "Identifier::finishInitialization() created outside of class hierarchy creation" << endl;
+            return;
+        }
+
+        if (this->isInitialized())
+            return;
+
+        // if no direct parents were defined, initialize them with the set of all parents
+        if (this->directParents_.empty())
+            this->directParents_ = this->parents_;
+
+        // initialize all parents before continuing to initialize this identifier
+        for (std::set<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
+        {
+            Identifier* directParent = const_cast<Identifier*>(*it);
+            directParent->finishInitialization(); // initialize parent
+            this->parents_.insert(directParent);  // direct parent is also a parent
+            this->parents_.insert(directParent->parents_.begin(), directParent->parents_.end()); // parents of direct parent are also parents
+        }
+
+        // parents of parents are no direct parents of this identifier
+        for (std::set<const Identifier*>::const_iterator it_parent = this->parents_.begin(); it_parent != this->parents_.end(); ++it_parent)
+            for (std::set<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
+                this->directParents_.erase(*it_parent_parent);
+
+        // tell all parents that this identifier is a child
+        for (std::set<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
+            const_cast<Identifier*>(*it)->children_.insert(this);
+
+        // tell all direct parents that this identifier is a direct child
+        for (std::set<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
+        {
+            const_cast<Identifier*>(*it)->directChildren_.insert(this);
+
+            // Create the super-function dependencies
+            (*it)->createSuperFunctionCaller();
+        }
+
+        this->bInitialized_ = true;
     }
 
Index: /code/branches/core6/src/libraries/core/class/Identifier.h
===================================================================
--- /code/branches/core6/src/libraries/core/class/Identifier.h	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/Identifier.h	(revision 9646)
@@ -139,4 +139,17 @@
             inline void setLoadable(bool bLoadable) { this->bLoadable_ = bLoadable; }
 
+            /// Returns true if the Identifier was completely initialized.
+            inline bool isInitialized() const { return this->bInitialized_; }
+
+
+            /////////////////////////////
+            ////// Class Hierarchy //////
+            /////////////////////////////
+            Identifier& inheritsFrom(Identifier* directParent);
+
+            void initializeParents(const std::set<const Identifier*>& identifiers);
+            void initializeDirectParentsOfAbstractClass();
+            void finishInitialization();
+
             bool isA(const Identifier* identifier) const;
             bool isExactlyA(const Identifier* identifier) const;
@@ -146,8 +159,4 @@
             bool isDirectParentOf(const Identifier* identifier) const;
 
-
-            /////////////////////////////
-            ////// Class Hierarchy //////
-            /////////////////////////////
             /// Returns the parents of the class the Identifier belongs to.
             inline const std::set<const Identifier*>& getParents() const { return this->parents_; }
@@ -218,22 +227,12 @@
             virtual void createSuperFunctionCaller() const = 0;
 
-            void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
-
-            /// Returns the children of the class the Identifier belongs to.
-            inline std::set<const Identifier*>& getChildrenIntern() const { return this->children_; }
-            /// Returns the direct children of the class the Identifier belongs to.
-            inline std::set<const Identifier*>& getDirectChildrenIntern() const { return this->directChildren_; }
-
         private:
-            void initialize(std::set<const Identifier*>* parents);
-
             std::set<const Identifier*> parents_;                          //!< The parents of the class the Identifier belongs to
-            mutable std::set<const Identifier*> children_;                 //!< The children of the class the Identifier belongs to
+            std::set<const Identifier*> children_;                         //!< The children of the class the Identifier belongs to
 
             std::set<const Identifier*> directParents_;                    //!< The direct parents of the class the Identifier belongs to
-            mutable std::set<const Identifier*> directChildren_;           //!< The direct children of the class the Identifier belongs to
-
-            bool bCreatedOneObject_;                                       //!< True if at least one object of the given type was created (used to determine the need of storing the parents)
-            bool bSetName_;                                                //!< True if the name is set
+            std::set<const Identifier*> directChildren_;                   //!< The direct children of the class the Identifier belongs to
+
+            bool bInitialized_;                                            //!< Is true if the Identifier was completely initialized
             bool bLoadable_;                                               //!< False = it's not permitted to load the object through XML
             std::string name_;                                             //!< The name of the class the Identifier belongs to
@@ -277,5 +276,5 @@
             static ClassIdentifier<T>* getIdentifier(const std::string& name);
 
-            bool initializeObject(T* object, const std::string& className, bool bRootClass);
+            bool initializeObject(T* object);
 
             void setConfigValues(T* object, Configurable*) const;
@@ -351,5 +350,5 @@
 
         // Get the entry from the map
-        ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)IdentifierManager::getInstance().getIdentifierSingleton(proposal);
+        ClassIdentifier<T>::classIdentifier_s = (ClassIdentifier<T>*)IdentifierManager::getInstance().getGloballyUniqueIdentifier(proposal);
 
         if (ClassIdentifier<T>::classIdentifier_s == proposal)
@@ -365,26 +364,14 @@
         @brief Adds an object of the given type to the ObjectList.
         @param object The object to add
-        @param className The name of the class T
-        @param bRootClass True if this is a root class (i.e. it inherits directly from OrxonoxClass)
-    */
-    template <class T>
-    bool ClassIdentifier<T>::initializeObject(T* object, const std::string& className, bool bRootClass)
-    {
-        if (bRootClass)
-            orxout(verbose, context::object_list) << "Register Root-Object: " << className << endl;
-        else
-            orxout(verbose, context::object_list) << "Register Object: " << className << endl;
+    */
+    template <class T>
+    bool ClassIdentifier<T>::initializeObject(T* object)
+    {
+        orxout(verbose, context::object_list) << "Register Object: " << this->getName() << endl;
 
         object->identifier_ = this;
         if (IdentifierManager::getInstance().isCreatingHierarchy())
         {
-            if (bRootClass && !object->parents_)
-                object->parents_ = new std::set<const Identifier*>();
-
-            if (object->parents_)
-            {
-                this->initializeClassHierarchy(object->parents_, bRootClass);
-                object->parents_->insert(object->parents_->end(), this);
-            }
+            IdentifierManager::getInstance().createdObject(object);
 
             this->setConfigValues(object, object);
Index: /code/branches/core6/src/libraries/core/class/IdentifierManager.cc
===================================================================
--- /code/branches/core6/src/libraries/core/class/IdentifierManager.cc	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/IdentifierManager.cc	(revision 9646)
@@ -37,4 +37,5 @@
 
 #include "util/StringUtils.h"
+#include "core/CoreIncludes.h"
 #include "core/config/ConfigValueContainer.h"
 #include "core/XMLPort.h"
@@ -60,5 +61,5 @@
         @return The identifier (unique instance)
     */
-    Identifier* IdentifierManager::getIdentifierSingleton(Identifier* proposal)
+    Identifier* IdentifierManager::getGloballyUniqueIdentifier(Identifier* proposal)
     {
         const std::string& typeidName = proposal->getTypeidName();
@@ -81,9 +82,15 @@
      * Registers the identifier in all maps of the IdentifierManager.
      */
-    void IdentifierManager::registerIdentifier(Identifier* identifier)
-    {
-        IdentifierManager::getInstance().identifierByString_[identifier->getName()] = identifier;
-        IdentifierManager::getInstance().identifierByLowercaseString_[getLowercase(identifier->getName())] = identifier;
-        IdentifierManager::getInstance().identifierByNetworkId_[identifier->getNetworkID()] = identifier;
+    void IdentifierManager::addIdentifierToLookupMaps(Identifier* identifier)
+    {
+        const std::string& typeidName = identifier->getTypeidName();
+        if (this->identifierByTypeidName_.find(typeidName) != this->identifierByTypeidName_.end())
+        {
+            this->identifierByString_[identifier->getName()] = identifier;
+            this->identifierByLowercaseString_[getLowercase(identifier->getName())] = identifier;
+            this->identifierByNetworkId_[identifier->getNetworkID()] = identifier;
+        }
+        else
+            orxout(internal_warning) << "Trying to add an identifier to lookup maps which is not known to IdentifierManager" << endl;
     }
 
@@ -95,13 +102,40 @@
         orxout(internal_status) << "Create class-hierarchy" << endl;
         this->startCreatingHierarchy();
+
+        std::set<Identifier*> initializedIdentifiers;
+
+        // iterate over all identifiers, create one instance of each class and initialize the identifiers
+        {
+            Context temporaryContext(NULL);
+            for (std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it)
+            {
+                orxout(verbose, context::identifier) << "Initialize ClassIdentifier<" << it->second->getName() << ">-Singleton." << endl;
+                // To initialize the identifier, we create a new object and delete it afterwards.
+                if (it->second->hasFactory())
+                {
+                    this->identifiersOfNewObject_.clear();
+                    Identifiable* temp = it->second->fabricate(&temporaryContext);
+                    if (temp->getIdentifier() != it->second)
+                        orxout(internal_error) << "Newly created object has unexpected identifier" << endl;
+                    delete temp;
+
+                    it->second->initializeParents(this->identifiersOfNewObject_);
+                }
+                else
+                    it->second->initializeDirectParentsOfAbstractClass();
+
+                initializedIdentifiers.insert(it->second);
+            }
+        }
+
+        // finish the initialization of all identifiers
         for (std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it)
         {
-            // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards.
-            if (it->second->hasFactory())
-            {
-                Identifiable* temp = it->second->fabricate(0);
-                delete temp;
-            }
-        }
+            if (initializedIdentifiers.find(it->second) != initializedIdentifiers.end())
+                it->second->finishInitialization();
+            else
+                orxout(internal_error) << "Identifier was registered late and is not initialized: " << it->second->getName() << " / " << it->second->getTypeidName() << endl;
+        }
+
         this->stopCreatingHierarchy();
         orxout(internal_status) << "Finished class-hierarchy creation" << endl;
@@ -123,4 +157,15 @@
 
     /**
+     * @brief Notifies the IdentifierManager about a newly created object while creating the class hierarchy.
+     */
+    void IdentifierManager::createdObject(Identifiable* identifiable)
+    {
+        if (this->isCreatingHierarchy())
+            this->identifiersOfNewObject_.insert(identifiable->getIdentifier());
+        else
+            orxout(internal_warning) << "createdObject() called outside of class hierarchy creation" << endl;
+    }
+
+    /**
         @brief Returns the Identifier with a given name.
         @param name The name of the wanted Identifier
Index: /code/branches/core6/src/libraries/core/class/IdentifierManager.h
===================================================================
--- /code/branches/core6/src/libraries/core/class/IdentifierManager.h	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/IdentifierManager.h	(revision 9646)
@@ -38,4 +38,5 @@
 
 #include <map>
+#include <set>
 #include <string>
 
@@ -47,6 +48,6 @@
             static IdentifierManager& getInstance();
 
-            Identifier* getIdentifierSingleton(Identifier* proposal);
-            void registerIdentifier(Identifier* identifier);
+            Identifier* getGloballyUniqueIdentifier(Identifier* proposal);
+            void addIdentifierToLookupMaps(Identifier* identifier);
 
             unsigned int getUniqueClassId()
@@ -59,4 +60,6 @@
             void createClassHierarchy();
             void destroyAllIdentifiers();
+
+            void createdObject(Identifiable* identifiable);
 
             /// Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents.
@@ -103,4 +106,5 @@
 
             int hierarchyCreatingCounter_s;                         //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
+            std::set<const Identifier*> identifiersOfNewObject_;    //!< Used while creating the object hierarchy to keep track of the identifiers of a newly created object
             unsigned int classIDCounter_s;                          //!< counter for the unique classIDs
     };
Index: /code/branches/core6/src/libraries/core/class/OrxonoxClass.cc
===================================================================
--- /code/branches/core6/src/libraries/core/class/OrxonoxClass.cc	(revision 9646)
+++ /code/branches/core6/src/libraries/core/class/OrxonoxClass.cc	(revision 9646)
@@ -0,0 +1,40 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 "OrxonoxClass.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    RegisterClassNoArgs(OrxonoxClass);
+
+    OrxonoxClass::OrxonoxClass()
+    {
+        RegisterObject(OrxonoxClass);
+    }
+}
Index: /code/branches/core6/src/libraries/core/class/OrxonoxClass.h
===================================================================
--- /code/branches/core6/src/libraries/core/class/OrxonoxClass.h	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/OrxonoxClass.h	(revision 9646)
@@ -53,4 +53,6 @@
     class _CoreExport OrxonoxClass : virtual public Configurable, virtual public Destroyable
     {
+        public:
+            OrxonoxClass();
     };
 }
Index: /code/branches/core6/src/libraries/core/class/OrxonoxInterface.cc
===================================================================
--- /code/branches/core6/src/libraries/core/class/OrxonoxInterface.cc	(revision 9646)
+++ /code/branches/core6/src/libraries/core/class/OrxonoxInterface.cc	(revision 9646)
@@ -0,0 +1,40 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 "OrxonoxInterface.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    RegisterClassNoArgs(OrxonoxInterface);
+
+    OrxonoxInterface::OrxonoxInterface()
+    {
+        RegisterObject(OrxonoxInterface);
+    }
+}
Index: /code/branches/core6/src/libraries/core/class/OrxonoxInterface.h
===================================================================
--- /code/branches/core6/src/libraries/core/class/OrxonoxInterface.h	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/OrxonoxInterface.h	(revision 9646)
@@ -50,4 +50,6 @@
     class _CoreExport OrxonoxInterface : virtual public Configurable, virtual public Destroyable
     {
+        public:
+            OrxonoxInterface();
     };
 }
Index: /code/branches/core6/src/libraries/core/class/Super.h
===================================================================
--- /code/branches/core6/src/libraries/core/class/Super.h	(revision 9645)
+++ /code/branches/core6/src/libraries/core/class/Super.h	(revision 9646)
@@ -103,5 +103,5 @@
             { \
                 ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \
-                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it) \
+                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it) \
                 { \
                     if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
@@ -171,5 +171,5 @@
 
                 // Iterate through all children
-                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it)
+                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it)
                 {
                     // Check if the caller is a fallback-caller
Index: /code/branches/core6/test/core/class/IdentifierClassHierarchyTest.cc
===================================================================
--- /code/branches/core6/test/core/class/IdentifierClassHierarchyTest.cc	(revision 9645)
+++ /code/branches/core6/test/core/class/IdentifierClassHierarchyTest.cc	(revision 9646)
@@ -20,32 +20,107 @@
     {
         class BaseInterface1 : public OrxonoxInterface
-            { public: BaseInterface1() { RegisterRootObject(BaseInterface1); } };
+        {
+            public:
+                BaseInterface1()
+                {
+                    RegisterRootObject(BaseInterface1);
+                }
+
+                virtual void test1() = 0;
+        };
 
         class BaseInterface2 : public OrxonoxInterface
-            { public: BaseInterface2() { RegisterRootObject(BaseInterface2); } };
+        {
+            public:
+                BaseInterface2()
+                {
+                    RegisterRootObject(BaseInterface2);
+                }
+
+                virtual void test2() = 0;
+        };
 
         class Interface1 : public BaseInterface1
-            { public: Interface1() { RegisterObject(Interface1); } };
+        {
+            public:
+                Interface1()
+                {
+                    RegisterObject(Interface1);
+                }
+        };
 
         class Interface2 : public BaseInterface2
-            { public: Interface2() { RegisterObject(Interface2); } };
+        {
+            public:
+                Interface2()
+                {
+                    RegisterObject(Interface2);
+                }
+        };
 
         class BaseClass : public OrxonoxClass
-            { public: BaseClass() { RegisterRootObject(BaseClass); } };
+        {
+            public:
+                BaseClass()
+                {
+                    RegisterRootObject(BaseClass);
+                }
+        };
 
         class Class0 : public BaseClass
-            { public: Class0() { RegisterObject(Class0); } };
+        {
+            public:
+                Class0()
+                {
+                    RegisterObject(Class0);
+                }
+        };
 
         class Class1 : public BaseClass, public Interface1
-            { public: Class1() { RegisterObject(Class1); } };
+        {
+            public:
+                Class1()
+                {
+                    RegisterObject(Class1);
+                }
+
+                virtual void test1() {}
+        };
 
         class Class2a : public BaseClass, public Interface1, Interface2
-            { public: Class2a() { RegisterObject(Class2a); } };
+        {
+            public:
+                Class2a()
+                {
+                    RegisterObject(Class2a);
+                }
+
+                virtual void test1() {}
+                virtual void test2() {}
+        };
 
         class Class2b : public BaseClass, public Interface2, Interface1
-            { public: Class2b() { RegisterObject(Class2b); } };
+        {
+            public:
+                Class2b()
+                {
+                    RegisterObject(Class2b);
+                }
+
+                virtual void test1() {}
+                virtual void test2() {}
+        };
 
         class Class3 : public BaseClass, public BaseInterface1, BaseInterface2
-            { public: Class3() { RegisterObject(Class3); } };
+        {
+            public:
+                Class3()
+                {
+                    RegisterObject(Class3);
+                }
+
+                virtual void test1() {}
+                virtual void test2() {}
+        };
 
         // Fixture
@@ -55,8 +130,10 @@
                 virtual void SetUp()
                 {
-                    registerClass("BaseInterface1", new ClassFactoryNoArgs<BaseInterface1>());
-                    registerClass("BaseInterface2", new ClassFactoryNoArgs<BaseInterface2>());
-                    registerClass("Interface1", new ClassFactoryNoArgs<Interface1>());
-                    registerClass("Interface2", new ClassFactoryNoArgs<Interface2>());
+                    registerClass("OrxonoxInterface", new ClassFactoryNoArgs<OrxonoxInterface>());
+                    registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
+                    registerClass("BaseInterface1", static_cast<ClassFactory<BaseInterface1>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface));
+                    registerClass("BaseInterface2", static_cast<ClassFactory<BaseInterface2>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface));
+                    registerClass("Interface1", static_cast<ClassFactory<Interface1>*>(NULL), false).inheritsFrom(Class(BaseInterface1));
+                    registerClass("Interface2", static_cast<ClassFactory<Interface2>*>(NULL), false).inheritsFrom(Class(BaseInterface2));
                     registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>());
                     registerClass("Class0", new ClassFactoryNoArgs<Class0>());
@@ -74,4 +151,9 @@
                 }
         };
+
+        bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
+        {
+            return identifiers.find(identifier) != identifiers.end();
+        }
     }
 
@@ -135,7 +217,20 @@
 
         EXPECT_EQ(2u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Interface1)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3)));
+
         EXPECT_EQ(5u, identifier->getChildren().size());
-        EXPECT_EQ(0u, identifier->getDirectParents().size());
-        EXPECT_EQ(0u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Interface1)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface)));
+
+        EXPECT_EQ(2u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
     }
 
@@ -145,7 +240,19 @@
 
         EXPECT_EQ(2u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Interface2)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3)));
+
         EXPECT_EQ(4u, identifier->getChildren().size());
-        EXPECT_EQ(0u, identifier->getDirectParents().size());
-        EXPECT_EQ(0u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Interface2)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface)));
+
+        EXPECT_EQ(2u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
     }
 
@@ -155,7 +262,20 @@
 
         EXPECT_EQ(3u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class1)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2a)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2b)));
+
         EXPECT_EQ(3u, identifier->getChildren().size());
-        EXPECT_EQ(1u, identifier->getDirectParents().size());
-        EXPECT_EQ(1u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface1)));
+
+        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1)));
     }
 
@@ -165,7 +285,18 @@
 
         EXPECT_EQ(2u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2a)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2b)));
+
         EXPECT_EQ(2u, identifier->getChildren().size());
-        EXPECT_EQ(1u, identifier->getDirectParents().size());
-        EXPECT_EQ(1u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface2)));
+
+        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2)));
     }
 
@@ -175,7 +306,23 @@
 
         EXPECT_EQ(5u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class0)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class1)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2a)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class2b)));
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(Class3)));
+
         EXPECT_EQ(5u, identifier->getChildren().size());
-        EXPECT_EQ(0u, identifier->getDirectParents().size());
-        EXPECT_EQ(0u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class0)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class1)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2a)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class2b)));
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(Class3)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
+
+        EXPECT_EQ(2u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
     }
 
@@ -185,7 +332,14 @@
 
         EXPECT_EQ(0u, identifier->getDirectChildren().size());
+
         EXPECT_EQ(0u, identifier->getChildren().size());
-        EXPECT_EQ(1u, identifier->getDirectParents().size());
-        EXPECT_EQ(1u, identifier->getParents().size());
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
     }
 
@@ -195,7 +349,18 @@
 
         EXPECT_EQ(0u, identifier->getDirectChildren().size());
+
         EXPECT_EQ(0u, identifier->getChildren().size());
+
         EXPECT_EQ(2u, identifier->getDirectParents().size());
-        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface1)));
+
+        EXPECT_EQ(6u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Interface1)));
     }
 
@@ -205,7 +370,21 @@
 
         EXPECT_EQ(0u, identifier->getDirectChildren().size());
+
         EXPECT_EQ(0u, identifier->getChildren().size());
+
         EXPECT_EQ(3u, identifier->getDirectParents().size());
-        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface1)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface2)));
+
+        EXPECT_EQ(8u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Interface1)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Interface2)));
     }
 
@@ -215,7 +394,21 @@
 
         EXPECT_EQ(0u, identifier->getDirectChildren().size());
+
         EXPECT_EQ(0u, identifier->getChildren().size());
+
         EXPECT_EQ(3u, identifier->getDirectParents().size());
-        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface1)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface2)));
+
+        EXPECT_EQ(8u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Interface1)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Interface2)));
     }
 
@@ -225,7 +418,19 @@
 
         EXPECT_EQ(0u, identifier->getDirectChildren().size());
+
         EXPECT_EQ(0u, identifier->getChildren().size());
+
         EXPECT_EQ(3u, identifier->getDirectParents().size());
-        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface1)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseInterface2)));
+
+        EXPECT_EQ(6u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface1)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseInterface2)));
     }
 }
Index: /code/branches/core6/test/core/class/IdentifierExternalClassHierarchyTest.cc
===================================================================
--- /code/branches/core6/test/core/class/IdentifierExternalClassHierarchyTest.cc	(revision 9645)
+++ /code/branches/core6/test/core/class/IdentifierExternalClassHierarchyTest.cc	(revision 9646)
@@ -8,11 +8,33 @@
     {
         class Interface : virtual public Identifiable
-            { public: Interface() { RegisterRootObject(Interface); } };
+        {
+            public:
+                Interface()
+                {
+                    RegisterRootObject(Interface);
+                }
+
+                virtual void test() = 0;
+        };
 
         class BaseClass : virtual public Identifiable
-            { public: BaseClass() { RegisterRootObject(BaseClass); } };
+        {
+            public:
+                BaseClass()
+                {
+                    RegisterRootObject(BaseClass);
+                }
+        };
 
         class RealClass : public BaseClass, public Interface
-            { public: RealClass() { RegisterObject(RealClass); } };
+        {
+            public:
+                RealClass()
+                {
+                    RegisterObject(RealClass);
+                }
+
+                virtual void test() {}
+        };
 
         // Fixture
@@ -22,5 +44,5 @@
                 virtual void SetUp()
                 {
-                    registerClass("Interface", new ClassFactoryNoArgs<Interface>());
+                    registerClass("Interface", static_cast<ClassFactory<Interface>*>(NULL), false).inheritsFrom(Class(Identifiable));
                     registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>());
                     registerClass("RealClass", new ClassFactoryNoArgs<RealClass>());
@@ -34,4 +56,9 @@
                 }
         };
+
+        bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
+        {
+            return identifiers.find(identifier) != identifiers.end();
+        }
     }
 
@@ -59,6 +86,15 @@
         Identifier* identifier = Class(Interface);
 
+        EXPECT_EQ(1u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(RealClass)));
+
         EXPECT_EQ(1u, identifier->getChildren().size());
-        EXPECT_EQ(0u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(RealClass)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Identifiable)));
+
+        EXPECT_EQ(1u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
     }
 
@@ -67,6 +103,15 @@
         Identifier* identifier = Class(BaseClass);
 
+        EXPECT_EQ(1u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(RealClass)));
+
         EXPECT_EQ(1u, identifier->getChildren().size());
-        EXPECT_EQ(0u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(RealClass)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Identifiable)));
+
+        EXPECT_EQ(1u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
     }
 
@@ -75,6 +120,16 @@
         Identifier* identifier = Class(RealClass);
 
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+
         EXPECT_EQ(0u, identifier->getChildren().size());
-        EXPECT_EQ(2u, identifier->getParents().size());
+
+        EXPECT_EQ(2u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(3u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Interface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
     }
 }
Index: /code/branches/core6/test/core/class/IdentifierSimpleClassHierarchyTest.cc
===================================================================
--- /code/branches/core6/test/core/class/IdentifierSimpleClassHierarchyTest.cc	(revision 9645)
+++ /code/branches/core6/test/core/class/IdentifierSimpleClassHierarchyTest.cc	(revision 9646)
@@ -10,11 +10,33 @@
     {
         class Interface : public OrxonoxInterface
-            { public: Interface() { RegisterRootObject(Interface); } };
+        {
+            public:
+                Interface()
+                {
+                    RegisterRootObject(Interface);
+                }
+
+                virtual void test() = 0;
+        };
 
         class BaseClass : public OrxonoxClass
-            { public: BaseClass() { RegisterRootObject(BaseClass); } };
+        {
+            public:
+                BaseClass()
+                {
+                    RegisterRootObject(BaseClass);
+                }
+        };
 
         class RealClass : public BaseClass, public Interface
-            { public: RealClass() { RegisterObject(RealClass); } };
+        {
+            public:
+                RealClass()
+                {
+                    RegisterObject(RealClass);
+                }
+
+                virtual void test() {}
+        };
 
         // Fixture
@@ -24,5 +46,7 @@
                 virtual void SetUp()
                 {
-                    registerClass("Interface", new ClassFactoryNoArgs<Interface>());
+                    registerClass("OrxonoxInterface", new ClassFactoryNoArgs<OrxonoxInterface>());
+                    registerClass("OrxonoxClass", new ClassFactoryNoArgs<OrxonoxClass>());
+                    registerClass("Interface", static_cast<ClassFactory<Interface>*>(NULL), false).inheritsFrom(Class(OrxonoxInterface));
                     registerClass("BaseClass", new ClassFactoryNoArgs<BaseClass>());
                     registerClass("RealClass", new ClassFactoryNoArgs<RealClass>());
@@ -36,4 +60,9 @@
                 }
         };
+
+        bool contains(const std::set<const Identifier*> identifiers, Identifier* identifier)
+        {
+            return identifiers.find(identifier) != identifiers.end();
+        }
     }
 
@@ -61,6 +90,16 @@
         Identifier* identifier = Class(Interface);
 
+        EXPECT_EQ(1u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(RealClass)));
+
         EXPECT_EQ(1u, identifier->getChildren().size());
-        EXPECT_EQ(0u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(RealClass)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxInterface)));
+
+        EXPECT_EQ(2u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
     }
 
@@ -69,6 +108,16 @@
         Identifier* identifier = Class(BaseClass);
 
+        EXPECT_EQ(1u, identifier->getDirectChildren().size());
+        EXPECT_TRUE(contains(identifier->getDirectChildren(), Class(RealClass)));
+
         EXPECT_EQ(1u, identifier->getChildren().size());
-        EXPECT_EQ(0u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getChildren(), Class(RealClass)));
+
+        EXPECT_EQ(1u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(OrxonoxClass)));
+
+        EXPECT_EQ(2u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
     }
 
@@ -77,6 +126,18 @@
         Identifier* identifier = Class(RealClass);
 
+        EXPECT_EQ(0u, identifier->getDirectChildren().size());
+
         EXPECT_EQ(0u, identifier->getChildren().size());
-        EXPECT_EQ(2u, identifier->getParents().size());
+
+        EXPECT_EQ(2u, identifier->getDirectParents().size());
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(Interface)));
+        EXPECT_TRUE(contains(identifier->getDirectParents(), Class(BaseClass)));
+
+        EXPECT_EQ(5u, identifier->getParents().size());
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Identifiable)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxInterface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(OrxonoxClass)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(Interface)));
+        EXPECT_TRUE(contains(identifier->getParents(), Class(BaseClass)));
     }
 }
