Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Sep 5, 2005, 10:29:03 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more elaborate and MUCH easier through Macro-definition

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

Legend:

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

    r5161 r5162  
    3232using namespace std;
    3333
    34 ShellCommandBase* tmp = ShellCommand<Shell>::registerCommand("clear", "Shell", &Shell::clear);
     34SHELL_COMMAND(clear, Shell, clear);
    3535
    3636/**
     
    7676  for (int i = 1; i < SDLK_LAST; i++)
    7777    evh->subscribe(this, ES_SHELL, i);
    78 
    79   //void ShellCommand<T>::registerCommand(const char* commandName, ClassID classID, T* object, void* functionPointer, unsigned int paramCount, ...)
    80 
    81 
    82 /*  ShellCommand<Shell>::registerCommand("testS", CL_SHELL, &Shell::testS);
    83   ShellCommand<Shell>::registerCommand("testI", CL_SHELL, &Shell::testI, 5);
    84   ShellCommand<Shell>::registerCommand("testB", CL_SHELL, &Shell::testB);
    85   ShellCommand<Shell>::registerCommand("testF", CL_SHELL, &Shell::testF);
    86   ShellCommand<Shell>::registerCommand("testSF", CL_SHELL, &Shell::testSF);*/
    8778}
    8879
  • trunk/src/lib/shell/shell_command.h

    r5161 r5162  
    2121// FORWARD DECLARATION
    2222template<class T> class tList;
     23
     24#define SHELL_COMMAND(command, class, function) \
     25        ShellCommand<class>* shell_command_##class##_##command = ShellCommand<class>::registerCommand(#command, #class, &class::function)
    2326
    2427
Note: See TracChangeset for help on using the changeset viewer.