Last change
on this file since 5759 was
5639,
checked in by bensch, 19 years ago
|
orxonox/trunk: splitted shell_command into shell_command and shell_command_class
|
File size:
1.7 KB
|
Rev | Line | |
---|
[4838] | 1 | /*! |
---|
[5639] | 2 | * @file shell_command_class.h |
---|
[5068] | 3 | * Definition of a on-screen-shell |
---|
[5391] | 4 | */ |
---|
[1853] | 5 | |
---|
[5639] | 6 | #ifndef _SHELL_COMMAND_CLASS_H |
---|
| 7 | #define _SHELL_COMMAND_CLASS_H |
---|
[1853] | 8 | |
---|
[5129] | 9 | #include "base_object.h" |
---|
[1853] | 10 | |
---|
[5068] | 11 | |
---|
[4838] | 12 | // FORWARD DECLARATION |
---|
[5068] | 13 | template<class T> class tList; |
---|
[3543] | 14 | |
---|
[5161] | 15 | //////////////// |
---|
| 16 | // BASE CLASS // |
---|
| 17 | //////////////// |
---|
[5636] | 18 | class ShellCommand; |
---|
[5190] | 19 | class ShellCommandAlias; |
---|
[5170] | 20 | |
---|
| 21 | //! A class to hold all Classes that have (once) registered Commands. |
---|
| 22 | class ShellCommandClass : public BaseObject |
---|
| 23 | { |
---|
[5636] | 24 | friend class ShellCommand; |
---|
[5170] | 25 | |
---|
| 26 | public: |
---|
[5197] | 27 | /** @returns the CommandClassList */ |
---|
[5170] | 28 | static const tList<ShellCommandClass>* getCommandClassList() { return ShellCommandClass::commandClassList; }; |
---|
[5195] | 29 | static bool getCommandListOfClass(const char* className, tList<const char>* stringList); |
---|
| 30 | static bool getCommandListOfAlias(tList<const char>* aliasList); |
---|
[5190] | 31 | |
---|
[5170] | 32 | static ShellCommandClass* getCommandClass(const char* className); |
---|
[5171] | 33 | static void unregisterAllCommands(); |
---|
[5170] | 34 | |
---|
[5204] | 35 | static void help (const char* className); |
---|
| 36 | |
---|
[5170] | 37 | private: |
---|
| 38 | ShellCommandClass(const char* className); |
---|
| 39 | ~ShellCommandClass(); |
---|
| 40 | |
---|
| 41 | static const ShellCommandClass* isRegistered(const char* className); |
---|
| 42 | static void initCommandClassList(); |
---|
| 43 | |
---|
| 44 | private: |
---|
[5171] | 45 | const char* className; //!< The Name of the Class. This should match the ClassName of the Commands Class. |
---|
| 46 | long classID; //!< The classID of this Class |
---|
[5639] | 47 | tList<ShellCommand>* commandList; //!< A list of Commands from this Class |
---|
[5171] | 48 | static tList<ShellCommandClass>* commandClassList; //!< A list of Classes |
---|
[5195] | 49 | static tList<ShellCommandAlias>* aliasList; //!< An Alias to A Command. (only for classes with one Instance) |
---|
[5170] | 50 | }; |
---|
| 51 | |
---|
[5129] | 52 | #endif /* _SHELL_COMMAND_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.