Index: trunk/src/lib/lang/new_object_list.cc
===================================================================
--- trunk/src/lib/lang/new_object_list.cc	(revision 9674)
+++ trunk/src/lib/lang/new_object_list.cc	(revision 9675)
@@ -23,21 +23,37 @@
     : _id(-1), _name(className)
 {
-  if (NewObjectListBase::_classes == NULL)
-    NewObjectListBase::_classes = new cSet;
+  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/ID (key value)");
 
-
-  assert(!NewObjectListBase::classNameExists(className) && "Classes should not be included once, and no two classes should have the same name (key value)");
 
   this->_id = NewObjectListBase::_idCounter++;
 
+  (*NewObjectListBase::_classesByID)[this->_id] = this;
+  (*NewObjectListBase::_classesByName)[this->_name] = this;
 }
 
 NewObjectListBase::~NewObjectListBase()
 {
+  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;
+  }
 }
 
 int NewObjectListBase::_idCounter = 0;
-NewObjectListBase::cSet* NewObjectListBase::_classes = NULL;
+NewObjectListBase::classIDMap* NewObjectListBase::_classesByID = NULL;
+NewObjectListBase::classNameMap* NewObjectListBase::_classesByName = NULL;
 
 
@@ -50,8 +66,45 @@
 bool NewObjectListBase::classNameExists(const std::string& name)
 {
-  cSet::iterator it;
-  for (it = NewObjectListBase::_classes->begin(); it != NewObjectListBase::_classes->end(); it++)
-    if(*it != NULL && (*it)->name() != name)
-      return true;
-  return false;
+  return (NewObjectListBase::_classesByName->find(name) != NewObjectListBase::_classesByName->end());
+  //  classNameMap::iterator it;
+  //   for (it = NewObjectListBase::_classesByID->begin(); it != NewObjectListBase::_classesByID->end(); it++)
+  //     if(*it != NULL && (*it)->name() != name)
+  //       return true;
+  //   return false;
 }
+
+
+/**
+ * @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 9674)
+++ trunk/src/lib/lang/new_object_list.h	(revision 9675)
@@ -9,7 +9,6 @@
 
 #include "type_info.h"
-#include <set>
+#include <map>
 #include <list>
-#include <vector>
 #include <string>
 
@@ -33,6 +32,6 @@
 
 public:
-  int id() const { return _id; };
-  const std::string& name() const { return _name; };
+  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; };
@@ -40,6 +39,10 @@
 
   /// Comparing operators.
-  bool compareName(const NewObjectListBase& more) const { return this->_name < more.name(); };
-  bool compareID(const NewObjectListBase& more) const { return this->_id < more.id(); };
+//   struct CompareID  {
+//     bool operator()(const NewObjectListBase* less, const NewObjectListBase* more) { return less->id() < more->id(); };
+//   };
+//   struct CompareName{
+//     bool operator()(const NewObjectListBase* less, const NewObjectListBase* more) { return less->name() < more->name(); };
+//   };
 
   virtual void debug() const = 0;
@@ -63,16 +66,15 @@
 
 protected:
-  typedef std::set<NewObjectListBase*>     cSet;    //!< The Generic Set.
-  typedef std::vector<NewObjectListBase*>  cVector; //!< The
+  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.
 
-  cVector                       _typeOfList;        //!< A List of all classes this class is derived of, and the class itself, ordered by age of addition.
-  cSet                          _typeOfSet;         //!< A Set of all classes this is derived from and the class itself (for isA).
 private:
 
   static int                    _idCounter;         //!< A counter, that gives all classes a Unique ClassID. Access to this Variable is to be Thread-Safe.
-  static cSet*                  _classes;           //!< A Set of all the classes in existance.
+  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.
 };
Index: trunk/src/lib/lang/test_object_list.cc
===================================================================
--- trunk/src/lib/lang/test_object_list.cc	(revision 9674)
+++ trunk/src/lib/lang/test_object_list.cc	(revision 9675)
@@ -8,14 +8,14 @@
 {
 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; };
+  //   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);
+  //  NewObjectListDeclaration(NewBaseObject);
 
 protected:
   NewBaseObject(const std::string& objectName = "") : _objectName(objectName)
   {
-    this->registerObject(this, objectList);
+    //    this->registerObject(this, objectList);
   };
   template<class T>
@@ -27,8 +27,11 @@
 
 };
-NewObjectListDefinition(NewBaseObject);
+//NewObjectListDefinition(NewBaseObject);
 
 
-class Test : public NewBaseObject
+class Test :
+      public   NewBaseObject
+//    ,
+//      public BaseObject
 {
 public:
@@ -44,6 +47,6 @@
 Test::Test()
 {
+  this->registerObject(this, Test::objectList);
 //  this->setClassID(CL_PARENT_NODE, "Test");
-  this->registerObject(this, Test::objectList);
   // std::cout << "Test()\n";
 };
@@ -58,5 +61,5 @@
   Bone()
   {
-//    this->registerObject(this, Bone::objectList);
+    //    this->registerObject(this, Bone::objectList);
     //std::cout << "Bone()\n";
   };
@@ -75,5 +78,5 @@
     std::cout<< i << std::endl;
     Test* test = new Test[10000];
-    delete[]test;
+    // delete[]test;
   }
   //   char tmp[100];
