Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 23, 2006, 12:43:25 AM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: some thoughts on a BaseIterator class, that can travers through ObejectLists without knowing the Polymorph type.
This is all virtual, and since templated virutal functions are not allowed, quite hard to implements…
hpe it will work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/shell/shell_command.cc

    r9406 r9692  
    2121#include "compiler.h"
    2222#include "debug.h"
    23 #include "class_list.h"
    2423
    2524#include "key_names.h"
     
    2827{
    2928  SHELL_COMMAND(debug, ShellCommandClass, help);
     29  NewObjectListDefinition(ShellCommand);
    3030
    3131
     
    3838  ShellCommand::ShellCommand(const std::string& commandName, const std::string& className, Executor* executor)
    3939  {
    40     this->setClassID(CL_SHELL_COMMAND, "ShellCommand");
     40    this->registerObject(this, ShellCommand::_objectList);
    4141    PRINTF(4)("create shellcommand '%s' for class '%s'\n", commandName.c_str(), className.c_str());
    4242    this->setName(commandName);
     
    9494  void ShellCommand::unregisterCommand(const std::string& commandName, const std::string& className)
    9595  {
    96 
    9796    ShellCommandClass* cmdClass = ShellCommandClass::acquireCommandClass(className);
    9897    if (cmdClass != NULL)
    9998    {
    10099      CmdList::iterator cmd;
    101       for (cmd = cmdClass->commandList.begin(); cmd != cmdClass->commandList.end(); cmd++)
     100      for (cmd = cmdClass->_commandList.begin(); cmd != cmdClass->_commandList.end(); cmd++)
    102101        if (commandName == (*cmd)->getName())
    103102        {
     
    119118
    120119    CmdList::const_iterator elem;
    121     for (unsigned int i = 0; i < cmdClass->commandList.size(); i++)
    122     {
    123       if (commandName == cmdClass->commandList[i]->getName())
    124         return (cmdClass->commandList[i]);
     120    for (unsigned int i = 0; i < cmdClass->_commandList.size(); i++)
     121    {
     122      if (commandName == cmdClass->_commandList[i]->getName())
     123        return (cmdClass->_commandList[i]);
    125124    }
    126125    return NULL;
Note: See TracChangeset for help on using the changeset viewer.