Index: trunk/src/lib/event/command_chain.cc
===================================================================
--- trunk/src/lib/event/command_chain.cc	(revision 5460)
+++ trunk/src/lib/event/command_chain.cc	(revision 5461)
@@ -30,17 +30,17 @@
 
 /**
- * creates a new ShellCommandClass
+ * creates a new CommandChainClass
  * @param className the Name of the command-class to create
  */
-ShellCommandClass::ShellCommandClass(const char* className)
-{
-  this->setClassID(CL_SHELL_COMMAND_CLASS, "ShellCommandClass");
+CommandChainClass::CommandChainClass(const char* className)
+{
+  this->setClassID(CL_COMMAND_CHAIN_CLASS, "CommandChainClass");
   this->setName(className);
 
   this->className = className;
   this->classID = CL_NULL;
-  this->commandList = new tList<ShellCommandBase>;
-
-  ShellCommandClass::commandClassList->add(this);
+  this->commandList = new tList<CommandChainBase>;
+
+  CommandChainClass::commandClassList->add(this);
 }
 
@@ -48,8 +48,8 @@
  * destructs the shellCommandClass again
  */
-ShellCommandClass::~ShellCommandClass()
-{
-  tIterator<ShellCommandBase>* iterator = this->commandList->getIterator();
-  ShellCommandBase* elem = iterator->firstElement();
+CommandChainClass::~CommandChainClass()
+{
+  tIterator<CommandChainBase>* iterator = this->commandList->getIterator();
+  CommandChainBase* elem = iterator->firstElement();
   while(elem != NULL)
   {
@@ -67,17 +67,17 @@
  * @returns true on success, false otherwise
  */
-bool ShellCommandClass::getCommandListOfClass(const char* className, tList<const char>* stringList)
+bool CommandChainClass::getCommandListOfClass(const char* className, tList<const char>* stringList)
 {
   if (stringList == NULL || className == NULL)
     return false;
 
-  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elem = iterator->firstElement();
+  tIterator<CommandChainClass>* iterator = CommandChainClass::commandClassList->getIterator();
+  CommandChainClass* elem = iterator->firstElement();
   while(elem != NULL)
   {
     if (!strcmp (elem->getName(), className))
     {
-      tIterator<ShellCommandBase>* itFkt = elem->commandList->getIterator();
-      ShellCommandBase* command = itFkt->firstElement();
+      tIterator<CommandChainBase>* itFkt = elem->commandList->getIterator();
+      CommandChainBase* command = itFkt->firstElement();
       while (command != NULL)
       {
@@ -95,15 +95,15 @@
 
 /**
- * collects the Aliases registered to the ShellCommands
+ * collects the Aliases registered to the CommandChains
  * @param stringList a List to paste the Aliases into.
  * @returns true on success, false otherwise
  */
-bool ShellCommandClass::getCommandListOfAlias(tList<const char>* stringList)
-{
-  if (stringList == NULL || ShellCommandClass::aliasList == NULL)
+bool CommandChainClass::getCommandListOfAlias(tList<const char>* stringList)
+{
+  if (stringList == NULL || CommandChainClass::aliasList == NULL)
     return false;
 
-  tIterator<ShellCommandAlias>* iterator = ShellCommandClass::aliasList->getIterator();
-   ShellCommandAlias* elem = iterator->firstElement();
+  tIterator<CommandChainAlias>* iterator = CommandChainClass::aliasList->getIterator();
+   CommandChainAlias* elem = iterator->firstElement();
    while(elem != NULL)
    {
@@ -118,9 +118,9 @@
  * unregisters all Commands that exist
  */
-void ShellCommandClass::unregisterAllCommands()
+void CommandChainClass::unregisterAllCommands()
 {
   // unregister all commands
-  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elem = iterator->firstElement();
+  tIterator<CommandChainClass>* iterator = CommandChainClass::commandClassList->getIterator();
+  CommandChainClass* elem = iterator->firstElement();
   while(elem != NULL)
   {
@@ -131,12 +131,12 @@
   delete iterator;
 
-  delete ShellCommandClass::commandClassList;
-  ShellCommandClass::commandClassList = NULL;
+  delete CommandChainClass::commandClassList;
+  CommandChainClass::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();
+  if (CommandChainClass::aliasList != NULL)
+  {
+    tIterator<CommandChainAlias>* itAL = CommandChainClass::aliasList->getIterator();
+    CommandChainAlias* elemAL = itAL->firstElement();
     while(elemAL != NULL)
     {
@@ -145,6 +145,6 @@
     }
     delete itAL;
-    delete ShellCommandClass::aliasList;
-    ShellCommandClass::aliasList = NULL;
+    delete CommandChainClass::aliasList;
+    CommandChainClass::aliasList = NULL;
   }
 }
@@ -155,11 +155,11 @@
  * @returns the CommandClass if found, NULL otherwise
  */
-const ShellCommandClass* ShellCommandClass::isRegistered(const char* className)
-{
-  if (ShellCommandClass::commandClassList == NULL)
+const CommandChainClass* CommandChainClass::isRegistered(const char* className)
+{
+  if (CommandChainClass::commandClassList == NULL)
     initCommandClassList();
 
-  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elem = iterator->firstElement();
+  tIterator<CommandChainClass>* iterator = CommandChainClass::commandClassList->getIterator();
+  CommandChainClass* elem = iterator->firstElement();
   while(elem != NULL)
   {
@@ -183,11 +183,11 @@
  * @returns the CommandClass if found, or a new CommandClass if not
  */
-ShellCommandClass* ShellCommandClass::getCommandClass(const char* className)
-{
-  if (ShellCommandClass::commandClassList == NULL)
+CommandChainClass* CommandChainClass::getCommandClass(const char* className)
+{
+  if (CommandChainClass::commandClassList == NULL)
     initCommandClassList();
 
-  tIterator<ShellCommandClass>* iterator = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elem = iterator->firstElement();
+  tIterator<CommandChainClass>* iterator = CommandChainClass::commandClassList->getIterator();
+  CommandChainClass* elem = iterator->firstElement();
   while(elem != NULL)
   {
@@ -200,5 +200,5 @@
   }
   delete iterator;
-  return new ShellCommandClass(className);
+  return new CommandChainClass(className);
 }
 
@@ -206,21 +206,21 @@
  * 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);
-  }
-}
-
-void ShellCommandClass::help(const char* className)
+void CommandChainClass::initCommandClassList()
+{
+  if (CommandChainClass::commandClassList == NULL)
+  {
+    CommandChainClass::commandClassList = new tList<CommandChainClass>;
+    CommandChainStatic<CommandChainBase>::registerCommand("debug", "CommandChain", CommandChainBase::debug);
+  }
+}
+
+void CommandChainClass::help(const char* className)
 {
   if (className == NULL)
     return;
-  if (likely(ShellCommandClass::commandClassList != NULL))
-  {
-    tIterator<ShellCommandClass>* itCL = ShellCommandClass::commandClassList->getIterator();
-    ShellCommandClass* elemCL = itCL->firstElement();
+  if (likely(CommandChainClass::commandClassList != NULL))
+  {
+    tIterator<CommandChainClass>* itCL = CommandChainClass::commandClassList->getIterator();
+    CommandChainClass* elemCL = itCL->firstElement();
     while(elemCL != NULL)
     {
@@ -228,11 +228,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<CommandChainBase>* iterator = elemCL->commandList->getIterator();
+        const CommandChainBase* 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 ", CommandChainBase::paramToString(elem->parameters[i]));
           if (elem->description != NULL)
             PRINT(0)("- %s", elem->description);
@@ -256,6 +256,6 @@
 }
 
-tList<ShellCommandClass>* ShellCommandClass::commandClassList = NULL;
-tList<ShellCommandAlias>* ShellCommandClass::aliasList = NULL;
+tList<CommandChainClass>* CommandChainClass::commandClassList = NULL;
+tList<CommandChainAlias>* CommandChainClass::aliasList = NULL;
 
 /**
@@ -266,7 +266,7 @@
  * @return self
  */
-ShellCommandBase::ShellCommandBase(const char* commandName, const char* className, unsigned int paramCount, ...)
-{
-  this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
+CommandChainBase::CommandChainBase(const char* commandName, const char* className, unsigned int paramCount, ...)
+{
+  this->setClassID(CL_COMMAND_CHAIN, "CommandChain");
   this->setName(commandName);
   this->description = NULL;
@@ -274,5 +274,5 @@
 
 //  this->classID = classID;
-  this->shellClass = ShellCommandClass::getCommandClass(className); //ClassList::IDToString(classID);
+  this->shellClass = CommandChainClass::getCommandClass(className); //ClassList::IDToString(classID);
   if (this->shellClass != NULL)
     this->shellClass->commandList->add(this);
@@ -321,13 +321,13 @@
 
 /**
- * deconstructs a ShellCommand
+ * deconstructs a CommandChain
  * @return
  */
-ShellCommandBase::~ShellCommandBase()
+CommandChainBase::~CommandChainBase()
 {
   delete[] this->parameters;
-  if (this->alias != NULL && ShellCommandClass::aliasList != NULL)
-  {
-    ShellCommandClass::aliasList->remove(this->alias);
+  if (this->alias != NULL && CommandChainClass::aliasList != NULL)
+  {
+    CommandChainClass::aliasList->remove(this->alias);
     delete this->alias;
   }
@@ -339,15 +339,15 @@
  * @param commandName the name of the command itself
  */
-void ShellCommandBase::unregisterCommand(const char* commandName, const char* className)
-{
-  if (ShellCommandClass::commandClassList == NULL)
-    ShellCommandClass::initCommandClassList();
-
- const ShellCommandClass* checkClass = ShellCommandClass::isRegistered(className);
+void CommandChainBase::unregisterCommand(const char* commandName, const char* className)
+{
+  if (CommandChainClass::commandClassList == NULL)
+    CommandChainClass::initCommandClassList();
+
+ const CommandChainClass* checkClass = CommandChainClass::isRegistered(className);
 
  if (checkClass != NULL)
   {
-    tIterator<ShellCommandBase>* iterator = checkClass->commandList->getIterator();
-    ShellCommandBase* elem = iterator->firstElement();
+    tIterator<CommandChainBase>* iterator = checkClass->commandList->getIterator();
+    CommandChainBase* elem = iterator->firstElement();
     while(elem != NULL)
     {
@@ -364,5 +364,5 @@
     if (checkClass->commandList->getSize() == 0)
     {
-      ShellCommandClass::commandClassList->remove(checkClass);
+      CommandChainClass::commandClassList->remove(checkClass);
       delete checkClass;
     }
@@ -380,17 +380,17 @@
  * This is checked in the registerCommand-function.
  */
-bool ShellCommandBase::isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...)
-{
-  if (ShellCommandClass::commandClassList == NULL)
-  {
-    ShellCommandClass::initCommandClassList();
+bool CommandChainBase::isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...)
+{
+  if (CommandChainClass::commandClassList == NULL)
+  {
+    CommandChainClass::initCommandClassList();
     return false;
   }
 
-  const ShellCommandClass* checkClass = ShellCommandClass::isRegistered(className);
+  const CommandChainClass* checkClass = CommandChainClass::isRegistered(className);
   if (checkClass != NULL)
   {
-    tIterator<ShellCommandBase>* iterator = checkClass->commandList->getIterator();
-    ShellCommandBase* elem = iterator->firstElement();
+    tIterator<CommandChainBase>* iterator = checkClass->commandList->getIterator();
+    CommandChainBase* elem = iterator->firstElement();
     while(elem != NULL)
    {
@@ -418,11 +418,11 @@
  */
 #include  "stdlibincl.h"
-bool ShellCommandBase::execute(const char* executionString)
-{
-  if (ShellCommandClass::commandClassList == NULL)
+bool CommandChainBase::execute(const char* executionString)
+{
+  if (CommandChainClass::commandClassList == NULL)
     return false;
 
   long classID = CL_NULL;                 //< the classID retrieved from the Class.
-  ShellCommandClass* commandClass = NULL; //< the command class this command applies to.
+  CommandChainClass* commandClass = NULL; //< the command class this command applies to.
   tList<BaseObject>* objectList = NULL;   //< the list of Objects stored in classID
   BaseObject* objectPointer = NULL;       //< a pointer to th Object to Execute the command on
@@ -437,8 +437,8 @@
   {
     // CHECK FOR ALIAS
-    if (ShellCommandClass::aliasList != NULL)
-    {
-      tIterator<ShellCommandAlias>* itAL = ShellCommandClass::aliasList->getIterator();
-      ShellCommandAlias* elemAL = itAL->firstElement();
+    if (CommandChainClass::aliasList != NULL)
+    {
+      tIterator<CommandChainAlias>* itAL = CommandChainClass::aliasList->getIterator();
+      CommandChainAlias* elemAL = itAL->firstElement();
       while(elemAL != NULL)
       {
@@ -462,8 +462,8 @@
     }
     // looking for a Matching Class
-    if (likely(ShellCommandClass::commandClassList != NULL))
-    {
-      tIterator<ShellCommandClass>* itCL = ShellCommandClass::commandClassList->getIterator();
-      ShellCommandClass* elemCL = itCL->firstElement();
+    if (likely(CommandChainClass::commandClassList != NULL))
+    {
+      tIterator<CommandChainClass>* itCL = CommandChainClass::commandClassList->getIterator();
+      CommandChainClass* elemCL = itCL->firstElement();
       while(elemCL != NULL)
       {
@@ -507,11 +507,11 @@
       if (commandClass != NULL && (fktPos == 1 || (fktPos == 2 && inputSplits.getCount() >= 3)))
       {
-        tIterator<ShellCommandBase>* itCMD = commandClass->commandList->getIterator();
-        ShellCommandBase* enumCMD = itCMD->firstElement();
+        tIterator<CommandChainBase>* itCMD = commandClass->commandList->getIterator();
+        CommandChainBase* enumCMD = itCMD->firstElement();
         while (enumCMD != NULL)
         {
           if (!strcmp(enumCMD->getName(), inputSplits.getString(fktPos)))
           {
-            if (objectPointer == NULL && enumCMD->functorType == ShellCommand_Objective)
+            if (objectPointer == NULL && enumCMD->functorType == CommandChain_Objective)
             {
               delete itCMD;
@@ -538,5 +538,5 @@
  * @param description the description of the Given command
  */
-ShellCommandBase* ShellCommandBase::describe(const char* description)
+CommandChainBase* CommandChainBase::describe(const char* description)
 {
   if (this == NULL)
@@ -554,5 +554,5 @@
  * @returns itself
  */
-ShellCommandBase* ShellCommandBase::setAlias(const char* alias)
+CommandChainBase* CommandChainBase::setAlias(const char* alias)
 {
   if (this == NULL)
@@ -565,9 +565,9 @@
   else
   {
-    if (ShellCommandClass::aliasList == NULL)
-      ShellCommandClass::aliasList = new tList<ShellCommandAlias>;
-
-    ShellCommandAlias* aliasCMD = new ShellCommandAlias(alias, this);
-    ShellCommandClass::aliasList->add(aliasCMD);
+    if (CommandChainClass::aliasList == NULL)
+      CommandChainClass::aliasList = new tList<CommandChainAlias>;
+
+    CommandChainAlias* aliasCMD = new CommandChainAlias(alias, this);
+    CommandChainClass::aliasList->add(aliasCMD);
     this->alias = aliasCMD;
   }
@@ -584,5 +584,5 @@
  * count, [EXACTLY THE SAME AS IF YOU WOULD CALL THE FUNCTION UP TO count ARGUMENTS]
  */
-ShellCommandBase* ShellCommandBase::defaultValues(unsigned int count, ...)
+CommandChainBase* CommandChainBase::defaultValues(unsigned int count, ...)
 {
   if (this == NULL)
@@ -633,7 +633,7 @@
  * prints out nice information about the Shells Commands
  */
-void ShellCommandBase::debug()
-{
-  if (ShellCommandClass::commandClassList == NULL)
+void CommandChainBase::debug()
+{
+  if (CommandChainClass::commandClassList == NULL)
   {
     PRINT(0)("No Command registered.\n");
@@ -641,16 +641,16 @@
   }
 
-  tIterator<ShellCommandClass>* iteratorCL = ShellCommandClass::commandClassList->getIterator();
-  ShellCommandClass* elemCL = iteratorCL->firstElement();
+  tIterator<CommandChainClass>* iteratorCL = CommandChainClass::commandClassList->getIterator();
+  CommandChainClass* elemCL = iteratorCL->firstElement();
   while(elemCL != NULL)
   {
     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<CommandChainBase>* iterator = elemCL->commandList->getIterator();
+    const CommandChainBase* 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 ", CommandChainBase::paramToString(elem->parameters[i]));
       if (elem->description != NULL)
        printf("- %s", elem->description);
@@ -670,5 +670,5 @@
  * @returns the Name of the Parameter at Hand
  */
-const char* ShellCommandBase::paramToString(long parameter)
+const char* CommandChainBase::paramToString(long parameter)
 {
   switch (parameter)
