Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: some command-stuff

File size: 1.7 KB
RevLine 
[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"
[7388]10#include <vector>
[1853]11
[5068]12
[7374]13namespace OrxShell
14{
15  // FORWARD DECLARATION
16  class ShellCommand;
17  class ShellCommandAlias;
[3543]18
[7374]19  //! A class to hold all Classes that have (once) registered Commands.
20  class ShellCommandClass : public BaseObject
21  {
22    friend class ShellCommand;
[5170]23
24  public:
[5197]25    /** @returns the CommandClassList */
[7394]26    static const std::vector<ShellCommandClass*>& getCommandClassList() { return ShellCommandClass::commandClassList; };
[5190]27
[7386]28    static bool getCommandListOfClass(const std::string& className, std::list<std::string>& stringList);
29
[5171]30    static void unregisterAllCommands();
[7408]31    static const ShellCommandClass* getCommandClass(const std::string& className);
[7411]32    ClassID getClassID();
[7408]33    static bool exists(const std::string& className);
[5170]34
[7221]35    static void help (const std::string& className);
[5204]36
[5170]37  private:
[7221]38    ShellCommandClass(const std::string& className);
[7408]39    static ShellCommandClass* acquireCommandClass(const std::string& className);
[6981]40    virtual ~ShellCommandClass();
[5170]41
42
[7388]43    void registerCommand(ShellCommand* command);
44    void unregisterCommand(ShellCommand* command);
45
[5170]46  private:
[7221]47    const std::string                      className;                 //!< The Name of the Class. This should match the ClassName of the Commands Class.
[7411]48    ClassID                                classID;                   //!< The classID of this Class
[7388]49    std::vector<ShellCommand*>             commandList;               //!< A list of Commands from this Class
[7394]50
51    static std::vector<ShellCommandClass*> commandClassList;          //!< A list of Classes
[7374]52  };
[5170]53
[7374]54}
55
[5129]56#endif /* _SHELL_COMMAND_H */
Note: See TracBrowser for help on using the repository browser.