Index: trunk/src/lib/shell/shell_command.cc
===================================================================
--- trunk/src/lib/shell/shell_command.cc	(revision 5634)
+++ trunk/src/lib/shell/shell_command.cc	(revision 5636)
@@ -40,5 +40,5 @@
   this->className = className;
   this->classID = CL_NULL;
-  this->commandList = new tList<ShellCommandBase>;
+  this->commandList = new tList<ShellCommand>;
 
   ShellCommandClass::commandClassList->add(this);
@@ -50,6 +50,6 @@
 ShellCommandClass::~ShellCommandClass()
 {
-  tIterator<ShellCommandBase>* iterator = this->commandList->getIterator();
-  ShellCommandBase* elem = iterator->firstElement();
+  tIterator<ShellCommand>* iterator = this->commandList->getIterator();
+  ShellCommand* elem = iterator->firstElement();
   while(elem != NULL)
   {
@@ -78,6 +78,6 @@
     if (!strcmp (elem->getName(), className))
     {
-      tIterator<ShellCommandBase>* itFkt = elem->commandList->getIterator();
-      ShellCommandBase* command = itFkt->firstElement();
+      tIterator<ShellCommand>* itFkt = elem->commandList->getIterator();
+      ShellCommand* command = itFkt->firstElement();
       while (command != NULL)
       {
@@ -120,40 +120,71 @@
 void ShellCommandClass::unregisterAllCommands()
 {
-  // unregister all commands
+  if (ShellCommandClass::commandClassList != NULL)
+  {
+    // unregister all commands
+    tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
+    ShellCommandClass* elem = iterator->firstElement();
+    while(elem != NULL)
+    {
+      delete elem;
+
+      elem = iterator->nextElement();
+    }
+    delete iterator;
+
+    delete ShellCommandClass::commandClassList;
+    ShellCommandClass::commandClassList = NULL;
+  }
+
+  // unregister all aliases (there should be nothing to do here :))
+  if (ShellCommandClass::aliasList != NULL)
+  {
+    tIterator<ShellCommandAlias>* itAL = ShellCommandClass::aliasList->getIterator();
+    ShellCommandAlias* elemAL = itAL->firstElement();
+    while(elemAL != NULL)
+    {
+      delete elemAL;
+      elemAL = itAL->nextElement();
+    }
+    delete itAL;
+    delete ShellCommandClass::aliasList;
+    ShellCommandClass::aliasList = NULL;
+  }
+}
+
+/**
+ * checks if a Class is already registered to the Commands' class-stack
+ * @param className the Name of the Class to check for
+ * @returns the CommandClass if found, NULL otherwise
+ */
+const ShellCommandClass* ShellCommandClass::isRegistered(const char* className)
+{
+  if (ShellCommandClass::commandClassList == NULL)
+    initCommandClassList();
+
   tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
   ShellCommandClass* elem = iterator->firstElement();
   while(elem != NULL)
   {
-    delete elem;
-
+    if (!strcmp(className, elem->className))
+    {
+      if (elem->classID == CL_NULL)
+        elem->classID = ClassList::StringToID(className);
+
+      delete iterator;
+      return elem;
+    }
     elem = iterator->nextElement();
   }
   delete iterator;
-
-  delete ShellCommandClass::commandClassList;
-  ShellCommandClass::commandClassList = NULL;
-
-  // unregister all aliases (there should be nothing to do here :))
-  if (ShellCommandClass::aliasList != NULL)
-  {
-    tIterator<ShellCommandAlias>* itAL = ShellCommandClass::aliasList->getIterator();
-    ShellCommandAlias* elemAL = itAL->firstElement();
-    while(elemAL != NULL)
-    {
-      delete elemAL;
-      elemAL = itAL->nextElement();
-    }
-    delete itAL;
-    delete ShellCommandClass::aliasList;
-    ShellCommandClass::aliasList = NULL;
-  }
-}
-
-/**
- * checks if a Class is already registered to the Commands' class-stack
- * @param className the Name of the Class to check for
- * @returns the CommandClass if found, NULL otherwise
- */
-const ShellCommandClass* ShellCommandClass::isRegistered(const char* className)
+  return NULL;
+}
+
+/**
+ * searches for a CommandClass
+ * @param className the name of the CommandClass
+ * @returns the CommandClass if found, or a new CommandClass if not
+ */
+ShellCommandClass* ShellCommandClass::getCommandClass(const char* className)
 {
   if (ShellCommandClass::commandClassList == NULL)
@@ -166,7 +197,4 @@
     if (!strcmp(className, elem->className))
     {
-      if (elem->classID == CL_NULL)
-        elem->classID = ClassList::StringToID(className);
-
       delete iterator;
       return elem;
@@ -175,41 +203,16 @@
   }
   delete iterator;
-  return NULL;
-}
-
-/**
- * searches for a CommandClass
- * @param className the name of the CommandClass
- * @returns the CommandClass if found, or a new CommandClass if not
- */
-ShellCommandClass* ShellCommandClass::getCommandClass(const char* className)
+  return new ShellCommandClass(className);
+}
+
+/**
+ * initializes the CommandList (if it is NULL)
+ */
+void ShellCommandClass::initCommandClassList()
 {
   if (ShellCommandClass::commandClassList == NULL)
-    initCommandClassList();
-
-  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elem = iterator->firstElement();
-  while(elem != NULL)
-  {
-    if (!strcmp(className, elem->className))
-    {
-      delete iterator;
-      return elem;
-    }
-    elem = iterator->nextElement();
-  }
-  delete iterator;
-  return new ShellCommandClass(className);
-}
-
-/**
- * initializes the CommandList (if it is NULL)
- */
-void ShellCommandClass::initCommandClassList()
-{
-  if (ShellCommandClass::commandClassList == NULL)
   {
     ShellCommandClass::commandClassList = new tList<ShellCommandClass>;
-    ShellCommandStatic<ShellCommandBase>::registerCommand("debug", "ShellCommand", ShellCommandBase::debug);
+    ShellCommand::registerCommand("debug", "ShellCommand", new ExecutorStatic<ShellCommand>(ShellCommand::debug));
   }
 }
@@ -228,11 +231,11 @@
       {
         PRINT(0)("Class:'%s' registered %d commands: \n", elemCL->className, elemCL->commandList->getSize());
-        tIterator<ShellCommandBase>* iterator = elemCL->commandList->getIterator();
-        const ShellCommandBase* elem = iterator->firstElement();
+        tIterator<ShellCommand>* iterator = elemCL->commandList->getIterator();
+        const ShellCommand* elem = iterator->firstElement();
         while(elem != NULL)
         {
           PRINT(0)("  command:'%s' : params:%d: ", elem->getName(), elem->paramCount);
           for (unsigned int i = 0; i< elem->paramCount; i++)
-            PRINT(0)("%s ", ShellCommandBase::paramToString(elem->parameters[i]));
+            PRINT(0)("%s ", ShellCommand::paramToString(elem->parameters[i]));
           if (elem->description != NULL)
             PRINT(0)("- %s", elem->description);
@@ -277,5 +280,5 @@
  * @param paramCount the count of parameters this command takes
  */
-ShellCommandBase::ShellCommandBase(const char* commandName, const char* className, unsigned int paramCount, ...)
+ShellCommand::ShellCommand(const char* commandName, const char* className, unsigned int paramCount, ...)
 {
   this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
@@ -306,5 +309,5 @@
  * deconstructs a ShellCommand
  */
-ShellCommandBase::~ShellCommandBase()
+ShellCommand::~ShellCommand()
 {
   delete[] this->parameters;
@@ -318,9 +321,21 @@
 
 /**
+ * registers a new ShellCommand
+ */
+ShellCommand* ShellCommand::registerCommand(const char* commandName, const char* className, Executor* executor)
+{
+  return NULL;
+
+}
+
+
+
+
+/**
  * unregister an existing commandName
  * @param className the name of the Class the command belongs to.
  * @param commandName the name of the command itself
  */
-void ShellCommandBase::unregisterCommand(const char* commandName, const char* className)
+void ShellCommand::unregisterCommand(const char* commandName, const char* className)
 {
   if (ShellCommandClass::commandClassList == NULL)
@@ -331,6 +346,6 @@
  if (checkClass != NULL)
   {
-    tIterator<ShellCommandBase>* iterator = checkClass->commandList->getIterator();
-    ShellCommandBase* elem = iterator->firstElement();
+    tIterator<ShellCommand>* iterator = checkClass->commandList->getIterator();
+    ShellCommand* elem = iterator->firstElement();
     while(elem != NULL)
     {
@@ -363,5 +378,5 @@
  * This is checked in the registerCommand-function.
  */
-bool ShellCommandBase::isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...)
+bool ShellCommand::isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...)
 {
   if (ShellCommandClass::commandClassList == NULL)
@@ -374,6 +389,6 @@
   if (checkClass != NULL)
   {
-    tIterator<ShellCommandBase>* iterator = checkClass->commandList->getIterator();
-    ShellCommandBase* elem = iterator->firstElement();
+    tIterator<ShellCommand>* iterator = checkClass->commandList->getIterator();
+    ShellCommand* elem = iterator->firstElement();
     while(elem != NULL)
    {
@@ -400,5 +415,5 @@
  * @return true on success, false otherwise.
  */
-bool ShellCommandBase::execute(const char* executionString)
+bool ShellCommand::execute(const char* executionString)
 {
   if (ShellCommandClass::commandClassList == NULL)
@@ -489,6 +504,6 @@
       if (commandClass != NULL && (fktPos == 1 || (fktPos == 2 && inputSplits.getCount() >= 3)))
       {
-        tIterator<ShellCommandBase>* itCMD = commandClass->commandList->getIterator();
-        ShellCommandBase* enumCMD = itCMD->firstElement();
+        tIterator<ShellCommand>* itCMD = commandClass->commandList->getIterator();
+        ShellCommand* enumCMD = itCMD->firstElement();
         while (enumCMD != NULL)
         {
@@ -520,5 +535,5 @@
  * @param description the description of the Given command
  */
-ShellCommandBase* ShellCommandBase::describe(const char* description)
+ShellCommand* ShellCommand::describe(const char* description)
 {
   if (this == NULL)
@@ -536,5 +551,5 @@
  * @returns itself
  */
-ShellCommandBase* ShellCommandBase::setAlias(const char* alias)
+ShellCommand* ShellCommand::setAlias(const char* alias)
 {
   if (this == NULL)
@@ -566,5 +581,5 @@
  * count, [EXACTLY THE SAME AS IF YOU WOULD CALL THE FUNCTION UP TO count ARGUMENTS]
  */
-ShellCommandBase* ShellCommandBase::defaultValues(unsigned int count, ...)
+ShellCommand* ShellCommand::defaultValues(unsigned int count, ...)
 {
   if (this == NULL)
@@ -615,5 +630,5 @@
  * prints out nice information about the Shells Commands
  */
-void ShellCommandBase::debug()
+void ShellCommand::debug()
 {
   if (ShellCommandClass::commandClassList == NULL)
@@ -628,11 +643,11 @@
   {
     PRINT(0)("Class:'%s' registered %d commands: \n", elemCL->className, elemCL->commandList->getSize());
-    tIterator<ShellCommandBase>* iterator = elemCL->commandList->getIterator();
-    const ShellCommandBase* elem = iterator->firstElement();
+    tIterator<ShellCommand>* iterator = elemCL->commandList->getIterator();
+    const ShellCommand* elem = iterator->firstElement();
     while(elem != NULL)
     {
       PRINT(0)("  command:'%s' : params:%d: ", elem->getName(), elem->paramCount);
       for (unsigned int i = 0; i< elem->paramCount; i++)
-       printf("%s ", ShellCommandBase::paramToString(elem->parameters[i]));
+       printf("%s ", ShellCommand::paramToString(elem->parameters[i]));
       if (elem->description != NULL)
        printf("- %s", elem->description);
@@ -652,5 +667,5 @@
  * @returns the Name of the Parameter at Hand
  */
-const char* ShellCommandBase::paramToString(long parameter)
+const char* ShellCommand::paramToString(long parameter)
 {
   return MultiType::MultiTypeToString((MT_Type)parameter);
