Index: trunk/src/lib/shell/shell_completion.cc
===================================================================
--- trunk/src/lib/shell/shell_completion.cc	(revision 9406)
+++ trunk/src/lib/shell/shell_completion.cc	(revision 9869)
@@ -22,6 +22,5 @@
 #include "shell_command.h"
 
-#include "substring.h"
-#include "class_list.h"
+#include "helper_functions.h"
 #include "debug.h"
 
@@ -51,6 +50,6 @@
   bool ShellCompletion::autoComplete(std::string& input)
   {
-    long classID = CL_NULL;                          //< the classID retrieved from the Class.
-    const std::list<BaseObject*>* objectList = NULL; //< the list of Objects stored in classID's ClassList
+    ClassID classID;
+    const ObjectListBase* objectList = NULL;      //< the list of Objects stored in classID's ClassList
     bool emptyComplete = false;                      //< if the completion input is empty string. e.g ""
     long completeType = NullCompletion;              //< the Type we'd like to complete.
@@ -85,7 +84,8 @@
              (!emptyComplete && inputSplits.size() == 2))
     {
-      classID = ClassList::StringToID(inputSplits.getString(0));
-      objectList = ClassList::getList((ClassID)classID);
-      if (classID != CL_NULL)
+      objectList = ObjectListBase::getObjectList(inputSplits[0]);
+      if (objectList != NULL)
+        classID = objectList->identity();
+      if (classID != NullClass::staticClassID())
         completeType |= ObjectCompletion;
       completeType |= FunctionCompletion;
@@ -95,5 +95,5 @@
              (!emptyComplete && inputSplits.size() == 3))
     {
-      if (ClassList::exists(inputSplits[0], inputSplits[1]))
+      if (ObjectListBase::getBaseObject(inputSplits[0], inputSplits[1]))
         completeType |= FunctionCompletion;
     }
@@ -113,7 +113,7 @@
 
     if (completeType & ClassCompletion)
-      this->objectComplete(completeString, CL_SHELL_COMMAND_CLASS);
+      this->objectComplete(completeString, &ShellCommandClass::objectList());
     if (completeType & ObjectCompletion)
-      this->objectComplete(completeString, classID);
+      this->objectComplete(completeString, objectList);
     if (completeType & FunctionCompletion)
       this->commandComplete(completeString, inputSplits[0]);
@@ -133,17 +133,18 @@
    * @return true on success, false otherwise
    */
-  bool ShellCompletion::objectComplete(const std::string& objectBegin, long classID)
-  {
-    const std::list<BaseObject*>* boList = ClassList::getList((ClassID)classID);
-    if (boList != NULL)
-    {
-      CompletionType type = ObjectCompletion;
-      if (classID == CL_SHELL_COMMAND_CLASS)
-        type = ClassCompletion;
-      if (!this->addToCompleteList(*boList, objectBegin, type))
-        return false;
-    }
-    else
-      return false;
+  bool ShellCompletion::objectComplete(const std::string& objectBegin, const ObjectListBase* objectList)
+  {
+    assert (objectList != NULL);
+
+    CompletionType type = ObjectCompletion;
+    if (objectList == &ShellCommandClass::objectList())
+      type = ClassCompletion;
+
+    ObjectListBase::base_list list;
+    objectList->getBaseObjectList(&list);
+
+    if (!this->addToCompleteList(list, objectBegin, type))
+     return false;
+
     return true;
   }
@@ -321,16 +322,16 @@
     switch (type)
     {
-        default:// SHELLC_NONE
-        return typeNames[0];
-        case  ClassCompletion:
-        return typeNames[1];
-        case ObjectCompletion:
-        return typeNames[2];
-        case FunctionCompletion:
-        return typeNames[3];
-        case AliasCompletion:
-        return typeNames[4];
-        case ParamCompletion:
-        return typeNames[5];
+      default:// SHELLC_NONE
+      return typeNames[0];
+      case  ClassCompletion:
+      return typeNames[1];
+      case ObjectCompletion:
+      return typeNames[2];
+      case FunctionCompletion:
+      return typeNames[3];
+      case AliasCompletion:
+      return typeNames[4];
+      case ParamCompletion:
+      return typeNames[5];
     }
   }
