Index: trunk/src/lib/lang/new_object_list.cc
===================================================================
--- trunk/src/lib/lang/new_object_list.cc	(revision 9675)
+++ trunk/src/lib/lang/new_object_list.cc	(revision 9676)
@@ -20,6 +20,6 @@
 
 
-NewObjectListBase::NewObjectListBase(const std::string& className)
-    : _id(-1), _name(className)
+NewObjectListBase::NewObjectListBase(const std::string& className, int id)
+    : _name(className)
 {
   if (NewObjectListBase::_classesByID == NULL)
@@ -29,8 +29,14 @@
     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 only be included once, and no two classes should have the same name (key value)");
 
-
-  this->_id = NewObjectListBase::_idCounter++;
+  if (id != -1)
+  {
+    assert(!NewObjectListBase::classIDExists(id) && "Classes should only be included once, and no two classes should have the same ID (key value)");
+  }
+  else
+  {
+    this->_id = NewObjectListBase::_classesByID->size();
+  }
 
   (*NewObjectListBase::_classesByID)[this->_id] = this;
@@ -38,4 +44,10 @@
 }
 
+
+/**
+ * Destructor.
+ *
+ * This destructor deletes the NewObjectList, and cleans up the NewObjectList sorted Maps.
+ */
 NewObjectListBase::~NewObjectListBase()
 {
@@ -53,9 +65,17 @@
 }
 
-int NewObjectListBase::_idCounter = 0;
 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();
+};
 
 /**
@@ -67,9 +87,14 @@
 {
   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 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());
 }
 
Index: trunk/src/lib/lang/new_object_list.h
===================================================================
--- trunk/src/lib/lang/new_object_list.h	(revision 9675)
+++ trunk/src/lib/lang/new_object_list.h	(revision 9676)
@@ -37,16 +37,7 @@
   bool operator==(const std::string& name) const { return _name == name; };
 
-
-  /// Comparing operators.
-//   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;
 
-  static unsigned int                   classCount() { return _idCounter; };
+  static unsigned int                   classCount();
   static const std::string&             IDToString(int classID);
   static int                            StringToID(const std::string& className);
@@ -57,5 +48,5 @@
 
 protected:
-  NewObjectListBase(const std::string& className);
+  NewObjectListBase(const std::string& className, int id = -1);
   virtual ~NewObjectListBase();
 
@@ -63,4 +54,5 @@
   NewObjectListBase(const NewObjectListBase&);
 
+  static bool classIDExists(int id);
   static bool classNameExists(const std::string& className);
 
@@ -73,6 +65,4 @@
 
 private:
-
-  static int                    _idCounter;         //!< A counter, that gives all classes a Unique ClassID. Access to this Variable is to be Thread-Safe.
   static classIDMap*            _classesByID;       //!< A Map of all the classes in existance.
   static classNameMap*          _classesByName;     //!< A Map of all the classes in existance.
@@ -110,5 +100,5 @@
 
 public:
-  NewObjectList(const std::string& name);
+  NewObjectList(const std::string& name, int id = -1);
   ~NewObjectList();
 
@@ -137,6 +127,6 @@
 /////////////////////////
 template <class T>
-NewObjectList<T>::NewObjectList(const std::string& name)
-    : NewObjectListBase(name)
+NewObjectList<T>::NewObjectList(const std::string& name, int id)
+    : NewObjectListBase(name, id)
 {}
 
