Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/shell/shell_command.h @ 5571

Last change on this file since 5571 was 5552, checked in by bensch, 19 years ago

orxonox/trunk: ShellCommand now uses MultiType instead of many different strange constellations →
saves space and complexity (a bit complexity at least)

File size: 18.6 KB
RevLine 
[4838]1/*!
[5129]2 * @file shell_command.h
[5068]3 * Definition of a on-screen-shell
[5391]4 */
[1853]5
[5129]6#ifndef _SHELL_COMMAND_H
7#define _SHELL_COMMAND_H
[1853]8
[5129]9#include "base_object.h"
[1853]10
[5141]11#include "helper_functions.h"
[5552]12#include "multi_type.h"
[5155]13#include "substring.h"
[5143]14#include "functor_list.h"
[5141]15
[5068]16#include <stdarg.h>
17
[5166]18#define     SHELL_COMMAND_MAX_SIZE      //!< The maximum size of a Shell Command
[5130]19
[5127]20
[5130]21
[4838]22// FORWARD DECLARATION
[5068]23template<class T> class tList;
[3543]24
[5166]25/**
26 * an easy to use Macro to create a Command
27 * @param command the name of the command (without "" around the string)
28 * @param class the name of the class to apply this command to (without the "" around the string)
29 * @param function the function to call
[5179]30 *
31 * MEANING:
32 *  ShellCommandBase* someUniqueVarName =
33 *       ShellCommand<ClassName>::registerCommand("commandNameInShell", "ClassName", &ClassName::FunctionToCall);
34 *
35 * In the Shell you would call this Command using:
36 * $ ClassName [ObjectName] commandNameInShell [parameters]
[5166]37 */
[5162]38#define SHELL_COMMAND(command, class, function) \
[5164]39        ShellCommandBase* shell_command_##class##_##command = ShellCommand<class>::registerCommand(#command, #class, &class::function)
[5329]40/**
41 * an easy to use Macro to create a Command
42 * @param command the name of the command (without "" around the string)
43 * @param class the name of the class to apply this command to (without the "" around the string)
44 * @param function the function to call
45 *
46 * MEANING:
47 *  ShellCommandBase* someUniqueVarName =
48 *       ShellCommand<ClassName>::registerCommand("commandNameInShell", "ClassName", &ClassName::FunctionToCall);
49 *
50 * In the Shell you would call this Command using:
51 * $ ClassName [ObjectName] commandNameInShell [parameters]
52 */
53#define SHELL_COMMAND_STATIC(command, class, function) \
54                         ShellCommandBase* shell_command_##class##_##command = ShellCommandStatic<class>::registerCommand(#command, #class, function)
[5135]55
[5162]56
[5328]57//! an enumerator for the definition of the Type.
58typedef enum {
59  ShellCommand_Objective = 1,
60  ShellCommand_Static    = 2,
61} ShellCommand_Type;
62
[5161]63////////////////
64// BASE CLASS //
65////////////////
[5170]66class ShellCommandBase;
[5190]67class ShellCommandAlias;
[5170]68
69//! A class to hold all Classes that have (once) registered Commands.
70class ShellCommandClass : public BaseObject
71{
72  friend class ShellCommandBase;
73
74  public:
[5197]75    /** @returns the CommandClassList */
[5170]76    static const tList<ShellCommandClass>* getCommandClassList() { return ShellCommandClass::commandClassList; };
[5195]77    static bool getCommandListOfClass(const char* className, tList<const char>* stringList);
78    static bool getCommandListOfAlias(tList<const char>* aliasList);
[5190]79
[5170]80    static ShellCommandClass* getCommandClass(const char* className);
[5171]81    static void unregisterAllCommands();
[5170]82
[5204]83    static void help (const char* className);
84
[5170]85  private:
86    ShellCommandClass(const char* className);
87    ~ShellCommandClass();
88
89    static const ShellCommandClass* isRegistered(const char* className);
90    static void initCommandClassList();
91
92  private:
[5171]93    const char*                      className;                 //!< The Name of the Class. This should match the ClassName of the Commands Class.
94    long                             classID;                   //!< The classID of this Class
95    tList<ShellCommandBase>*         commandList;               //!< A list of Commands from this Class
96    static tList<ShellCommandClass>* commandClassList;          //!< A list of Classes
[5195]97    static tList<ShellCommandAlias>* aliasList;                 //!< An Alias to A Command. (only for classes with one Instance)
[5170]98};
99
100
[5161]101//! a baseClass for all possible ShellCommands
102class ShellCommandBase : public BaseObject
103{
[5170]104  friend class ShellCommandClass;
[5161]105  public:
106    static bool execute (const char* executionString);
107
[5164]108    ShellCommandBase* describe(const char* description);
[5190]109    ShellCommandBase* setAlias(const char* alias);
[5207]110    ShellCommandBase* defaultValues(unsigned int count, ...);
[5164]111
[5166]112    /** @returns the CommandList of the Shell */
113    static void unregisterCommand(const char* commandName, const char* className);
[5161]114
115    static void debug();
116
117  protected:
118    ShellCommandBase(const char* commandName, const char* className, unsigned int paramCount, ...);
119    ~ShellCommandBase();
120
[5328]121    /** @returns the Type of this Function (either static or objective) */
122    inline ShellCommand_Type getType() { return this->functorType; };
123
[5161]124    static bool isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...);
125    static const char* paramToString(long parameter);
126
127  private:
[5166]128    /** executes a Command @param object the object to apply this to @param parameters the parameters the command takes */
[5279]129    virtual void executeCommand (BaseObject* object, const char* parameters) = 0;
[5161]130
131  protected:
[5328]132    ShellCommand_Type                functorType;                          //!< The type of Function we've got (either static or objective).
[5163]133    void*                            functionPointer;                      //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL )
[5166]134    unsigned int                     paramCount;                           //!< the count of parameters.
135    unsigned int*                    parameters;                           //!< Parameters the function of this Command takes.
[5552]136    MultiType*                       defaultValue;                         //!< Default Values.
[5161]137
138  private:
[5170]139    ShellCommandClass*               shellClass;                           //!< A Pointer to the Shell-Class this Command belongs to.
[5196]140    ShellCommandAlias*               alias;                                //!< An Alias for the Class.
[5161]141
[5166]142    const char*                      description;                          //!< A description for this commnand. (initially NULL). Assigned with (create)->describe("blablabla");
[5161]143};
144
145///////////////////////////////////////////////////
146///////////////////////////////////////////////////
147
[5326]148/////////////////////////////////
149// MACRO DEFINITION EXTENSIONS //
150/////////////////////////////////
[5166]151//! where to chek for default BOOL values
[5552]152#define   l_BOOL_DEFGRAB(i)         this->defaultValue[i].getBool()
[5166]153//! where to chek for default INT values
[5552]154#define   l_INT_DEFGRAB(i)          this->defaultValue[i].getInt()
[5166]155//! where to chek for default UINT values
[5552]156#define   l_UINT_DEFGRAB(i)         (unsigned int)this->defaultValue[i].getInt()
[5166]157//! where to chek for default LONG values
[5552]158#define   l_LONG_DEFGRAB(i)         (long)this->defaultValue[i].getInt()
[5166]159//! where to chek for default FLOAT values
[5552]160#define   l_FLOAT_DEFGRAB(i)        this->defaultValue[i].getFloat()
[5166]161//! where to chek for default STRING values
[5552]162#define   l_STRING_DEFGRAB(i)       this->defaultValue[i].getString()
[5135]163
[5153]164//////////////////////////
165// COMMAND REGISTRATION //
166//////////////////////////
[5326]167// SHELLCOMMAND can be redefined as ShellCommand or ShellCommandStatic
168// SHELLCOMMANDEXECUTER can be redefined too.
[5327]169// SHELLCOMMANDINCLASS
[5328]170// SHELLCOMMANDTYPE
[5166]171//! registers a command without any parameters
[5153]172#define ShellCommandRegister0() \
[5327]173  static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)()) \
[5142]174  { \
[5161]175    if (isRegistered(commandName, className, 0)== true) \
176      return NULL; \
[5327]177    return new SHELLCOMMAND<T>(commandName, className, function); \
[5142]178  }
[5135]179
[5166]180//! registers a command with 1 parameter
[5145]181#define ShellCommandRegister1(t1) \
[5552]182  static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE)) \
[5135]183  { \
[5161]184    if (isRegistered(commandName, className, 1, t1##_PARAM)== true) \
185      return NULL; \
[5552]186    return new SHELLCOMMAND<T>(commandName, className, function); \
[5142]187  }
188
[5166]189//! registers a command with 2 parameters
[5153]190#define ShellCommandRegister2(t1,t2) \
[5552]191  static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE)) \
[5153]192  { \
[5161]193    if (isRegistered(commandName, className, 2, t1##_PARAM, t2##_PARAM)== true) \
194      return NULL; \
[5552]195    return new SHELLCOMMAND<T>(commandName, className, function); \
[5153]196  }
197
[5166]198//! registers a command with 3 parameters
[5153]199#define ShellCommandRegister3(t1,t2,t3) \
[5552]200  static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE)) \
[5153]201  { \
[5161]202    if (isRegistered(commandName, className, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM)== true) \
203      return NULL; \
[5552]204    return new SHELLCOMMAND<T>(commandName, className, function); \
[5153]205  }
206
[5166]207//! registers a command with 4 parameters
[5153]208#define ShellCommandRegister4(t1,t2,t3,t4) \
[5552]209  static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE)) \
[5153]210  { \
[5161]211    if (isRegistered(commandName, className, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM)== true) \
212      return NULL; \
[5552]213    return new SHELLCOMMAND<T>(commandName, className, function); \
[5153]214  }
[5161]215
[5166]216//! registers a command with 5 parameters
[5153]217#define ShellCommandRegister5(t1,t2,t3,t4,t5) \
[5552]218  static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE)) \
[5153]219  { \
[5161]220    if (isRegistered(commandName, className, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM)== true) \
221      return NULL; \
[5552]222    return new ShellCommand<T>(commandName, className, function); \
[5153]223  }
224
[5551]225///////////////////////
226// FUNCTION POINTERS //
227///////////////////////
228#define ShellCommandFunctionPoiter0() \
229  void SHELLCOMMANDINCLASS(*functionPointer_0)();
230
231#define ShellCommandFunctionPoiter1(t1) \
232  void SHELLCOMMANDINCLASS(*functionPointer_1_##t1)(t1##_TYPE);
233
234#define ShellCommandFunctionPoiter2(t1, t2) \
235  void SHELLCOMMANDINCLASS(*functionPointer_2_##t1##_##t2)(t1##_TYPE, t2##_TYPE);
236
237
238#define ShellCommandFunctionPoiter3(t1, t2, t3) \
239  void SHELLCOMMANDINCLASS(*functionPointer_3_##t1##_##t2##_##t3)(t1##_TYPE, t2##_TYPE, t3##_TYPE);
240
241#define ShellCommandFunctionPoiter4(t1, t2, t3, t4) \
242  void SHELLCOMMANDINCLASS(*functionPointer_4_##t1##_##t2##_##t3##_##t4)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE);
243
244
245#define ShellCommandFunctionPoiter5(t1, t2, t3, t4, t5) \
246  void SHELLCOMMANDINCLASS(*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE); \
247
248
[5153]249//////////////////
250// CONSTRUCTORS //
251/////////////////
[5166]252//! creates a command that takes no parameters
[5153]253#define ShellCommandConstructor0() \
[5327]254  SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)()) \
[5161]255  : ShellCommandBase(commandName, className, 0) \
[5142]256  { \
[5328]257    this->functorType = SHELLCOMMANDTYPE; \
[5551]258    this->fp.functionPointer_0 = function; \
[5142]259  }
260
[5166]261//! creates a command that takes one parameter
[5145]262#define ShellCommandConstructor1(t1) \
[5552]263  SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE)) \
264  : ShellCommandBase(commandName, className, 1, t1##_PARAM) \
[5135]265  { \
[5328]266    this->functorType = SHELLCOMMANDTYPE; \
[5551]267    this->fp.functionPointer_1_##t1 = function; \
[5135]268  }
269
[5166]270//! creates a command that takes two parameters
[5153]271#define ShellCommandConstructor2(t1,t2) \
[5552]272  SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE)) \
273  : ShellCommandBase(commandName, className, 2, t1##_PARAM, t2##_PARAM) \
[5153]274  { \
[5328]275    this->functorType = SHELLCOMMANDTYPE; \
[5551]276    this->fp.functionPointer_2_##t1##_##t2 = function; \
[5153]277  }
[5135]278
[5166]279//! creates a command that takes three parameter
[5153]280#define ShellCommandConstructor3(t1,t2,t3) \
[5552]281  SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE)) \
282  : ShellCommandBase(commandName, className, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM) \
[5153]283  { \
[5328]284    this->functorType = SHELLCOMMANDTYPE; \
[5551]285    this->fp.functionPointer_3_##t1##_##t2##_##t3 = function; \
[5153]286  }
[5141]287
[5166]288//! creates a command that takes four parameter
[5153]289#define ShellCommandConstructor4(t1,t2,t3,t4) \
[5552]290  SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE)) \
291  : ShellCommandBase(commandName, className, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM) \
[5153]292  { \
[5328]293    this->functorType = SHELLCOMMANDTYPE; \
[5551]294    this->fp.functionPointer_4_##t1##_##t2##_##t3##_##t4 = function; \
[5153]295  }
296
[5166]297//! creates a command that takes five parameter
[5153]298#define ShellCommandConstructor5(t1,t2,t3,t4,t5) \
[5552]299  SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE)) \
300  : ShellCommandBase(commandName, className, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM) \
[5153]301  { \
[5328]302    this->functorType = SHELLCOMMANDTYPE; \
[5551]303    this->fp.functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5 = function; \
[5153]304  }
305
306///////////////
307// EXECUTION //
308///////////////
[5166]309//! execute-macro for functions with no parameters
[5153]310#define ShellCommandExecute0() \
[5145]311  if (this->paramCount == 0) \
[5326]312    SHELLCOMMANDEXECUTER(_0)()
[5145]313
[5166]314//! execute-macro for functions with one parameter
[5145]315#define ShellCommandExecute1(t1) \
[5146]316   else if (this->paramCount == 1 && this->parameters[0] == t1##_PARAM) \
[5326]317    SHELLCOMMANDEXECUTER(_1_##t1)(t1##_FUNC(parameters, t1##_DEFGRAB(0)))
[5145]318
[5166]319//! execute-macro for functions with two parameters
[5153]320#define ShellCommandExecute2(t1,t2) \
321   else if (this->paramCount == 2 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM) \
[5326]322    SHELLCOMMANDEXECUTER(_2_##t1##_##t2)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)))
[5145]323
[5166]324//! execute-macro for functions with three parameters
[5153]325#define ShellCommandExecute3(t1,t2,t3) \
326   else if (this->paramCount == 3 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM) \
[5326]327    SHELLCOMMANDEXECUTER(_3_##t1##_##t2##_##t3)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)))
[5153]328
[5166]329//! execute-macro for functions with four parameters
[5153]330#define ShellCommandExecute4(t1,t2,t3,t4) \
331   else if (this->paramCount == 4 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM && this->parameters[3] == t4##_PARAM) \
[5326]332    SHELLCOMMANDEXECUTER(_4_##t1##_##t2##_##t3##_##t4)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3)))
[5153]333
[5166]334//! execute-macro for functions with five parameters
[5153]335#define ShellCommandExecute5(t1,t2,t3,t4,t5) \
336   else if (this->paramCount == 5 && this->parameters[0] == t1##_PARAM && this->parameters[1] == t2##_PARAM && this->parameters[2] == t3##_PARAM && this->parameters[3] == t4##_PARAM && this->parameters[4] == t5##_PARAM) \
[5326]337    SHELLCOMMANDEXECUTER(_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_FUNC(sub.getString(0), t1##_DEFGRAB(0)), t2##_FUNC(sub.getString(1), t2##_DEFGRAB(1)), t3##_FUNC(sub.getString(2), t3##_DEFGRAB(2)), t4##_FUNC(sub.getString(3), t4##_DEFGRAB(3)), t5##_FUNC(sub.getString(4), t5##_DEFGRAB(4)))
[5153]338
339
[5129]340//! keeps information about a ShellCommand
341template<class T> class ShellCommand : public ShellCommandBase
342{
343  public:
[5153]344#ifdef FUNCTOR_LIST
345#undef FUNCTOR_LIST
346#endif
[5326]347#ifdef SHELLCOMMAND
348#undef SHELLCOMMAND
349#endif
[5327]350#define SHELLCOMMAND                       ShellCommand
[5326]351#ifdef SHELLCOMMANDEXECUTER
352#undef SHELLCOMMANDEXECUTER
353#endif
[5551]354#define SHELLCOMMANDEXECUTER(nameExt)      (dynamic_cast<T*>(object)->*(fp.functionPointer##nameExt))
[5327]355#ifdef SHELLCOMMANDINCLASS
356#undef SHELLCOMMANDINCLASS
357#endif
358#define SHELLCOMMANDINCLASS(FUNCTION)      (T::FUNCTION)
[5328]359#ifdef SHELLCOMMANDTYPE
360#undef SHELLCOMMANDTYPE
361#endif
362#define SHELLCOMMANDTYPE                   ShellCommand_Objective
[5166]363//! FUNCTOR_LIST is the List of command-registerers
[5142]364#define FUNCTOR_LIST(x) ShellCommandRegister ## x
[5153]365#include "functor_list.h"
[5142]366#undef FUNCTOR_LIST
[5136]367
[5142]368
[5068]369  private:
[5551]370//! FUNCTOR_LIST is the List of FunctionPointers
371    union FunctionPointers {
372#define FUNCTOR_LIST(x) ShellCommandFunctionPoiter ## x
373#include "functor_list.h"
374#undef FUNCTOR_LIST
375    } fp;
376
[5166]377//! FUNCTOR_LIST is the List of CommandConstructors
[5142]378#define FUNCTOR_LIST(x) ShellCommandConstructor ## x
[5153]379#include "functor_list.h"
[5142]380#undef FUNCTOR_LIST
381
382    virtual void executeCommand (BaseObject* object, const char* parameters)
[5135]383    {
[5204]384      SubString sub(parameters, true);
[5166]385//! FUNCTOR_LIST is the List of Executive Functions
[5145]386#define FUNCTOR_LIST(x) ShellCommandExecute ## x
[5153]387#include "functor_list.h"
[5135]388#undef FUNCTOR_LIST
[5145]389    }
[5129]390};
[5113]391
[5327]392//! keeps information about a ShellCommand, that points to a Static Function
[5326]393template<class T> class ShellCommandStatic : public ShellCommandBase
394{
395  public:
396#ifdef FUNCTOR_LIST
397#undef FUNCTOR_LIST
398#endif
399#ifdef SHELLCOMMAND
400#undef SHELLCOMMAND
401#endif
402#define SHELLCOMMAND                      ShellCommandStatic
403#ifdef SHELLCOMMANDEXECUTER
404#undef SHELLCOMMANDEXECUTER
405#endif
[5551]406#define SHELLCOMMANDEXECUTER(nameExt)     fp.functionPointer##nameExt
[5327]407#ifdef SHELLCOMMANDINCLASS
408#undef SHELLCOMMANDINCLASS
409#endif
410#define SHELLCOMMANDINCLASS(FUNCTION)     (FUNCTION)
[5328]411#ifdef SHELLCOMMANDTYPE
412#undef SHELLCOMMANDTYPE
413#endif
414#define SHELLCOMMANDTYPE                   ShellCommand_Static
[5326]415
416//! FUNCTOR_LIST is the List of command-registerers
417#define FUNCTOR_LIST(x) ShellCommandRegister ## x
418#include "functor_list.h"
419#undef FUNCTOR_LIST
420
421  private:
[5551]422//! FUNCTOR_LIST is the List of FunctionPointers
423    union FunctionPointers {
424#define FUNCTOR_LIST(x) ShellCommandFunctionPoiter ## x
425#include "functor_list.h"
426#undef FUNCTOR_LIST
427    } fp;
428
[5326]429//! FUNCTOR_LIST is the List of CommandConstructors
430#define FUNCTOR_LIST(x) ShellCommandConstructor ## x
431#include "functor_list.h"
432#undef FUNCTOR_LIST
433
434    virtual void executeCommand (BaseObject* object, const char* parameters)
435    {
436  SubString sub(parameters, true);
437//! FUNCTOR_LIST is the List of Executive Functions
438#define FUNCTOR_LIST(x) ShellCommandExecute ## x
439#include "functor_list.h"
440#undef FUNCTOR_LIST
441    }
442};
443
[5197]444//! A Class, that handles aliases.
[5190]445class ShellCommandAlias
446{
[5196]447  friend class ShellCommandBase;
[5190]448  public:
[5197]449    /** @returns the Name of the Alias. */
[5195]450    const char* getName() const { return this->aliasName; };
[5197]451    /** @returns the Command, this Alias is asociated with */
[5195]452    ShellCommandBase* getCommand() const { return this->command; };
[5196]453
[5190]454  private:
[5197]455    /** @param aliasName the name of the Alias @param command the Command, to associate this alias with */
[5196]456    ShellCommandAlias(const char* aliasName, ShellCommandBase* command) { this->aliasName = aliasName; this->command = command; };
457
458  private:
[5197]459    const char*         aliasName;       //!< the name of the Alias
460    ShellCommandBase*   command;         //!< a pointer to the command, this alias executes.
[5190]461};
462
[5129]463#endif /* _SHELL_COMMAND_H */
Note: See TracBrowser for help on using the repository browser.