Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/shell/shell_command_class.h @ 5779

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

orxonox/trunk: ClassList is now in std::list style
ShellCommand is now in std::list style

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