Index: trunk/src/lib/lang/Makefile.am
===================================================================
--- trunk/src/lib/lang/Makefile.am	(revision 9682)
+++ trunk/src/lib/lang/Makefile.am	(revision 9869)
@@ -1,7 +1,5 @@
-MAINSRCDIR=../..
-include $(MAINSRCDIR)/defs/include_paths.am
-
-LIB_PREFIX=$(MAINSRCDIR)/lib
-include $(MAINSRCDIR)/lib/BuildLibs.am
+INCLUDES = -I../..
+INCLUDES +=-I..
+INCLUDES +=-I../util
 
 noinst_LIBRARIES = libORXlang.a
@@ -9,33 +7,9 @@
 libORXlang_a_SOURCES = \
 		base_object.cc \
-		class_list.cc \
-		new_class_id.cc \
-		new_object_list.cc
+		class_id.cc \
+		object_list.cc
 
 noinst_HEADERS = \
 		base_object.h \
-		class_list.h \
-		new_class_id.h \
-		new_object_list.h
-
-
-
-
-
-## THIS ALL IS JUST FOR TESTING!!
-check_PROGRAMS = test_object_list
-
-test_object_list_SOURCES = \
-		test_object_list.cc
-
-test_object_list_DEPENDENCIES = libORXlang.a
-
-test_object_list_LDADD = \
-		$(MAINSRCDIR)/util/libORXutils.a \
-		$(libORXlibs_a_LIBRARIES_) \
-		$(MAINSRCDIR)/world_entities/libORXwe.a \
-		$(libORXlibs_a_LIBRARIES_) \
-		$(MAINSRCDIR)/util/libORXutils.a
-
-#test_object_list_LDADD = \
-		libORXlang.a
+		class_id.h \
+		object_list.h
Index: trunk/src/lib/lang/base_object.cc
===================================================================
--- trunk/src/lib/lang/base_object.cc	(revision 9682)
+++ trunk/src/lib/lang/base_object.cc	(revision 9869)
@@ -1,4 +1,2 @@
-
-
 /*
    orxonox - the future of 3D-vertical-scrollers
@@ -19,21 +17,20 @@
 #include "base_object.h"
 
+#include "util/debug.h"
 #include "util/loading/load_param.h"
-#include "class_list.h"
+
+ObjectListDefinition(BaseObject);
 
 /**
  * @brief sets the name from a LoadXML-Element
- * @param root the element to load from
+ * @param objectName: The name of the Object.
  */
 BaseObject::BaseObject(const std::string& objectName)
 {
-  this->classID = CL_BASE_OBJECT;
   this->className = "BaseObject";
 
   this->objectName = objectName;
-  this->classList = NULL;
   this->xmlElem = NULL;
-
-  //ClassList::addToClassList(this, this->classID, "BaseObject");
+  this->registerObject(this, BaseObject::_objectList);
 }
 
@@ -43,5 +40,14 @@
 BaseObject::~BaseObject ()
 {
-  ClassList::removeFromClassList(this);
+  /// Remove from the ObjectLists
+  ClassEntries::iterator it;
+  PRINTF(5)("Deleting Object of type %s::%s\n", this->getClassCName(), getCName());
+  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
+  {
+    if (ORX_DEBUG >= 5)
+      assert((*it)._objectList->checkIteratorInList((*it)._iterator) || (*it)._objectList->checkObjectInList(this));
+    (*it)._objectList->unregisterObject((*it)._iterator);
+    delete (*it)._iterator;
+  }
 
   if (this->xmlElem != NULL)
@@ -69,22 +75,4 @@
 
 /**
- * @brief sets the class identifiers
- * @param id a number for the class from class_id.h enumeration
- * @param className the class name
-*/
-void BaseObject::setClassID(ClassID classID, const std::string& className)
-{
-  //printf("%s(0x%.8X)->%s(0x%.8X)\n", this->className, this->classID, className, classID);
-  assert (!(this->classID & classID & !CL_MASK_SUBSUPER_CLASS_IDA ));
-
-  this->leafClassID = classID;
-  this->classID |= (long)classID;
-  this->className = className;
-
-  this->classList = ClassList::addToClassList(this, classID, this->classID, className);
-}
-
-
-/**
  * @brief set the name of the Object
  * @param objectName The new name of the Object.
@@ -97,71 +85,74 @@
 
 /**
- * @brief queries for the ClassID of the Leaf Class (the last made class of this type
- * @returns the ClassID of the Leaf Class (e.g. the ID of the Class)
- *
- * the returned ID can be used to generate new Objects of the same type through
- * Factory::fabricate(Object->getLeafClassID());
+ * @brief Seeks in the Inheritance if it matches objectList.
+ * @param objectList The ObjectList this should be a member of (by Pointer-comparison).
+ * @return True if found, false if not.
  */
-const ClassID& BaseObject::getLeafClassID() const
+bool BaseObject::isA(const ObjectListBase& objectList) const
 {
-  return this->leafClassID;
-}
-
-
-
-/**
- * @brief checks if the class is a classID
- * @param classID the Identifier to check for
- * @returns true if it is, false otherwise
-*/
-bool BaseObject::isA (ClassID classID) const
-{
-  // if classID is a derivable object from a SUPERCLASS
-  if (classID & CL_MASK_SUPER_CLASS)
-  {
-    if( likely(this->classID & classID))
+  ClassEntries::const_iterator it;
+  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
+    if ((*it)._objectList == &objectList)
       return true;
-  }
-  // if classID is a SubSuperClass, and
-  else if (classID & CL_MASK_SUBSUPER_CLASS)
-  {
-    if (likely(((this->classID & CL_MASK_SUBSUPER_CLASS_IDA) == (classID & CL_MASK_SUBSUPER_CLASS_IDA)) &&
-        this->classID & classID & CL_MASK_SUBSUPER_CLASS_IDB))
-      return true;
-  }
-  // if classID is a LOWLEVEL-class
-  else
-  {
-    if( likely((this->classID & CL_MASK_LOWLEVEL_CLASS) == classID))
-      return true;
-  }
   return false;
 }
 
 
+/**
+ * @brief Seeks in the Inheritance if it matches objectList.
+ * @param classID The ClassID this should be a member of (by Pointer-comparison).
+ * @return True if found, false if not.
+ */
+bool BaseObject::isA(const ClassID& classID) const
+{
+  ClassEntries::const_iterator it;
+  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
+    if (*(*it)._objectList == classID)
+      return true;
+  return false;
+}
 
 /**
- * @brief checks if the class is a classID
- * @param classID the Identifier to check for
- * @returns true if it is, false otherwise
+ * @brief Seeks in the Inheritance if it matches objectList.
+ * @param classID The ClassID of the class this should be a member of.
+ * @return True if found, false if not.
  */
-bool BaseObject::isA (const std::string& className) const
+bool BaseObject::isA(int classID) const
 {
-  ClassID classID = ClassList::StringToID(className);
-  if (classID != CL_NULL)
-    return this->isA(classID);
-  else
-    return false;
+  ClassEntries::const_iterator it;
+  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
+    if (*(*it)._objectList == classID)
+
+      return true;
+  return false;
+}
+
+/**
+ * @brief Seeks in the Inheritance if it matches objectList.
+ * @param className The ClassName of the class this should be a member of.
+ * @return True if found, false if not.
+ */
+bool BaseObject::isA(const std::string& className) const
+{
+  ClassEntries::const_iterator it;
+  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
+    if (*(*it)._objectList == className)
+      return true;
+  return false;
 }
 
 
 /**
- * @brief compares the ObjectName with an external name
- * @param objectName: the name to check.
- * @returns true on match, false otherwise.
+ * @brief This is for debug purposes, to see the Inheritances of this Object and its classes.
+ *
+ * The Inheritance will be listed in a Linear fashion, diamand structures are resolved in a linear dependency.
  */
-bool BaseObject::operator==(const std::string& objectName) const
+void BaseObject::listInheritance() const
 {
-  return (this->objectName == objectName);
+  PRINT(0)("Listing inheritance diagram for %s::%s: ", getClassCName(), getCName());
+  ClassEntries::const_iterator it;
+  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
+    PRINT(0)(" -> %s(id:%d)", (*it)._objectList->name().c_str(), (*it)._objectList->id());
+  PRINT(0)("\n");
+
 }
-
Index: trunk/src/lib/lang/base_object.h
===================================================================
--- trunk/src/lib/lang/base_object.h	(revision 9682)
+++ trunk/src/lib/lang/base_object.h	(revision 9869)
@@ -14,6 +14,6 @@
 #define __BASE_OBJECT_H_
 
-#include "class_id.h"
-#include "sigslot/slot.h"
+#include "object_list.h"
+#include "util/sigslot/slot.h"
 
 #include <string>
@@ -26,5 +26,6 @@
 class BaseObject : public sigslot::has_slots<>
 {
-
+  //! Declare an ObjectList for this Class.
+  ObjectListDeclaration(BaseObject);
 public:
   BaseObject (const std::string& objectName = "");
@@ -41,21 +42,30 @@
   inline TiXmlNode* getXmlElem() const { return this->xmlElem; };
 
-  /** @returns the className of the corresponding Object */
-  inline const std::string& getClassName() const { return this->className; }
+  //  /** @returns the className of the corresponding Object */
+  //inline const std::string& getClassName() const { return this->className; }
   /** @returns the className of the corresponding Object as a C-compliant string (const char*) */
-  inline const char* getClassCName() const { return this->className.c_str(); };
-  /** @returns the classID of the corresponding Object */
-  inline int getClassID() const { return this->classID; };
-  const ClassID& getLeafClassID() const;
+  inline const char* getClassCName() const { return _classes.front()._objectList->name().c_str(); };
+  /** @returns the ClassName of the Topmost Object of the ClassStack */
+  inline const std::string& getClassName() const { return _classes.front()._objectList->name(); };
 
-  bool isA (ClassID classID) const;
-  bool isA (const std::string& className) const;
+  /** @returns the ClassID of this Object */
+  inline const ClassID& getClassID() const { return _classes.front()._objectList->identity(); }
+  /** @returns the ID of the Topmost object of the ClassStack */
+  inline const int& getLeafClassID() const { return _classes.front()._objectList->identity().id(); }
+
+  bool isA(const ObjectListBase& objectList) const;
+  bool isA(const ClassID& classID) const;
+  bool isA(int classID) const;
+  bool isA(const std::string& className) const;
+
+  void listInheritance() const;
 
   /** @param classID comparer for a ClassID @returns true on match, false otherwise */
-  bool operator==(ClassID classID) const  { return this->isA(classID); };
-  bool operator==(const std::string& objectName) const;
+  bool operator==(int classID) const  { return this->isA(classID); };
+  /** @param objectName: the name to check. * @returns true on match, false otherwise. */
+  bool operator==(const std::string& objectName) const { return this->objectName == objectName;};
 
 protected:
-  void setClassID(ClassID classID, const std::string& className);
+  template<class T> void registerObject(T* object, ObjectList<T>& list);
 
 protected:
@@ -63,12 +73,39 @@
 
 private:
-  std::string        className;        //!< the name of the class
-  long               classID;          //!< this is the id from the class_id.h enumeration
-  ClassID            leafClassID;      //!< The Leaf Class ID
-
-  ClassList*         classList;        //!< Pointer to the ClassList this Object is inside of
 
   TiXmlNode*         xmlElem;          //!< The XML Element with wich this Object was loaded(saved).
+
+  //////////////////////////////
+  //// Type Definition Part ////
+  //////////////////////////////
+  //! A ClassEntry so we can store Classes inside of Objects
+  struct ClassEntry
+  {
+    /** Simple Constuctor @param objectList the ObjectList, @param iterator the (intrusive) Iterator inside of the ObjectList */
+    inline ClassEntry (ObjectListBase* objectList, ObjectListBase::IteratorBase* iterator) : _objectList(objectList), _iterator(iterator) {}
+    ObjectListBase*                _objectList;  //!< An ObjectList this Object is part of
+    ObjectListBase::IteratorBase*  _iterator;    //!< An iterator pointing to the position of the Object inside of the List.
+  };
+  typedef std::list<ClassEntry>       ClassEntries;   //!< Type definition for the List.
+
+  std::string                         className;    //!< the name of the class
+  ClassEntries                        _classes;     //!< All Classes this object is part of.
 };
 
+
+/**
+ * @brief Registeres an Object of Type T to objectList
+ * @param object The Object to append to the objectList.
+ * @param objectList The ObjectList to append the Object to.
+ *
+ * This function is essential to integrate objects into their designated ObjectList.
+ * Remember if you do not want objects to be stored in Lists (less overhead),
+ * do not attempt to call this function.
+ */
+template<class T>
+inline void BaseObject::registerObject(T* object, ObjectList<T>& objectList)
+{
+  this->_classes.push_front(ClassEntry(&objectList, objectList.registerObject(object)));
+}
+
 #endif /* __BASE_OBJECT_H_ */
Index: trunk/src/lib/lang/class_id.cc
===================================================================
--- trunk/src/lib/lang/class_id.cc	(revision 9869)
+++ trunk/src/lib/lang/class_id.cc	(revision 9869)
@@ -0,0 +1,43 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2006 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "class_id.h"
+#include "object_list.h"
+
+/**
+ * @brief a Default Constructor.
+ * this Always points to the ID of the NullClass.
+ */
+ClassID::ClassID()
+{
+  NullClass::acquireID(this->_id, this->_name);
+};
+
+/**
+ * @brief Acquiring the ID of a objectList.
+ * @param objList The ObjectList to acquire the ID from.
+ */
+ClassID::ClassID(const ObjectListBase* const objList)
+{
+  objList->acquireID(this->_id, this->_name);
+}
+
+
+ClassID NullClass::_classID;
+
+int NullClass::_nullID;
+const std::string NullClass::_nullName = std::string("NullClass");
Index: trunk/src/lib/lang/class_id.h
===================================================================
--- trunk/src/lib/lang/class_id.h	(revision 9869)
+++ trunk/src/lib/lang/class_id.h	(revision 9869)
@@ -0,0 +1,78 @@
+/*!
+ * @file class_id.h
+ * @brief Definition of a dynamically allocating ClassID
+ *
+ */
+
+#ifndef _CLASS_ID_H
+#define _CLASS_ID_H
+
+#include <string>
+
+class ObjectListBase;
+
+//! A class to dynamically allocate ClassID's and to support a isA operator
+/**
+ * A ClassID can only be aquired over a ObjectList,
+ * thus enabling the developer to have permanent access to the correct ID and ClassName
+ *
+ * The Idea behind this concept is, that storing a ClassID that changes its internal state
+ * all ClassID's will be updated correctly.
+ *
+ * Since the Existance of any ObjectList is a requirement during the working process all
+ * ID's should reference a valid ID and ClassName
+ */
+class ClassID
+{
+public:
+  ClassID();
+  ClassID(const ObjectListBase* const id);
+  /// the copy constructor is also defined implicitely.
+
+  /** @returns A constant reference to the ID. */
+  const int& id() const { return *_id; };
+  /** @returns A constant reference to the Name. */
+  const std::string& name() const { return *_name; };
+
+  /** @param id the id to compare @returns true on match (match is same ID) @brief compares two id's */
+  bool operator==(const ClassID& id) const { return *_id == *id._id /* || _name == id._name */; };
+  /** @param id the id to compare @returns true on match (match is same ID) @brief compares two id's */
+  bool operator==(int id) const { return *_id == id; };
+  /** @param name the id to compare @returns true on match (match is same Name) @brief compares an ID with a ClassName */
+  bool operator==(const std::string& name) const { return *_name == name; };
+  /** @param id the id to compare @returns false on match (match is same ID) @brief compares two id's */
+  bool operator!=(const ClassID& id) const { return *_id != *id._id /* && _name != id._name*/;  };
+  /** @param id the id to compare @returns false on match (match is same ID) @brief compares two id's */
+  bool operator!=(int id) const { return *_id != id; };
+  /** @param name the id to compare @returns false on match (match is same Name) @brief compares an ID with a ClassName */
+  bool operator!=(const std::string& name) const { return *_name != name; };
+  /** @param classID: the Id to compare @returns true if this id is smaller than the classID's ID */
+  bool operator<(const ClassID& classID) const { return *this->_id < *classID._id; };
+
+private:
+  const int*                _id;           //!< A pointer to the ID of the ClassID.
+  const std::string*        _name;         //!< A pointer to the Name of the ClassID.
+};
+
+//! A NullClass. This is the Null of the ClassID.
+/**
+ * implemented as a Class id can be used to reference NullObjects.
+ */
+class NullClass
+{
+public:
+  /** @returns the NullClass' ID. */
+  static const ClassID& staticClassID() { return NullClass::_classID; }
+  /** @param id the ID to acquire @param name the name to acquire @brief acquires the ID of this Class */
+  static void acquireID(const int*& id, const std::string*& name) { id = &_nullID; name = &_nullName; };
+
+private:
+  NullClass() {}; //!< The Default Constructor is hidden from the User.
+
+private:
+  static ClassID            _classID;      //!< The NullClass' ID
+  static const std::string  _nullName;     //!< The NullClass' Name ("NullClass")
+  static int                _nullID;       //!< The NullClass' ID
+};
+
+#endif /* _CLASS_ID_H */
Index: trunk/src/lib/lang/class_list.cc
===================================================================
--- trunk/src/lib/lang/class_list.cc	(revision 9682)
+++ 	(revision )
@@ -1,402 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   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, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-*/
-
-//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
-
-#include "class_list.h"
-#include "base_object.h"
-
-#include "compiler.h"
-#include "debug.h"
-#include <cmath>
-
-
-
-/**
- * @brief Creates a new ClassList
-*/
-ClassList::ClassList(ClassID classID, unsigned long classIDFull, const std::string& className)
-  : className(className)
-{
-  this->classID = classID;
-  this->classIDFull = classIDFull;
-}
-
-/**
- * @brief standard deconstructor
-*/
-ClassList::~ClassList ()
-{
-//   ClassList::classList->clear());
-}
-
-//! a List of all known Classes.
-std::list<ClassList>* ClassList::classList = NULL;
-
-//! a List of all strings of all classes, that have registered so far.
-std::list<std::string> ClassList::classNames;
-
-/**
- * @brief Adds a new Object to the ClassList (and if necessary a new Class)
- * @param objectPointer Pointer to the Object at hand
- * @param classID ID of the Given ObjectType \see ClassID
- * @param className name of the Class to add
- *
- * !! FIRST YOU HAVE TO CALL THIS FUNCTION ONCE
- * !! Before unsing the ClassList, as it creates the ClassLits
- */
-ClassList* ClassList::addToClassList(BaseObject* objectPointer, ClassID classID, unsigned long classIDFull, const std::string& className)
-{
-  if (unlikely(classList == NULL))
-    ClassList::classList = new std::list<ClassList>();
-
-  PRINTF(5)("subscribe a '%s'\n", className.c_str() );
-
-  ClassList* regClass = ClassList::getClassList(classID);
-  if (regClass != NULL)
-  {
-    regClass->objectList.push_back(objectPointer);
-    return regClass;
-  }
-  else
-  {
-    ClassList::classList->push_back(ClassList(classID, classIDFull, className));
-    ClassList::classList->back().objectList.push_back(objectPointer);
-    return &ClassList::classList->back();
-  }
-}
-
-/**
- * @brief removes an Object from a the ClassList
- * @param objectPointer the Object to delete from the List
- */
-void ClassList::removeFromClassList(BaseObject* objectPointer)
-{
-  std::list<ClassList>::iterator cl;
-  for(cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
-  {
-    if (objectPointer->isA((*cl).classID))
-    {
-      std::list<BaseObject*>::iterator bo = std::find ((*cl).objectList.begin(), (*cl).objectList.end(), objectPointer);
-      if (bo != (*cl).objectList.end())
-          (*cl).objectList.erase(bo);
-    }
-  }
-}
-
-/**
- * @brief grabs the names of all Classes, and injects it into a List of const chars
- * @return the generated List
- *
- * This function first looks, if the List has been changed (by the ListSize)
- * befor it changes anything.
- */
-const std::list<std::string>* ClassList::getClassNames()
-{
-  if (ClassList::classNames.size() != ClassList::classList->size())
-  {
-      ClassList::classNames.clear();
-
-      std::list<ClassList>::const_iterator cl;
-      for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
-        ClassList::classNames.push_back((*cl).className);
-  }
-
-  return &ClassList::classNames;
-}
-
-/**
- * @brief searches for classID and returns the list of Entities
- * @param classID the ID of the class to get the list from
- * @return the List accessed by classID, or NULL if not found
- */
-const std::list<BaseObject*>* ClassList::getList(ClassID classID)
-{
-  ClassList* fl;
-  return ((fl = ClassList::getClassList(classID)) != NULL)?
-       &(fl->objectList) : NULL;
-
-/*
-  std::list<ClassList>::iterator classIT = find (classList->begin(), classList->end(), classID);
-  return (likely(classIT != classList->end()))? &(*classIT).objectList : NULL;*/
-
-/*  for (classIT = ClassList::classList->begin(); classIT != ClassList::classList->end(); classIT++)
-  {
-    if ((*classIT) == classID )
-      return &(*classIT).objectList;
-  }
-  return NULL;*/
-}
-
-/**
- * @brief searches for className and returns the list of Entities
- * @param className the name of the class to get the list from
- * @return the List accessed by classID, or NULL if not found
- */
-const std::list<BaseObject*>* ClassList::getList(const std::string& className)
-{
-  ClassList* fl;
-  return ((fl = ClassList::getClassList(className)) != NULL)?
-      &(fl->objectList) : NULL;
-
-  /*
-  std::list<ClassList>::iterator classIT = find (classList->begin(), classList->end(), className);
-  return (likely(classIT != classList->end()))? &(*classIT).objectList : NULL;*/
-
-
-/*  for (classIT = ClassList::classList->begin(); classIT != ClassList::classList->end(); classIT++)
-  {
-    if ((*classIT) == className )
-      return &(*classIT).objectList;
-  }
-  return NULL;*/
-}
-
-/**
- * !!PRIVATE!!
- * @param classID the ClassID to search for
- * @returns the ClassList with classID as specifyer, or NULL if not
- */
-ClassList* ClassList::getClassList(ClassID classID)
-{
-  std::list<ClassList>::iterator classIT = find (ClassList::classList->begin(), ClassList::classList->end(), classID);
-  return (likely(classIT != classList->end()))? &(*classIT) : NULL;
-}
-
-
-/**
- * !!PRIVATE!!
- * @param className the ClassName to search for
- * @returns the ClassList with className as specifyer, or NULL if not
- */
-ClassList* ClassList::getClassList(const std::string& className)
-{
-  if (className.empty())
-    return NULL;
-  std::list<ClassList>::iterator classIT = find (classList->begin(), classList->end(), className);
-  return (likely(classIT != classList->end()))? &(*classIT) : NULL;
-}
-
-
-/**
- * @brief checks if the BaseObject* object exists.
- * @param objectName the name of the BaseObject to look for
- * @param classID if not CL_NULL it will only search through a specific type of Objects. Otherwise it will be searched everywhere.
- * @return true, if the Object Exists in the specified ClassID, false otherwise
- * @todo: speed this up!!
- */
-BaseObject* ClassList::getObject(const std::string& objectName, ClassID classID)
-{
-  if (classID != CL_NULL)
-  {
-    ClassList* cl = ClassList::getClassList(classID);
-    if (cl != NULL)
-    {
-      std::list<BaseObject*>::iterator bo;
-      for (bo = cl->objectList.begin(); bo != cl->objectList.end(); bo++)
-        if (objectName == (*bo)->getName())
-          return (*bo);
-    }
-  }
-  else
-  {
-    std::list<ClassList>::iterator cl;
-    for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
-    {
-      std::list<BaseObject*>::iterator bo;
-      for (bo = (*cl).objectList.begin(); bo != (*cl).objectList.end(); bo++)
-        if (objectName == (*bo)->getName())
-          return (*bo);
-    }
-  }
-  return NULL;
-}
-
-
-/**
- * @brief checks if the BaseObject* object exists.
- * @param objectName the name of the BaseObject to look for
- * @param classID if not CL_NULL it will only search through a specific type of Objects. Otherwise it will be searched everywhere.
- * @return true, if the Object Exists in the specified ClassID, false otherwise
- * @todo: speed this up!!
- */
-BaseObject* ClassList::getObject(const std::string& objectName, const std::string& className)
-{
-
-  ClassList* cl = ClassList::getClassList(className);
-  if (cl != NULL)
-  {
-    std::list<BaseObject*>::iterator bo;
-    for (bo = cl->objectList.begin(); bo != cl->objectList.end(); bo++)
-      if (objectName == (*bo)->getName())
-        return (*bo);
-  }
-  return NULL;
-}
-
-
-/**
- * @brief checks if the BaseObject* object exists.
- * @param object the Pointer to a BaseObject to check if it exists
- * @param classID if not CL_NULL it will only search through a specific type of Objects. Otherwise it will be searched everywhere.
- * @return true, if the Object Exists in the specified ClassID, false otherwise
- * @todo: speed this up!!
- */
-bool ClassList::exists(const BaseObject* object, ClassID classID)
-{
-  if (classID != CL_NULL)
-  {
-    ClassList* cl = ClassList::getClassList(classID);
-    if (cl != NULL)
-    {
-      std::list<BaseObject*>::const_iterator bo = std::find (cl->objectList.begin(), cl->objectList.end(), object);
-      return (bo != cl->objectList.end());
-    }
-  }
-  else
-  {
-    std::list<ClassList>::iterator cl;
-    for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
-    {
-      std::list<BaseObject*>::const_iterator bo = std::find ((*cl).objectList.begin(), (*cl).objectList.end(), object);
-      if (bo != (*cl).objectList.end())
-        return true;
-    }
-  }
-  return false;
-}
-
-bool ClassList::exists(const std::string& className, const std::string& objectName)
-{
-  ClassList* cl = ClassList::getClassList(className);
-  if (likely(cl != NULL))
-  {
-    std::list<BaseObject*>::iterator bo;
-    for (bo = cl->objectList.begin(); bo != cl->objectList.end(); bo++)
-      if (objectName == (*bo)->getName())
-        return true;
-  }
-  return false;
-}
-
-
-/**
- * @brief prints out a string of all the types this Object matches
- * @param object a Pointer to the object to analyze
- */
-void ClassList::whatIs(const BaseObject* object)
-{
-  std::list<ClassList>::iterator cl;
-  for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
-    if (object->isA((*cl).classID))
-  {
-    PRINT(0)("=%s::0x%.8X=-", (*cl).className.c_str(), (*cl).classID);
-  }
-}
-
-/**
- * @brief converts a ClassID into a string
- * @param classID the ClassID to search for
- * @return a String containing the name of the Class, NULL if the Class was not found
- */
-const std::string& ClassList::IDToString(ClassID classID)
-{
-  static const std::string empty("");
-
-  ClassList* cl = ClassList::getClassList(classID);
-  return (cl != NULL) ? cl->className : empty;
-}
-
-/**
- * @brief converts a String into a ClassID
- * @param className the name of the class to search for
- * @return the ClassID. CL_NULL, if the class was not found.
- */
-ClassID ClassList::StringToID(const std::string& className)
-{
-  ClassList* cl = ClassList::getClassList(className);
-  return (cl != NULL) ? cl->classID : CL_NULL;
-}
-
-/**
- * @brief checks if this ClassList is named className
- * @param className the Name to check this ClassList's ClassName against
- * @returns true on match, false otherwise
- */
-bool ClassList::operator==(const std::string& className)
-{
-  return (this->className == className);
-}
-
-
-
-/**
- * @brief Print out some very nice debug information
- * @param debugLevel the level of verbosity
- * @param classID the class that should be displayed (if CL_NULL (default) all classes will be displayed)
- */
-void ClassList::debug(unsigned int debugLevel, ClassID classID)
-{
-  if (debugLevel > 3)
-    debugLevel = 3;
-  PRINT(0)("==========================\n");
-  PRINT(0)("=  CLASS_LIST (level %d)  =\n", debugLevel);
-  PRINT(0)("==========================\n");
-  PRINT(0)("| knows %d Classes\n|\n", ClassList::classList->size());
-  char niceString[100];
-  int lenCount = 0;
-
-  std::list<ClassList>::iterator cl;
-  for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
-  {
-    if ((debugLevel >= 1 || (*cl).objectList.size() > 0 ) &&
-         (classID == CL_NULL || unlikely (classID == (*cl).classID)))
-    {
-      lenCount = 1;
-      while (std::pow((float)10, (int)lenCount) <= (*cl).objectList.size())
-        ++lenCount;
-      for (unsigned int i=0; i < 30-(*cl).className.size() - lenCount; i++)
-        (niceString[i]) = ' ';
-      niceString[30-(*cl).className.size() - lenCount] = '\0';
-
-      PRINT(0)("| CLASS %s::%s %d\n", (*cl).className.c_str(), niceString, (*cl).objectList.size());
-
-      if (debugLevel >=2 && (*cl).objectList.size() > 0)
-      {
-        PRINT(0)("|  Listing Instances:\n");
-        std::list<BaseObject*>::const_iterator bo;
-        for (bo = (*cl).objectList.begin(); bo != (*cl).objectList.end(); bo++)
-        {
-          PRINT(0)("|   %s::%s::(0x%.8X->%p ", (*bo)->getClassCName(), (*bo)->getCName(), (*bo)->getClassID(), (*bo));
-          if (debugLevel == 3)
-            ClassList::whatIs(*bo);
-          PRINT(0)("\n");
-        }
-      }
-    }
-  }
-  PRINT(0)("=======================CL=\n");
-}
-
-/**
- * @brief Print out some very nice debug information
- * @param debugLevel the level of verbosity
- * @param className the class that should be displayed.
- * @see ClassList::debug
- */
-void ClassList::debugS(const std::string& className, unsigned int debugLevel)
-{
-  ClassList::debug(debugLevel, ClassList::StringToID(className));
-}
Index: trunk/src/lib/lang/class_list.h
===================================================================
--- trunk/src/lib/lang/class_list.h	(revision 9682)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/*!
- * @file class_list.h
-  *  Definition of the Class List, that handles a Class-Specific-Control structure
-
- */
-
-#ifndef _CLASS_LIST_H
-#define _CLASS_LIST_H
-
-#include "class_id.h"
-#include <list>
-#include <string>
-
-// FORWARD DECLARATION
-class BaseObject;
-
-//! A class that handles Pointers to Objects of all type.
-/**
- * here all the Pointers to all the Object of orxonox are stored, that implement BaseObject
- * for now.
- * You can get Any Object's Reference to BaseObject with dynamic_cast<T>(ClassList::getObject(name, CL_T_NAME));
- *  where: T: is the Class to cast to,
- *   name: the name of the Object (not className)
- *   CL_T_NAME: the class Identifier, (if CL_NULL or nothing it will take longer, because all BaseObject's are searched through)
- *
- * There is also the exists-function, that just checks, if a Reference is still in existence.
- *
- * @see ClassID, BaseObject, dynamic_cast
- */
-class ClassList {
-  friend class BaseObject;
-
-  public:
-    ClassList(ClassID classID, unsigned long classIDFull, const std::string& className);
-    virtual ~ClassList();
-
-    static const std::list<BaseObject*>*  getList(ClassID classID = CL_NULL);// { return (ClassList* fl = ClassList::getClassList(classID) != NULL)? &(fl->objectList) : NULL; };
-    static const std::list<BaseObject*>*  getList(const std::string& className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
-    static const std::list<std::string>*  getClassNames();
-    static BaseObject*                    getObject(const std::string& objectName, ClassID classID = CL_NULL);
-    static BaseObject*                    getObject(const std::string& objectName, const std::string& className);
-    static bool                           exists(const BaseObject* object, ClassID classID = CL_NULL);
-    static bool                           exists(const std::string& className, const std::string& objectName);
-
-    void                                  sendBack(std::list<BaseObject*>::const_iterator it);
-
-    static void                           whatIs(const BaseObject* object);
-
-    static const std::string&             IDToString(ClassID classID = CL_NULL);
-    static ClassID                        StringToID(const std::string& className);
-    static void                           debug(unsigned int debugLevel = 0, ClassID classID = CL_NULL);
-    static void                           debugS(const std::string& className = "", unsigned int debugLevel = 0);
-
-    inline bool                           operator==(ClassID classID) { return (this->classID == classID); };
-    bool                                  operator==(const std::string& className);
-    inline ClassID                        getLeafClassID() const { return this->classID; };
-
-  private:
-    /* MAINTENANCE FUNCTIONS THESE ARE !!ONLY FOR BASEOBJECT !! */
-    static ClassList*                     addToClassList(BaseObject* objectPointer, ClassID classID, unsigned long classIDFull, const std::string& className);
-    static void                           removeFromClassList(BaseObject* objectPointer);
-
-    static ClassList*                     getClassList(ClassID classID);
-    static ClassList*                     getClassList(const std::string& className);
-
-  private:
-    ClassID                               classID;                //!< ClassID stored in this ClassList
-    unsigned long                         classIDFull;            //!< The Full ClassID of this Class.
-
-    const std::string                     className;              //!< Name of the Class Stored here
-
-    std::list<BaseObject*>                objectList;             //!< A list of Objects belonging to this Class
-
-    // STATIC MEMBERS
-    static std::list<ClassList>*          classList;              //!< The first Class in the List
-    static std::list<std::string>         classNames;             //!< a List of all Names of all classes, that have registered so far.
-};
-
-#endif /* _CLASS_LIST_H */
Index: trunk/src/lib/lang/new_class_id.cc
===================================================================
--- trunk/src/lib/lang/new_class_id.cc	(revision 9682)
+++ 	(revision )
@@ -1,97 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2006 orx
-
-   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, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-*/
-
-//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
-
-#include "new_class_id.h"
-#include <cassert>
-#include "debug.h"
-
-///////////////////////////////////////////////////////////
-//// CLASS ID definiton. //////////////////////////////////
-///////////////////////////////////////////////////////////
-/**
- * @brief standard constructor
- */
-NewClassID::NewClassID ()
-{}
-
-
-/**
- * @brief standard deconstructor
- */
-NewClassID::~NewClassID ()
-{
-  ClassList::iterator it;
-  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
-  {
-    (*it)._objectList->unregisterObject((*it)._iterator);
-    delete (*it)._iterator;
-  }
-}
-
-
-/**
- * @brief Seeks in the Inheritance if it matches objectList.
- * @param objectList The ObjectList this should be a member of (by Pointer-comparison).
- * @return True if found, false if not.
- */
-bool NewClassID::isA(const NewObjectListBase& objectList) const
-{
-  ClassList::const_iterator it;
-  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
-    if ((*it)._objectList == &objectList)
-      return true;
-  return false;
-}
-
-/**
- * @brief Seeks in the Inheritance if it matches objectList.
- * @param classID The ClassID of the class this should be a member of.
- * @return True if found, false if not.
- */
-bool NewClassID::isA(int classID) const
-{
-  ClassList::const_iterator it;
-  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
-    if (*(*it)._objectList == classID)
-      return true;
-  return false;
-}
-
-/**
- * @brief Seeks in the Inheritance if it matches objectList.
- * @param className The ClassName of the class this should be a member of.
- * @return True if found, false if not.
- */
-bool NewClassID::isA(const std::string& className) const
-{
-  ClassList::const_iterator it;
-  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
-    if (*(*it)._objectList == className)
-      return true;
-  return false;
-}
-
-
-void NewClassID::listInheritance() const
-{
-  PRINT(0)("Listing inheritance diagram for ....: ");
-  ClassList::const_iterator it;
-  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
-    PRINT(0)(" -> %s(id:%d)", (*it)._objectList->name().c_str(), (*it)._objectList->id());
-  PRINT(0)("\n");
-
-}
Index: trunk/src/lib/lang/new_class_id.h
===================================================================
--- trunk/src/lib/lang/new_class_id.h	(revision 9682)
+++ 	(revision )
@@ -1,67 +1,0 @@
-/*!
- * @file new_class_id.h
- * @brief Definition of a dynamically allocating ClassID
- *
- */
-
-#ifndef _NEW_CLASS_ID_H
-#define _NEW_CLASS_ID_H
-
-#include "new_object_list.h"
-
-#include <string>
-#include <list>
-
-//! A class to dynamically allocate ClassID's and support a isA operator
-class NewClassID
-{
-public:
-  NewClassID();
-  ~NewClassID();
-
-  /** @returns the ClassName of the Topmost Object of the ClassStack */
-  inline const std::string& getClassName() const { return _classes.front()._objectList->name(); }
-  /** @returns the ID of the Topmost object of the ClassStack */
-  inline int leafClassID() const { return _classes.front()._objectList->id(); }
-
-  template<class T> void registerObject(T* object, NewObjectList<T>& list);
-  bool isA(const NewObjectListBase& objectList) const;
-  bool isA(int classID) const;
-  bool isA(const std::string& className) const;
-
-  void listInheritance() const;
-
-private:
-  //////////////////////////////
-  //// Type Definition Part ////
-  //////////////////////////////
-  //! A ClassEntry so we can store Classes inside of Objects
-  struct ClassEntry
-  {
-    /** Simple Constuctor @param objectList the NewObjectList, @param iterator the (intrusive) Iterator inside of the ObjectList */
-    inline ClassEntry (NewObjectListBase* objectList, NewObjectListBase::IteratorBase* iterator) : _objectList(objectList), _iterator(iterator) {}
-    NewObjectListBase*                _objectList;  //!< A ObjectList this Object is part of
-    NewObjectListBase::IteratorBase*  _iterator;    //!< An iterator pointing to the position of the Object inside of the List.
-  };
-  typedef std::list<ClassEntry>        ClassList;   //!< Type definition for the List.
-
-  ClassList                           _classes;     //!< All Classes this object is part of.
-};
-
-
-/**
- * @brief Registeres an Object of Type T to objectList
- * @param object The Object to append to the objectList.
- * @param objectList The ObjectList to append the Object to.
- *
- * This function is essential to integrate objects into their designated ObjectList.
- * Remember if you do not want objects to be stored in Lists (less overhead),
- * do not attempt to call this function.
- */
-template<class T>
-inline void NewClassID::registerObject(T* object, NewObjectList<T>& objectList)
-{
-  this->_classes.push_front(ClassEntry(&objectList, objectList.registerObject(object)));
-}
-
-#endif /* _NEW_CLASS_ID_H */
Index: trunk/src/lib/lang/new_object_list.cc
===================================================================
--- trunk/src/lib/lang/new_object_list.cc	(revision 9682)
+++ 	(revision )
@@ -1,151 +1,0 @@
-/*
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2006 orx
-
-   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, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-*/
-
-//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
-
-#include "new_object_list.h"
-#include <cassert>
-
-
-/**
- * @brief Constructor, that creates an ObjectList while checking (development mode) for uniqueness of all Keys (names and ID's)
- * @param className The Name of the Class to create an ObjectList for.
- * @param id The ID if you like, or -1 otherwise.
- * @return a new NewObejctList
- */
-NewObjectListBase::NewObjectListBase(const std::string& className, int id)
-    : _name(className)
-{
-  if (NewObjectListBase::_classesByID == NULL)
-  {
-    NewObjectListBase::_classesByID = new classIDMap;
-    assert (NewObjectListBase::_classesByName == NULL);
-    NewObjectListBase::_classesByName = new classNameMap;
-  }
-  assert(!NewObjectListBase::classNameExists(className) && "Classes should only be included once, and no two classes should have the same name (key value)");
-
-  if (id != -1)
-  {
-    this->_id = id;
-  }
-  else
-  {
-    this->_id = NewObjectListBase::_classesByID->size();
-    // searching for a free ID
-    while (NewObjectListBase::classIDExists(_id)) ++id;
-  }
-  assert(!NewObjectListBase::classIDExists(id) && "Classes should only be included once, and no two classes should have the same ID (key value)");
-
-  /// Some Output, that will fall out later
-  //std::cout << "register new ObjectList " << className << " ID: " << this->_id << std::endl;
-
-  (*NewObjectListBase::_classesByID)[this->_id] = this;
-  (*NewObjectListBase::_classesByName)[this->_name] = this;
-}
-
-
-/**
- * Destructor.
- *
- * This destructor deletes the NewObjectList, and cleans up the NewObjectList sorted Maps.
- */
-NewObjectListBase::~NewObjectListBase()
-{
-  assert (NewObjectListBase::_classesByName != NULL && NewObjectListBase::_classesByID != NULL);
-  /*
-  std::cout << "Erasing: " << this->_name << " "<< this->_id  << std::endl;
-  std::cout << "SIZE OF _classByID: " << NewObjectListBase::_classesByID->size() << std::endl;
-  std::cout << "SIZE OF _classByName: " << NewObjectListBase::_classesByName->size() << std::endl;
-  */
-  NewObjectListBase::_classesByName->erase(this->_name);
-  NewObjectListBase::_classesByID->erase(this->_id);
-
-  if (NewObjectListBase::_classesByID->empty())
-  {
-    delete NewObjectListBase::_classesByID;
-    NewObjectListBase::_classesByID = NULL;
-    assert(NewObjectListBase::_classesByName != NULL);
-    delete NewObjectListBase::_classesByName;
-    NewObjectListBase::_classesByName = NULL;
-  }
-}
-
-NewObjectListBase::classIDMap* NewObjectListBase::_classesByID = NULL;
-NewObjectListBase::classNameMap* NewObjectListBase::_classesByName = NULL;
-
-/**
- * @returns the Registered Class Count.
- */
-unsigned int NewObjectListBase::classCount()
-{
-  assert (NewObjectListBase::_classesByID != NULL);
-  return NewObjectListBase::_classesByID->size();
-};
-
-/**
- * @brief Checks if a Class with name already exists.
- * @param name The Name of the Class to check.
- * @return true if such a class already exists.
- */
-bool NewObjectListBase::classNameExists(const std::string& name)
-{
-  return (NewObjectListBase::_classesByName->find(name) != NewObjectListBase::_classesByName->end());
-}
-
-/**
- * @brief Checks if a Class with name already exists.
- * @param name The Name of the Class to check.
- * @return true if such a class already exists.
- */
-bool NewObjectListBase::classIDExists(int id)
-{
-  return (NewObjectListBase::_classesByID->find(id) != NewObjectListBase::_classesByID->end());
-}
-
-
-/**
- * @brief Converts an ID into a ClassName String.
- * @param classID The ID to convert.
- * @return The ClassName or an empty string if the ID was not found.
- */
-const std::string& NewObjectListBase::IDToString(int classID)
-{
-  assert (NewObjectListBase::_classesByID != NULL);
-  NewObjectListBase::classIDMap::iterator it = NewObjectListBase::_classesByID->find(classID);
-  if (it != NewObjectListBase::_classesByID->end())
-    return (*it).second->name();
-  else
-  {
-    static std::string empty;
-    return empty;
-  }
-}
-
-
-/**
- * @brief Converts a String into an ID
- * @param className the Name of the Class to search for
- * @return The Classes ID if found, -1 otherwise.
- */
-int NewObjectListBase::StringToID(const std::string& className)
-{
-  assert (NewObjectListBase::_classesByName != NULL);
-  NewObjectListBase::classNameMap::iterator it = NewObjectListBase::_classesByName->find(className);
-  if (it != NewObjectListBase::_classesByName->end())
-    return (*it).second->id();
-  else
-    return -1;
-}
-
Index: trunk/src/lib/lang/new_object_list.h
===================================================================
--- trunk/src/lib/lang/new_object_list.h	(revision 9682)
+++ 	(revision )
@@ -1,191 +1,0 @@
-/*!
- * @file new_object_list.h
- * @brief Definition of a dynamically allocating ClassID
- *
- */
-
-#ifndef _NEW_OBJECT_LIST_H
-#define _NEW_OBJECT_LIST_H
-
-#include "type_info.h"
-#include <map>
-#include <list>
-#include <string>
-#include <iostream>
-
-
-#define NewObjectListDeclaration(ClassName) \
-   static NewObjectList<ClassName> objectList
-
-#define NewObjectListDefinitionID(ClassName, ID) \
-   NewObjectList<ClassName> ClassName::objectList(#ClassName, ID)
-
-
-#define NewObjectListDefinition(ClassName) \
-    NewObjectListDefinitionID(ClassName, -1)
-
-
-//! The superclass that all NewObjectLists follow.
-/**
- * @see template<class T> NewObjectList<T>
- */
-class NewObjectListBase
-{
-public:
-  //! An iterator Base-Class, for iterator-casting and storing.
-  class IteratorBase { };
-
-public:
-  inline int id() const { return _id; };
-  inline const std::string& name() const { return _name; };
-  bool operator==(int id) const { return _id == id; };
-  bool operator==(const std::string& name) const { return _name == name; };
-
-  virtual void debug() const = 0;
-
-  static unsigned int                   classCount();
-  static const std::string&             IDToString(int classID);
-  static int                            StringToID(const std::string& className);
-
-  static const std::list<std::string>&  getClassNames();
-
-  virtual void unregisterObject(IteratorBase* _iterators) = 0;
-
-protected:
-  NewObjectListBase(const std::string& className, int id = -1);
-  virtual ~NewObjectListBase();
-
-private:
-  NewObjectListBase(const NewObjectListBase&);
-
-  static bool classIDExists(int id);
-  static bool classNameExists(const std::string& className);
-
-protected:
-  typedef std::map<int, NewObjectListBase*> classIDMap;    //!< The Generic Map.
-  typedef std::map<std::string, NewObjectListBase*> classNameMap;//!< The Generic Map.
-
-  int                           _id;                //!< The ID of the class.
-  std::string                   _name;              //!< The Name of the Class.
-
-private:
-  static classIDMap*            _classesByID;       //!< A Map of all the classes in existance.
-  static classNameMap*          _classesByName;     //!< A Map of all the classes in existance.
-  static std::list<std::string> _classNames;        //!< A list of all the registered ClassNames.
-};
-
-
-/////////////////////////
-//// TEMPLATISATION /////
-/////////////////////////
-//! Defines a ObjectsList handler for objects of type T.
-/**
- * To define a Class with a ObjectList, you have to:
- *  1. Include 'NewObjectListDeclaration(T);' in its Declaration (at the beginning)
- *  2. Include 'NewObjectListDefinition(T);' in some Definition file (cc-file)
- *  3. In the constructor add 'registerObject(this, objectList);'
- *
- * @note The Class must define the compare with const std::string& operator for this to work.
- */
-template<class T>
-class NewObjectList : public NewObjectListBase
-{
-public:
-  typedef std::list<T*>                  list;
-  typedef typename list::iterator        iterator;
-  typedef typename list::const_iterator  const_iterator;
-
-class Iterator : public NewObjectListBase::IteratorBase
-  {
-  public:
-    Iterator(iterator it) { _it = it; }
-    inline iterator& it() { return _it; }
-    typename NewObjectList::iterator _it;
-  };
-
-public:
-  NewObjectList(const std::string& name, int id = -1);
-  ~NewObjectList();
-
-  T*                      getObject(const std::string& name) const;
-  inline const list&      objects() const { return _objects; };
-
-  NewObjectListBase::IteratorBase* registerObject(T* object);
-  void unregisterObject(IteratorBase* iterator);
-
-  virtual void debug() const;
-
-private:
-  //! the copy constructor will be hidden.
-  NewObjectList(const NewObjectList& definer) {};
-
-private:
-  list                _objects;
-};
-
-
-
-
-
-/////////////////////////
-//// IMPLEMENTATION /////
-/////////////////////////
-/**
- * @brief creates a new NewObjectList
- * @param name The name of the Class.
- * @param id The ID of the class if desired, or -1 if an id should be assigned automatically.
- */
-template <class T>
-NewObjectList<T>::NewObjectList(const std::string& name, int id)
-    : NewObjectListBase(name, id)
-{}
-
-/**
- * @brief deletes the NewObjectList.
- */
-template <class T>
-NewObjectList<T>::~NewObjectList()
-{
-  if (!_objects.empty())
-  {
-    std::cout << "There are still Object in the ObjectList of " << this->name() << "(id:" << this->id() << ")\n";
-    this->debug();
-  }
-}
-
-template <class T>
-T* NewObjectList<T>::getObject(const std::string& name) const
-{
-  iterator it = std::find(this->_objects.begin(), this->_objects.end(), name);
-  if (it != this->_objects.end())
-    return *it;
-  else
-    return NULL;
-}
-
-template <class T>
-NewObjectListBase::IteratorBase* NewObjectList<T>::registerObject(T* object)
-{
-  this->_objects.push_front(object);
-  return new Iterator(this->_objects.begin());
-}
-
-template <class T>
-void NewObjectList<T>::unregisterObject(IteratorBase* iterator)
-{
-  this->_objects.erase(static_cast<Iterator*>(iterator)->it());
-  //_objects.erase(std::find(_objects.begin(), _objects.end(), object));
-}
-
-
-template <class T>
-void NewObjectList<T>::debug() const
-{
-  const_iterator it;
-  for (it = this->_objects.begin(); it != this->_objects.end(); ++it)
-  {
-    std::cout << (*it)->getName() << std::endl;
-  }
-}
-
-#endif /* _NEW_OBJECT_LIST_H */
Index: trunk/src/lib/lang/object_list.cc
===================================================================
--- trunk/src/lib/lang/object_list.cc	(revision 9869)
+++ trunk/src/lib/lang/object_list.cc	(revision 9869)
@@ -0,0 +1,331 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2006 orx
+
+   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, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
+
+#include "object_list.h"
+#include <cassert>
+
+/**
+ * @brief Constructor, that creates an ObjectList while checking (development mode) for uniqueness of all Keys (names and ID's)
+ * @param className The Name of the Class to create an ObjectList for.
+ * @param id The ID if you like, or -1 otherwise.
+ * @return a new NewObejctList
+ */
+ObjectListBase::ObjectListBase(const std::string& className, int id)
+    : _name(className)
+{
+  if (ObjectListBase::_classesByID == NULL)
+  {
+    ObjectListBase::_classesByID = new IDMap;
+    assert (ObjectListBase::_classesByName == NULL);
+    ObjectListBase::_classesByName = new NameMap;
+  }
+  assert(!ObjectListBase::classNameExists(className) && "Classes should only be included once, and no two classes should have the same name (key value)");
+
+  if (id == -1)
+  {
+    id = ObjectListBase::_classesByID->size();
+    // searching for a free ID
+    while (ObjectListBase::classIDExists(id)) ++id;
+  }
+  assert(!ObjectListBase::classIDExists(id) && "Classes should only be included once, and no two classes should have the same ID (key value)");
+
+  this->_id = id;
+  /// Some Output, that will fall out later
+  //  std::cout << "register new ObjectList " << className << " ID: " << this->_id << std::endl;
+
+  this->_identity = ClassID(this);
+  (*ObjectListBase::_classesByID)[this->_identity.id()] = this;
+  (*ObjectListBase::_classesByName)[this->_identity.name()] = this;
+}
+
+
+/**
+ * Destructor.
+ *
+ * This destructor deletes the ObjectList, and cleans up the ObjectList sorted Maps.
+ */
+ObjectListBase::~ObjectListBase()
+{
+  assert (ObjectListBase::_classesByName != NULL && ObjectListBase::_classesByID != NULL);
+  /*
+  std::cout << "Erasing: " << this->_name << " "<< this->_id  << std::endl;
+  std::cout << "SIZE OF _classByID: " << ObjectListBase::_classesByID->size() << std::endl;
+  std::cout << "SIZE OF _classByName: " << ObjectListBase::_classesByName->size() << std::endl;
+  */
+  ObjectListBase::_classesByID->erase(this->_identity.id());
+  ObjectListBase::_classesByName->erase(this->_identity.name());
+
+  if (ObjectListBase::_classesByID->empty())
+  {
+    delete ObjectListBase::_classesByID;
+    ObjectListBase::_classesByID = NULL;
+    assert(ObjectListBase::_classesByName != NULL);
+    delete ObjectListBase::_classesByName;
+    ObjectListBase::_classesByName = NULL;
+  }
+}
+
+ObjectListBase::IDMap* ObjectListBase::_classesByID = NULL;
+ObjectListBase::NameMap* ObjectListBase::_classesByName = NULL;
+std::list<std::string> ObjectListBase::_classNames;
+
+/**
+ * @returns the Registered Class Count.
+ */
+unsigned int ObjectListBase::classCount()
+{
+  assert (ObjectListBase::_classesByID != NULL);
+  return ObjectListBase::_classesByID->size();
+};
+
+/**
+ * @brief Checks if a Class with name already exists.
+ * @param id The id of the Class to check.
+ * @return true if such a class already exists.
+ */
+bool ObjectListBase::classIDExists(int id)
+{
+  return (ObjectListBase::_classesByID->find(id) != ObjectListBase::_classesByID->end());
+}
+
+/**
+ * @brief Checks if a Class with name already exists.
+ * @param name The Name of the Class to check.
+ * @return true if such a class already exists.
+ */
+bool ObjectListBase::classNameExists(const std::string& name)
+{
+  return (ObjectListBase::_classesByName->find(name) != ObjectListBase::_classesByName->end());
+}
+
+/**
+ * @brief searches for a ClassID in the list of all ObjectLists, and returns its Identity
+ * @param id: The Id to search for
+ * @returns the ClassID if found and NullClass' identity if not.
+ */
+const ClassID& ObjectListBase::retrieveIdentity(int id)
+{
+  const ObjectListBase* const base = ObjectListBase::getObjectList(id);
+
+  if (base != NULL)
+    return base->_identity;
+  else
+    return NullClass::staticClassID();
+}
+
+
+/**
+ * @brief searches for a ClassID in the list of all ObjectLists, and returns its Identity
+ * @param name: The Name to search for
+ * @returns the ClassID if found and NullClass' identity if not.
+ */
+const ClassID& ObjectListBase::retrieveIdentity(const std::string& name)
+{
+  const ObjectListBase* const base = ObjectListBase::getObjectList(name);
+
+  if (base != NULL)
+    return base->_identity;
+  else
+    return NullClass::staticClassID();
+}
+
+
+/**
+ * @brief Searches for a ObjectList with the ID classID
+ * @param classID the ID to search for.
+ * @return The ObjectList if found, NULL otherwise.
+ */
+const ObjectListBase* const ObjectListBase::getObjectList(int classID)
+{
+  assert (ObjectListBase::_classesByID != NULL);
+  ObjectListBase::IDMap::iterator it = ObjectListBase::_classesByID->find(classID);
+  if (it != ObjectListBase::_classesByID->end())
+    return (*it).second;
+  else
+    return NULL;
+}
+
+/**
+ * @brief Searches for a ObjectList with the Name className
+ * @param className the Name to search for.
+ * @return The ObjectList if found, NULL otherwise.
+ */
+const ObjectListBase* const ObjectListBase::getObjectList(const std::string& className)
+{
+  assert (ObjectListBase::_classesByName != NULL);
+  ObjectListBase::NameMap::iterator it = ObjectListBase::_classesByName->find(className);
+  if (it != ObjectListBase::_classesByName->end())
+    return (*it).second;
+  else
+    return NULL;
+}
+
+/**
+ * @brief Searches for a ObjectList with the ClassID classID
+ * @param classID the ID to search for.
+ * @return The ObjectList if found, NULL otherwise.
+ */
+const ObjectListBase* const ObjectListBase::getObjectList(const ClassID& classID)
+{
+  return ObjectListBase::getObjectList(classID.id());
+}
+
+/**
+ * @brief Retrieves the first BaseObject matching the name objectName from the List matching classID.
+ * @param classID the ID of the List.
+ * @param objectName the Name of the Object to search for
+ */
+BaseObject* ObjectListBase::getBaseObject(int classID, const std::string& objectName)
+{
+  const ObjectListBase* const base = ObjectListBase::getObjectList(classID);
+
+  if (base != NULL)
+    return base->getBaseObject(objectName);
+  else
+    return NULL;
+}
+
+/**
+ * @brief Retrieves the first BaseObject matching the name objectName from the List matching className.
+ * @param className the Name of the List.
+ * @param objectName the Name of the Object to search for
+ */
+BaseObject* ObjectListBase::getBaseObject(const std::string& className, const std::string& objectName)
+{
+  const ObjectListBase* const base = ObjectListBase::getObjectList(className);
+
+  if (base != NULL)
+    return base->getBaseObject(objectName);
+  else
+    return NULL;
+}
+
+/**
+ * @brief Retrieves the first BaseObject matching the name objectName from the List matching classID.
+ * @param classID The ClassID of the List.
+ * @param objectName the Name of the Object to search for
+ */
+BaseObject* ObjectListBase::getBaseObject(const ClassID& classID, const std::string& objectName)
+{
+  const ObjectListBase* const base = ObjectListBase::getObjectList(classID);
+
+  if (base != NULL)
+    return base->getBaseObject(objectName);
+  else
+    return NULL;
+}
+
+
+/**
+ * @returns An alphabetically sorted List of all stored ClassNames.
+ */
+const std::list<std::string>& ObjectListBase::getClassNames()
+{
+  if (ObjectListBase::classCount() != ObjectListBase::_classNames.size())
+  {
+    ObjectListBase::_classNames.clear();
+
+    for (NameMap::const_iterator it = ObjectListBase::_classesByName->begin();
+         it != ObjectListBase::_classesByName->end();
+         ++it)
+      ObjectListBase::_classNames.push_back((*it).second->name());
+  }
+  return ObjectListBase::_classNames;
+}
+
+
+#include "base_object.h"
+
+/**
+ * @brief Prints out some debugging information about a given List.
+ * @param level:
+ *  1: List ObjectListsand how many object.
+ *  2: 1+List ObjectLists entries, and information about Objects.
+ */
+void ObjectListBase::debug(unsigned int level) const
+{
+  base_list list;
+  this->getBaseObjectList(&list);
+
+  if (level > 1 || !list.empty())
+    printf(" ObjectList of class %s(id:%d) contains %d objects\n", this->name().c_str(), this->id(), list.size());
+
+  if (level >= 2)
+  {
+    printf("  - listing Instances: \n");
+    for (base_iterator it = list.begin();
+         it != list.end();
+         ++it)
+    {
+      printf("   + %s::%s (%p)\n", (*it)->getClassCName(), (*it)->getCName(), (*it));
+    }
+  }
+}
+
+
+/**
+ * @brief prints out debug output about all Lists
+ * @param level:
+ *  0: list number of ClassList and general info.
+ *  1: 0+List ObjectLists and how many object.
+ *  2: 1+List ObjectLists entries, and information about Objects.
+ */
+void ObjectListBase::debugAll(unsigned int level)
+{
+  printf("Listing all %d ObjectLists \n", ObjectListBase::_classesByID->size());
+
+  for (NameMap::const_iterator it = ObjectListBase::_classesByName->begin();
+       it != ObjectListBase::_classesByName->end();
+       ++it)
+    (*it).second->debug(level);
+}
+
+
+
+/**
+ * @brief Converts an ID into a ClassName String.
+ * @param classID The ID to convert.
+ * @return The ClassName or an empty string if the ID was not found.
+ */
+const std::string& ObjectListBase::IDToString(int classID)
+{
+  const ObjectListBase* const base = ObjectListBase::getObjectList(classID);
+
+  if (base != NULL)
+    return base->name();
+  else
+  {
+    static std::string empty;
+    return empty;
+  }
+}
+
+
+/**
+ * @brief Converts a String into an ID
+ * @param className the Name of the Class to search for
+ * @return The Classes ID if found, -1 otherwise.
+ */
+int ObjectListBase::StringToID(const std::string& className)
+{
+  const ObjectListBase* const base = ObjectListBase::getObjectList(className);
+
+  if (base != NULL)
+    return base->id();
+  else
+    return -1;
+}
Index: trunk/src/lib/lang/object_list.h
===================================================================
--- trunk/src/lib/lang/object_list.h	(revision 9869)
+++ trunk/src/lib/lang/object_list.h	(revision 9869)
@@ -0,0 +1,383 @@
+/*!
+ * @file object_list.h
+ * @brief Definition of a dynamically allocating ClassID
+ *
+ */
+
+#ifndef _OBJECT_LIST_H
+#define _OBJECT_LIST_H
+
+#include "class_id.h"
+#include <map>
+#include <list>
+#include <string>
+
+#include <cassert>
+#include <iostream>
+
+/**
+ * @brief Use this macro to easily declare a Class to store its own ObjectListDeclaration
+ * @param ClassName the Name of the Class.
+ * @note: Using this inside of a Class means, that you loose the member: _objectList, while defining
+ * two new functions objectList() and classID().
+ */
+#define ObjectListDeclaration(ClassName) \
+  public: \
+   static inline const ObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \
+   static inline const ClassID& staticClassID() { return ClassName::_objectList.identity(); }; \
+  private: \
+   static ObjectList<ClassName> _objectList
+
+/**
+ * @brief Use this macro to easily define a Class to store its own ObjectListDefinition
+ * @param ClassName: the Name of the Class.
+ * @param ID: optional set a Fixed ID.
+ */
+#define ObjectListDefinitionID(ClassName, ID) \
+   ObjectList<ClassName> ClassName::_objectList(#ClassName, ID)
+
+/**
+ * @brief Use this macro to easily define a Class to store its own ObjectListDefinition
+ * @param ClassName: the Name of the Class.
+ */
+#define ObjectListDefinition(ClassName) \
+    ObjectListDefinitionID(ClassName, -1)
+
+class BaseObject;
+//! The superclass that all ObjectLists follow.
+/**
+ * @see template<class T> ObjectList<T>
+ */
+class ObjectListBase
+{
+public:
+  /** @brief A Typedefinition for the Base-List that can be retrieved with getBaseObjectList(base_list*) */
+  typedef std::list<BaseObject*>        base_list;
+  /** @brief An iterator for the base_list */
+  typedef base_list::iterator           base_iterator;
+  //! A fast iterator Base-Class, for iterator-casting and storing.
+  /** @note This Iterator is explicitely used only for storage purposes in the BaseObject */
+  class IteratorBase { };
+
+public:
+  /** @returns The Identity of the Class stored within. */
+  inline const ClassID&                 identity() const { return _identity; }
+  /** @returns the ID of the Identity of the ObjectList */
+  inline int                            id() const { return _id; };
+  /** @returns The Name of the Class stored in this ObjectList */
+  inline const std::string&             name() const { return _name; };
+  /** @param id The id to compare @returns true on match, false otherwise */
+  inline bool                           operator==(int id) const { return _id == id; };
+  /** @param id The id to compare @returns true on match, false otherwise */
+  inline bool                           operator==(const ClassID& id) const { return id == _id; };
+  /** @param name The name to compare @returns true on match, false otherwise */
+  inline bool                           operator==(const std::string& name) const { return _name == name; };
+  /** @param id The id to acquire @param name the Name to acquire @brief stores a Name and an ID in a pointer. */
+  inline void                           acquireID(const int*& id, const std::string*& name) const { id = &_id; name = &_name; };
+  /** @brief fills a list of Objects into a BaseObject*-List. @param list the list to fill */
+  virtual void                          getBaseObjectList(base_list* list) const = 0;
+
+  static const ClassID&                 retrieveIdentity(int id);
+  static const ClassID&                 retrieveIdentity(const std::string& name);
+
+  static const ObjectListBase* const    getObjectList(int classID);
+  static const ObjectListBase* const    getObjectList(const std::string& className);
+  static const ObjectListBase* const    getObjectList(const ClassID& classID);
+
+  static BaseObject*                    getBaseObject(int classID, const std::string& objectName);
+  static BaseObject*                    getBaseObject(const std::string& className, const std::string& objectName);
+  static BaseObject*                    getBaseObject(const ClassID& classID, const std::string& objectName);
+
+  /** @returns an Object with Name name out of this List @param name the name of the Object. */
+  virtual BaseObject*                   getBaseObject(const std::string& name) const = 0;
+
+  static const std::list<std::string>&  getClassNames();
+
+
+  static unsigned int                   classCount();
+  void                                  debug(unsigned int level) const;
+  static void                           debugAll(unsigned int level);
+
+  static const std::string&             IDToString(int classID);
+  static int                            StringToID(const std::string& className);
+
+  //! Only used to unsubscribe a BaseObject. (just try to make a valid iterator, stupid :))
+  virtual void                          unregisterObject(IteratorBase* _iterators) = 0;
+  //! Only for debug purposes
+  virtual bool                          checkIteratorInList(IteratorBase* _iterator) const = 0;
+  virtual bool                          checkObjectInList(BaseObject* obj) const = 0;
+
+protected:
+  ObjectListBase(const std::string& className, int id = -1);
+  virtual ~ObjectListBase();
+
+private:
+  /** @brief hidden copy constructor. */
+  ObjectListBase(const ObjectListBase&) {};
+
+  static bool                         classIDExists(int id);
+  static bool                         classNameExists(const std::string& className);
+
+
+protected:
+  typedef std::map<int, ObjectListBase*>         IDMap;   //!< The Generic Map.
+  typedef std::map<std::string, ObjectListBase*> NameMap; //!< The Generic Map.
+
+private:
+  int                           _id;                //!< The Unique ID of the Class.
+  const std::string             _name;              //!< The Name of the Class.
+  ClassID                       _identity;          //!< The Identity of the Class. (equal to _id and _name)
+
+private:
+  static IDMap*                 _classesByID;       //!< A Map of all the classes in existance.
+  static NameMap*               _classesByName;     //!< A Map of all the classes in existance.
+  static std::list<std::string> _classNames;        //!< A list of all the registered ClassNames.
+};
+
+
+/////////////////////////
+//// TEMPLATISATION /////
+/////////////////////////
+//! Defines a ObjectList handler for objects of type T.
+/**
+ * The ObjectList is a generic way to store every object created from a Class 'T'
+ *  in a List. The list can be retrieved, and used constantly over iterators,
+ *  as with normal std::list.
+ *
+ * Furthermore the linkage over the single Lists is given over the Superclass ObjectListBase.
+ *
+ * The approach of ObjectList is an intrusive one, meaning, that each Class that wants to
+ * support it must implement a Declaration and a Definition for the ObjectList, as mentioned
+ * in the next statement:
+ *
+ * To define a Class with a ObjectList, you have to:
+ *  1. Include 'ObjectListDeclaration(T);' in its Declaration (at the beginning)
+ *  2. Include 'ObjectListDefinition(T);' in some Definition file (cc-file)
+ *  3. In the constructor add 'registerObject(this, objectList);'
+ *
+ * @note The Class must define the compare with const std::string& operator for this to work.
+ *  The operator==(const std::string& name) should compare the object's name with name.
+ *
+ *
+ *
+ * Limitations:
+ *  ObjectList cannot be used with other Factory style Classes, if the class is also a BaseObject,
+ *   and not loaded before the ObjectList.
+ *
+ * example: Iterating: Iteration is made easy, and fast as follows:
+ *   for (ObjectList<PlayerStats>::const_iterator it = PlayerStats::objectList().begin();
+ *      it != PlayerStats::objectList().end();
+ *     ++it)
+ *   {
+ *    (*it)->dosomething
+ *   }
+ *
+ * example: Find an Object:
+ * Playable* playable = Playable::objectList("orxonox-super-rocket-fighter"); // searches an Object By its name.
+ *
+ */
+template<class T>
+class ObjectList : public ObjectListBase
+{
+public:
+  typedef std::list<T*>                  list;             //!< The list of Type T* (used for Objects in this ObjectList)
+  typedef typename list::iterator        iterator;         //!< The iterator for the List of type T (use with ObjectList<Type>::iterator)
+  typedef typename list::const_iterator  const_iterator;   //!< A constant iterator for the List of type T (use with ObjectList<Type>::const_iterator)
+
+
+  //! An iterator to store Objects in the BaseObject, and remove Objects fast.
+class Iterator : public ObjectListBase::IteratorBase
+  {
+  public:
+    /** @brief creates an Iterator fast. @param it the Iterator. */
+    inline Iterator(iterator it) { _it = it; }
+    /** @returns the Iterator */
+    inline iterator& it() { return _it; }
+  private:
+    typename ObjectList::iterator _it;  //!< Stored Iterator
+  };
+
+public:
+  ObjectList(const std::string& name, int id = -1);
+  ~ObjectList();
+
+  virtual BaseObject*                getBaseObject(const std::string& name) const;
+  T*                                 getObject(const std::string& name) const;
+  /** @returns A constant list of Objects of this Class. */
+  inline const list&                 objects() const { return _objects; };
+  bool                               exists(const T* const object) const;
+
+  /** @returns an Iterator to the beginning of the List. */
+  inline iterator                    begin() { return _objects.begin(); };
+  /** @returns a constant Iterator to the beginning of the List. */
+  inline const_iterator              begin() const { return _objects.begin(); };
+  /** @returns an Iterator to the end of the List. */
+  inline iterator                    end() { return _objects.end(); };
+  /** @returns a constant Iterator to the beginning of the List. */
+  inline const_iterator              end() const { return _objects.end(); };
+
+  /** @returns true if the List is empty. */
+  inline bool                        empty() const { return _objects.empty(); };
+  /** @returns the size of the List */
+  inline int                         size() const { return _objects.size(); };
+  /** @returns the frontmost Element of the list (normaly the last added Object). */
+  inline T*                          front() const { return _objects.front(); };
+  /** @returns the last added Object */
+  inline T*                          back() const { return _objects.back(); };
+
+
+  ObjectListBase::IteratorBase*      registerObject(T* object);
+  virtual void                       unregisterObject(IteratorBase* iterator);
+  bool                               checkIteratorInList(IteratorBase* iterator) const;
+  bool                               checkObjectInList(BaseObject* obj) const;
+protected:
+  virtual void                       getBaseObjectList(ObjectListBase::base_list* list) const;
+
+
+private:
+  //! the copy constructor will be hidden.
+  ObjectList(const ObjectList& definer) {};
+
+private:
+  list                _objects;     //!< The List of stored Objects of Type T.
+};
+
+
+
+
+
+/////////////////////////
+//// IMPLEMENTATION /////
+/////////////////////////
+/**
+ * @brief creates a new ObjectList
+ * @param name The name of the Class.
+ * @param id The ID of the class if desired, or -1 if an id should be assigned automatically.
+ */
+template <class T>
+ObjectList<T>::ObjectList(const std::string& name, int id)
+    : ObjectListBase(name, id)
+{}
+
+/**
+ * @brief deletes the ObjectList.
+ */
+template <class T>
+ObjectList<T>::~ObjectList()
+{
+  if (!_objects.empty())
+  {
+    // std::cout << "There are " << this->size() << " objects from class " << this->name() << "(id:" << this->id() << ") in existance\n";
+  }
+}
+
+/**
+ * @brief Retrieves a BaseObject matching the Name name in this List.
+ * @param name the Name of the Object.
+ * @returns a BaseObject pointing to the object if found, NULL otherwise.
+ */
+template <class T>
+BaseObject* ObjectList<T>::getBaseObject(const std::string& name) const
+{
+  return this->getObject(name);
+}
+
+
+
+/**
+ * @brief Retrieves an Object of type T matching the Name name in this List.
+ * @param name the Name of the Object.
+ * @returns an Object of type T pointing to the object if found, NULL otherwise.
+ */
+template <class T>
+T* ObjectList<T>::getObject(const std::string& name) const
+{
+  const_iterator it;
+  for (it = this->_objects.begin(); it != this->_objects.end(); ++it)
+    if ((*it)->getName() == name)
+      return (*it);
+  return NULL;
+}
+
+/**
+ * @brief checks if Object object exists in this ClassList.
+ * @param object the Object to check for
+ * @returns True if the object is found within the List, false otherwise
+ */
+template <class T>
+bool ObjectList<T>::exists(const T* const object) const
+{
+  return (std::find(_objects.begin(), _objects.end(), object) != _objects.end());
+}
+
+
+/**
+ * @brief retrieves a List of BaseObjects
+ * @param list the list to push the ObjectList into.
+ */
+template <class T>
+void ObjectList<T>::getBaseObjectList(ObjectListBase::base_list* list) const
+{
+  assert (list != NULL);
+  const_iterator it;
+  for (it = this->_objects.begin(); it != this->_objects.end(); ++it)
+    list->push_back(*it);
+}
+
+
+/**
+ * @brief registers an Object to the ObjectList.
+ * @param object The Object to register.
+ * @returns a pointer to the iterator inside of the list.
+ */
+template <class T>
+ObjectListBase::IteratorBase* ObjectList<T>::registerObject(T* object)
+{
+  this->_objects.push_back(object);
+  return new Iterator(--this->_objects.end());
+}
+
+/**
+ * @brief removes an Object from the ClassList.
+ * @param iterator the Position at which to remove the Object.
+ */
+template <class T>
+void ObjectList<T>::unregisterObject(IteratorBase* iterator)
+{
+  this->_objects.erase(static_cast<Iterator*>(iterator)->it());
+  //_objects.erase(std::find(_objects.begin(), _objects.end(), object));
+}
+
+template <class T>
+bool ObjectList<T>::checkIteratorInList(IteratorBase* iterator) const
+{
+  const_iterator it;
+  for (it = this->_objects.begin(); it != this->_objects.end(); ++it)
+    if (static_cast<Iterator*>(iterator)->it() == it)
+      return true;
+  printf("ObjectList:: checkIteratorInList:: ITERATOR NOT IN THE LIST '%s' (UN-SYNC SHOULD NOT HAPPEN!!)\n", this->name().c_str());
+  return false;
+}
+
+template <class T>
+bool ObjectList<T>::checkObjectInList(BaseObject* obj) const
+{
+  T* object = dynamic_cast<T*>(obj);
+  if (object != NULL)
+  {
+    printf("EXTREME BUG: Object does not exist anymore!! (or a bug in ObjectList)\n");
+    return false;;
+  }
+
+  const_iterator it;
+  for (it = this->_objects.begin(); it != this->_objects.end(); ++it)
+  {
+    if (*it == object)
+      return true;
+  }
+  printf("ObjectList:: checkObjectInList:: OBJECT NOT IN THE LIST '%s' (UN-SYNC SHOULD NOT HAPPEN!!)\n", this->name().c_str());
+  return false;
+}
+
+
+#endif /* _OBJECT_LIST_H */
Index: trunk/src/lib/lang/test_object_list.cc
===================================================================
--- trunk/src/lib/lang/test_object_list.cc	(revision 9682)
+++ 	(revision )
@@ -1,106 +1,0 @@
-#include "new_class_id.h"
-#include "new_object_list.h"
-#include <iostream>
-
-#include <base_object.h>
-
-class NewBaseObject
-{
-public:
-  //   void setName(const std::string& name) { this->_objectName = name; };
-     const std::string& getName() const { return _objectName; };
-  //   bool operator==(const std::string& name) const { return _objectName == name; };
-
-    NewObjectListDeclaration(NewBaseObject);
-
-protected:
-  NewBaseObject(const std::string& objectName = "") : _objectName(objectName)
-  {
-       this->registerObject(this, objectList);
-  };
-  template<class T>
-  inline void registerObject(T* object, NewObjectList<T>& objectList) { _id.registerObject(object, objectList); };
-protected:
-  NewClassID    _id;
-  std::string   _objectName;
-
-
-};
-NewObjectListDefinition(NewBaseObject);
-
-
-class Test :
-      public   NewBaseObject
-//    ,
-//      public BaseObject
-{
-public:
-  Test();
-  ~Test();
-
-
-  NewObjectListDeclaration(Test);
-  //ObjectListDeclaration(Test);
-};
-NewObjectListDefinitionID(Test, -1);
-
-Test::Test()
-{
-  this->registerObject(this, Test::objectList);
-
-
-//  this->setClassID(CL_PARENT_NODE, "Test");
-  // std::cout << "Test()\n";
-};
-Test::~Test()
-{
-  //  std::cout << "~Test()\n";
-}
-
-class Bone : public Test
-{
-public:
-  Bone()
-  {
-    this->registerObject(this, Bone::objectList);
-    //this->_id.listInheritance();
-    //std::cout << "LeafID:" << this->_id.leafClassID() << std::endl;
-
-    //std::cout << "Bone()\n";
-  };
-  ~Bone()
-  {
-    //  std::cout << "~Bone()\n";
-  };
-  NewObjectListDeclaration(Bone);
-};
-NewObjectListDefinitionID(Bone, -1);
-
-int main()
-{
-#define ITERATIONS 20
-#define COUNT 100
-  for (unsigned int i = 0; i < ITERATIONS; ++i)
-  {
-    std::cout<< i <<  std::endl ;
-    Bone* test = new Bone[COUNT];
-    delete []test;
-  }
-  //   char tmp[100];
-  //   for (unsigned int i = 0 ; i < 100; ++i)
-  //   {
-  //     sprintf(tmp, "Tmp_%d", i);
-  //     test[i].setName(tmp);
-  //   }
-  //   Test::objectList.debug();
-  //   //test->setName("Test-object");
-  //
-  //   std::cout << "Here is debug of all BaseObject\n";
-  //   BaseObject::objectList.debug();
-  // //   delete bone;
-  //   delete []test;
-  //   std::cout << "Again\n";
-  //   BaseObject::objectList.debug();
-
-}
-
