Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5165 in orxonox.OLD for trunk/src/lib/shell


Ignore:
Timestamp:
Sep 6, 2005, 1:04:48 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: commands now get unregistered when leaving orxonox

Location:
trunk/src/lib/shell
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.cc

    r5164 r5165  
    8686{
    8787  delete[] this->parameters;
     88}
     89
     90void ShellCommandBase::unregisterAllCommands()
     91{
     92  tIterator<ShellCommandBase>* iterator = ShellCommandBase::commandList->getIterator();
     93  ShellCommandBase* elem = iterator->firstElement();
     94  while(elem != NULL)
     95  {
     96    delete elem;
     97
     98    elem = iterator->nextElement();
     99  }
     100  delete iterator;
     101
     102  delete ShellCommandBase::commandList;
     103  ShellCommandBase::commandList = NULL;
     104}
     105
     106
     107void unregisterCommand(const char* commandName, const char* className)
     108{
     109  PRINTF(1)("IMPLEMENT THIS\n");
    88110}
    89111
     
    223245  if (this == NULL)
    224246    return NULL;
    225 
    226   this->description = description;
    227   return this;
    228 }
    229 
     247 else
     248 {
     249   this->description = description;
     250   return this;
     251 }
     252}
    230253
    231254void ShellCommandBase::debugDyn()
  • trunk/src/lib/shell/shell_command.h

    r5164 r5165  
    3939    static const tList<ShellCommandBase>* getCommandList() { return ShellCommandBase::commandList; };
    4040
    41 //    static void unregisterCommand(const char* commandNaame, const char* className);
     41    static void unregisterAllCommands();
     42    static void unregisterCommand(const char* commandNaame, const char* className);
    4243
    4344    static void debug();
Note: See TracChangeset for help on using the changeset viewer.