Index: trunk/src/lib/lang/base_object.cc
===================================================================
--- trunk/src/lib/lang/base_object.cc	(revision 5790)
+++ trunk/src/lib/lang/base_object.cc	(revision 5791)
@@ -71,7 +71,7 @@
  * @param className the class name
 */
-void BaseObject::setClassID(long classID, const char* className)
+void BaseObject::setClassID(ClassID classID, const char* className)
 {
-  this->classID |= classID;
+  this->classID |= (long)classID;
   this->className = className;
 
@@ -142,5 +142,5 @@
  * @returns true on match, false otherwise.
  */
-bool BaseObject::operator ==(const char* objectName)
+bool BaseObject::operator==(const char* objectName)
 {
   if (likely(this->objectName != NULL && objectName != NULL))
Index: trunk/src/lib/lang/base_object.h
===================================================================
--- trunk/src/lib/lang/base_object.h	(revision 5790)
+++ trunk/src/lib/lang/base_object.h	(revision 5791)
@@ -39,9 +39,8 @@
   void whatIs() const;
 
-  //
-  bool operator== (const char* objectName);
+  bool operator==(const char* objectName);
 
  protected:
-  void setClassID(long classID, const char* className);
+  void setClassID(ClassID classID, const char* className);
 
   private:
Index: trunk/src/lib/lang/class_list.cc
===================================================================
--- trunk/src/lib/lang/class_list.cc	(revision 5790)
+++ trunk/src/lib/lang/class_list.cc	(revision 5791)
@@ -19,9 +19,9 @@
 #include "base_object.h"
 
-#include "list.h"
 #include "compiler.h"
 #include "debug.h"
 #include <string.h>
 #include <math.h>
+#include <algorithm>
 #include "shell_command.h"
 
@@ -37,9 +37,6 @@
 ClassList::ClassList(const long& classID, const char* className)
 {
-  this->next = NULL;
   this->className = className;
   this->classID = classID;
-
-  ++ClassList::classCount;
 }
 
@@ -49,16 +46,12 @@
 ClassList::~ClassList ()
 {
-//   ClassList::classList.clear());
-   --ClassList::classCount;
-}
-
-//! the first class that is registered
-ClassList*  ClassList::first = NULL;
-
-//! the Count of classes
-unsigned int ClassList::classCount = 0;
+//   ClassList::classList->clear());
+}
+
+//! a List of all known Classes.
+std::list<ClassList>* ClassList::classList = new std::list<ClassList>();
 
 //! a List of all strings of all classes, that have registered so far.
-std::list<const char*> ClassList::classList;
+std::list<const char*> ClassList::classNames;
 
 /**
@@ -67,32 +60,23 @@
  * @param classID ID of the Given ObjectType \see ClassID
  * @param className name of the Class to add
- */
-void ClassList::addToClassList(BaseObject* objectPointer, const long& classID, const char* className)
-{
-  ClassList* regClass;
-  PRINTF(5)("subscribe a %s\n", className );
-
-  if(ClassList::first == NULL)
-    ClassList::first = regClass = new ClassList(classID, className);
+ *
+ * !! FIRST YOU HAVE TO CALL THIS FUNCTION ONCE
+ * !! Before unsing the ClassList, as it creates the ClassLits
+ */
+void ClassList::addToClassList(BaseObject* objectPointer, ClassID classID, const char* className)
+{
+  if (unlikely(classList == NULL))
+    ClassList::classList = new list<ClassList>();
+
+  PRINTF(5)("subscribe a '%s'\n", className );
+
+  ClassList* regClass = ClassList::getClassList(classID);
+  if (regClass != NULL)
+    regClass->objectList.push_back(objectPointer);
   else
   {
-    ClassList* tmp = ClassList::first;
-    while (likely(tmp != NULL))
-    {
-      if (tmp->classID == classID)
-      {
-        regClass = tmp;
-        break;
-      }
-
-      if (unlikely(tmp->next == NULL))
-      {
-        tmp->next = regClass = new ClassList(classID, className);
-        break;
-      }
-      tmp = tmp->next;
-    }
-  }
-  regClass->objectList.push_back(objectPointer);
+    ClassList::classList->push_back(ClassList(classID, className));
+    ClassList::classList->back().objectList.push_back(objectPointer);
+  }
 }
 
@@ -103,13 +87,8 @@
 void ClassList::removeFromClassList(BaseObject* objectPointer)
 {
-  ClassList* tmp = ClassList::first;
-  while (likely(tmp != NULL))
-  {
-    if (objectPointer->isA(tmp->classID))
-    {
-      tmp->objectList.remove(objectPointer);
-    }
-    tmp = tmp->next;
-  }
+  list<ClassList>::iterator cl;
+  for(cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
+    if (objectPointer->isA((*cl).classID))
+      (*cl).objectList.remove(objectPointer);
 }
 
@@ -121,19 +100,16 @@
  * befor it changes anything.
  */
-const std::list<const char*>* ClassList::getClassList()
-{
-  if (ClassList::classList.size() != ClassList::classCount)
-    ClassList::classList.clear();
-
-  if(likely(ClassList::first != NULL))
-  {
-    ClassList* tmpCL = ClassList::first;
-    while (likely(tmpCL != NULL))
-    {
-      ClassList::classList.push_back(tmpCL->className);
-      tmpCL = tmpCL->next;
-    }
-  }
-  return &ClassList::classList;
+const std::list<const char*>* ClassList::getClassNames()
+{
+  if (ClassList::classNames.size() != ClassList::classList->size())
+  {
+      ClassList::classNames.clear();
+
+      list<ClassList>::const_iterator cl;
+      for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
+        ClassList::classNames.push_back((*cl).className);
+  }
+
+  return &ClassList::classNames;
 }
 
@@ -143,19 +119,20 @@
  * @return the List accessed by classID, or NULL if not found
  */
-std::list<BaseObject*>* ClassList::getList(long classID)
-{
-  if(unlikely(ClassList::first == NULL))
-    return NULL;
-  else
-  {
-    ClassList* tmpCL = ClassList::first;
-    while (likely(tmpCL != NULL))
-    {
-      if (unlikely(tmpCL->classID == classID))
-        return &tmpCL->objectList;
-      tmpCL = tmpCL->next;
-    }
-  }
-  return NULL;
+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;*/
 }
 
@@ -167,44 +144,67 @@
 std::list<BaseObject*>* ClassList::getList(const char* className)
 {
-  if(unlikely(ClassList::first == NULL))
+  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;*/
+}
+
+
+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;
+}
+
+
+ClassList* ClassList::getClassList(const char* className)
+{
+  if (className == NULL)
     return NULL;
-  else
-  {
-    ClassList* tmpCL = ClassList::first;
-    while (likely(tmpCL != NULL))
-    {
-      if (unlikely(!strcmp(tmpCL->className, className)))
-        return &tmpCL->objectList;
-      tmpCL = tmpCL->next;
-    }
-  }
-  return NULL;
-}
+  std::list<ClassList>::iterator classIT = find (classList->begin(), classList->end(), className);
+  return (likely(classIT != classList->end()))? &(*classIT) : NULL;
+}
+
 
 /**
  * checks if the BaseObject* object exists.
- * @param name the name of the BaseObject to look for
+ * @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 char* name, long classID)
-{
-  if(unlikely(ClassList::first == NULL) || name == NULL)
-    return NULL;
+BaseObject* ClassList::getObject(const char* 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 ((*bo)->getName() != NULL && !strcmp((*bo)->getName(), objectName))
+          return (*bo);
+    }
+  }
   else
   {
-    ClassList* tmp = ClassList::first;
-    while (likely(tmp != NULL))
-    {
-      if (tmp->classID == classID || classID == CL_NULL)
-      {
-        list<BaseObject*>::iterator bo;
-        for (bo = tmp->objectList.begin(); bo != tmp->objectList.end(); bo++)
-          if ((*bo)->getName() && !strcmp((*bo)->getName(), name))
-            return (*bo);
-        break;
-      }
-      tmp = tmp->next;
+    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 ((*bo)->getName() != NULL && !strcmp((*bo)->getName(), objectName))
+          return (*bo);
     }
   }
@@ -220,23 +220,23 @@
  * @todo: speed this up!!
  */
-bool ClassList::exists(const BaseObject* object, long classID)
-{
-  if(unlikely(ClassList::first == NULL) || object == NULL)
-    return false;
+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 = find (cl->objectList.begin(), cl->objectList.end(), object);
+      return (bo != cl->objectList.end());
+    }
+  }
   else
   {
-    ClassList* tmp = ClassList::first;
-    while (likely(tmp != NULL))
-    {
-      if (tmp->classID == classID || classID == CL_NULL)
-      {
-        list<BaseObject*>::iterator bo;
-        for (bo = tmp->objectList.begin(); bo != tmp->objectList.end(); bo++)
-          if ((*bo) == object)
-            return true;
-        if (likely(tmp->classID == classID))
-          break;
-      }
-      tmp = tmp->next;
+    list<ClassList>::iterator cl;
+    for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
+    {
+      std::list<BaseObject*>::const_iterator bo = find ((*cl).objectList.begin(), (*cl).objectList.end(), object);
+      if (bo != (*cl).objectList.end())
+        return true;
     }
   }
@@ -250,12 +250,9 @@
 void ClassList::whatIs(const BaseObject* object)
 {
-  ClassList* tmp = ClassList::first;
-  while (likely(tmp != NULL))
-  {
-    if (object->isA(tmp->classID))
-    {
-      PRINT(0)("=%s=-", tmp->className);
-    }
-    tmp = tmp->next;
+  list<ClassList>::iterator cl;
+  for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++)
+    if (object->isA((*cl).classID))
+  {
+    PRINT(0)("=%s=-", (*cl).className);
   }
 }
@@ -266,17 +263,8 @@
  * @return a String containing the name of the Class, NULL if the Class was not found
  */
-const char* ClassList::IDToString(long classID)
-{
-  if(likely(ClassList::first != NULL))
-  {
-    ClassList* tmpCL = ClassList::first;
-    while (likely(tmpCL != NULL))
-    {
-      if (tmpCL->classID == classID)
-        return tmpCL->className;
-      tmpCL = tmpCL->next;
-    }
-  }
-  return NULL;
+const char* ClassList::IDToString(ClassID classID)
+{
+  ClassList* cl = ClassList::getClassList(classID);
+  return (cl != NULL) ? cl->className : NULL;
 }
 
@@ -288,17 +276,19 @@
 long ClassList::StringToID(const char* className)
 {
-  if (className == NULL)
-    return CL_NULL;
-  if(likely(ClassList::first != NULL))
-  {
-    ClassList* tmpCL = ClassList::first;
-    while (likely(tmpCL != NULL))
-    {
-      if (!strcasecmp(tmpCL->className, className))
-        return tmpCL->classID;
-      tmpCL = tmpCL->next;
-    }
-  }
-  return CL_NULL;
+  ClassList* cl = ClassList::getClassList(className);
+  return (cl != NULL) ? cl->classID : CL_NULL;
+}
+
+/**
+ * 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 char* className)
+{
+  if (likely( className != NULL && this->className != NULL))
+    return (!strcmp(this->className, className));
+  else
+    return false;
 }
 
@@ -317,28 +307,28 @@
   PRINT(0)("=  CLASS_LIST (level %d)  =\n", debugLevel);
   PRINT(0)("==========================\n");
-  PRINT(0)("| knows %d Classes\n|\n", ClassList::classCount);
-  ClassList* tmp = ClassList::first;
+  PRINT(0)("| knows %d Classes\n|\n", ClassList::classList->size());
   char niceString[100];
   unsigned int lenCount = 0;
 
-  while (likely(tmp != NULL))
-  {
-    if ((debugLevel >= 1 || tmp->objectList.size() > 0 ) &&
-         (classID == CL_NULL || unlikely (classID == tmp->classID)))
+  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 (pow(10, lenCount) <= tmp->objectList.size())
+      while (pow(10, lenCount) <= (*cl).objectList.size())
         ++lenCount;
-      for (int i=0; i < 30-strlen(tmp->className) - lenCount; i++)
+      for (int i=0; i < 30-strlen((*cl).className) - lenCount; i++)
         (niceString[i]) = ' ';
-      niceString[30-strlen(tmp->className) - lenCount] = '\0';
-
-      PRINT(0)("| CLASS %s:%s %d\n", tmp->className, niceString, tmp->objectList.size());
-
-      if (debugLevel >=2 && tmp->objectList.size() > 0)
+      niceString[30-strlen((*cl).className) - lenCount] = '\0';
+
+      PRINT(0)("| CLASS %s:%s %d\n", (*cl).className, niceString, (*cl).objectList.size());
+
+      if (debugLevel >=2 && (*cl).objectList.size() > 0)
       {
         PRINT(0)("|  Listing Instances:\n");
         list<BaseObject*>::const_iterator bo;
-        for (bo = tmp->objectList.begin(); bo != tmp->objectList.end(); bo++)
+        for (bo = (*cl).objectList.begin(); bo != (*cl).objectList.end(); bo++)
         {
           PRINT(0)("|   (class %s): NAME(%s)->%p ", (*bo)->getClassName(), (*bo)->getName(), (*bo));
@@ -349,5 +339,4 @@
       }
     }
-    tmp = tmp->next;
   }
   PRINT(0)("=======================CL=\n");
Index: trunk/src/lib/lang/class_list.h
===================================================================
--- trunk/src/lib/lang/class_list.h	(revision 5790)
+++ trunk/src/lib/lang/class_list.h	(revision 5791)
@@ -10,4 +10,7 @@
 #include "class_id.h"
 #include <list>
+#ifndef NULL
+#define NULL     0    //!< NULL
+#endif
 
 // FORWARD DECLARATION
@@ -34,34 +37,37 @@
 
     // STATIC FUNCTIONS
-    static void                          addToClassList(BaseObject* objectPointer, const long& classID, const char* className);
-    static void                          removeFromClassList(BaseObject* objectPointer);
+    static void                           addToClassList(BaseObject* objectPointer, ClassID classID, const char* className);
+    static void                           removeFromClassList(BaseObject* objectPointer);
 
-    static std::list<BaseObject*>*       getList(long classID = CL_NULL);
-    static std::list<BaseObject*>*       getList(const char* className);
-    static const std::list<const char*>* getClassList();
-    static BaseObject*                   getObject(const char* name, long classID = CL_NULL);
-    static bool                          exists(const BaseObject* object, long classID = CL_NULL);
+    static std::list<BaseObject*>*        getList(ClassID classID = CL_NULL);// { return (ClassList* fl = ClassList::getClassList(classID) != NULL)? &(fl->objectList) : NULL; };
+    static std::list<BaseObject*>*        getList(const char* className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
+    static const std::list<const char*>*  getClassNames();
+    static BaseObject*                    getObject(const char* name, ClassID classID = CL_NULL);
+    static bool                           exists(const BaseObject* object, ClassID classID = CL_NULL);
 
-    static void                          whatIs(const BaseObject* object);
+    static void                           whatIs(const BaseObject* object);
 
-    static const char*                   IDToString(long classID = CL_NULL);
-    static long                          StringToID(const char* className);
-    static void                          debug(unsigned int debugLevel = 0, long classID = CL_NULL);
-    static void                          debugS(const char* className = 0x0, unsigned int debugLevel = 0);
+    static const char*                    IDToString(ClassID classID = CL_NULL);
+    static long                           StringToID(const char* className);
+    static void                           debug(unsigned int debugLevel = 0, long classID = CL_NULL);
+    static void                           debugS(const char* className = 0x0, unsigned int debugLevel = 0);
 
-
+    bool                                  operator==(ClassID classID) { return (this->classID == classID); };
+    bool                                  operator==(const char* className);
 
   private:
-    std::list<BaseObject*>          objectList;             //!< A list of Objects belonging to this Class
+    static ClassList*                     getClassList(ClassID classID);
+    static ClassList*                     getClassList(const char* className);
+
+  private:
 
     long                            classID;                //!< ClassID stored in this ClassList \see ClassID
     const char*                     className;              //!< Name of the Class Stored here
 
-    ClassList*                      next;                   //!< Pointer to the next class in the List
+    std::list<BaseObject*>          objectList;             //!< A list of Objects belonging to this Class
 
     // STATIC MEMBERS
-    static ClassList*               first;                  //!< The first Class in the List
-    static std::list<const char*>   classList;              //!< a List of all Names of all classes, that have registered so far.
-    static unsigned int             classCount;             //!< The Count of classes that have been registered (should match the lower description)
+    static std::list<ClassList>*     classList;              //!< The first Class in the List
+    static std::list<const char*>   classNames;             //!< a List of all Names of all classes, that have registered so far.
 };
 
Index: trunk/src/lib/shell/shell_command.cc
===================================================================
--- trunk/src/lib/shell/shell_command.cc	(revision 5790)
+++ trunk/src/lib/shell/shell_command.cc	(revision 5791)
@@ -202,5 +202,5 @@
           classID = ClassList::StringToID((*commandClassIT)->getName());
           commandClass = (*commandClassIT);
-          objectList = ClassList::getList(classID);
+          objectList = ClassList::getList((ClassID)classID);
           break;
         }
Index: trunk/src/lib/shell/shell_completion.cc
===================================================================
--- trunk/src/lib/shell/shell_completion.cc	(revision 5790)
+++ trunk/src/lib/shell/shell_completion.cc	(revision 5791)
@@ -112,5 +112,5 @@
   {
     classID = ClassList::StringToID(inputSplits.getString(0));
-    objectList = ClassList::getList(classID);
+    objectList = ClassList::getList((ClassID)classID);
     if (classID != CL_NULL)
       completeType |= SHELLC_OBJECT;
@@ -151,5 +151,5 @@
   if (unlikely(classBegin == NULL))
     return false;
-  const std::list<const char*>* clList = ClassList::getClassList();
+  const std::list<const char*>* clList = ClassList::getClassNames();
   if (clList != NULL)
   {
@@ -172,5 +172,5 @@
   if (unlikely(objectBegin == NULL))
     return false;
-  const std::list<BaseObject*>* boList = ClassList::getList(classID);
+  const std::list<BaseObject*>* boList = ClassList::getList((ClassID)classID);
   if (boList != NULL)
   {
