kDB: Knowledge DataBase
Loading...
Searching...
No Matches
AbstractCommand.h
1#include <knowCore/Global.h>
2
3#include <QMap>
4
5class QCommandLineParser;
6
8{
9public:
10 virtual ~AbstractCommand();
11 virtual void setup(QCommandLineParser* _parser) = 0;
12 virtual int execute(QCommandLineParser* _parser) = 0;
13 static QMap<QString, AbstractCommand*> commands;
14};
15
16#define REGISTER_COMMAND(_NAME_, _CMD_NAME_) \
17 struct Factory ## _NAME_ \
18 { \
19 Factory ## _NAME_() \
20 { \
21 AbstractCommand::commands[# _CMD_NAME_] = new _NAME_(); \
22 } \
23 }; \
24 Factory ## _NAME_ factory ## _NAME_;
Definition AbstractCommand.h:8
Definition Forward.h:12