Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5170 in orxonox.OLD for trunk/src/lib/shell/shell_command.h


Ignore:
Timestamp:
Sep 7, 2005, 10:25:21 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: registration of ShellCommands now via the ShellCommandClass… still a lot of work has to be done.

File:
1 edited

Legend:

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

    r5166 r5170  
    3535// BASE CLASS //
    3636////////////////
     37class ShellCommandBase;
     38
     39//! A class to hold all Classes that have (once) registered Commands.
     40class ShellCommandClass : public BaseObject
     41{
     42  friend class ShellCommandBase;
     43
     44  public:
     45    static const tList<ShellCommandClass>* getCommandClassList() { return ShellCommandClass::commandClassList; };
     46    static ShellCommandClass* getCommandClass(const char* className);
     47
     48  private:
     49    ShellCommandClass(const char* className);
     50    ~ShellCommandClass();
     51
     52    static const ShellCommandClass* isRegistered(const char* className);
     53    static void initCommandClassList();
     54
     55  private:
     56  const char*                      className;
     57  ClassID                          classID;
     58  tList<ShellCommandBase>*         commandList;
     59  static tList<ShellCommandClass>* commandClassList;                     //!< A list of Classes
     60};
     61
     62
    3763//! a baseClass for all possible ShellCommands
    3864class ShellCommandBase : public BaseObject
    3965{
     66  friend class ShellCommandClass;
    4067  public:
    4168    static bool execute (const char* executionString);
     
    4471
    4572    /** @returns the CommandList of the Shell */
    46     static const tList<ShellCommandBase>* getCommandList() { return ShellCommandBase::commandList; };
    4773
    4874    static void unregisterAllCommands();
     
    74100
    75101  private:
    76 //    long                             classID;             //!< The ID of the Class associated to this Command
    77     const char*                      className;                            //!< The Name of the Class associated to this Command
     102    ShellCommandClass*               shellClass;                           //!< A Pointer to the Shell-Class this Command belongs to.
    78103
    79104    const char*                      description;                          //!< A description for this commnand. (initially NULL). Assigned with (create)->describe("blablabla");
    80 
    81     // STATIC MEMBERS
    82     static tList<ShellCommandBase>*  commandList;                          //!< A list of availiable commands.
    83105};
    84106
Note: See TracChangeset for help on using the changeset viewer.