source: src/base/command_factory.hpp@ 06e153

Last change on this file since 06e153 was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1136 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 952 bytes
Line 
1/**
2 * @file command_factory.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Thu May 19 16:48:40 2011
5 *
6 * @brief Class to store possible commands.
7 *
8 */
9
10#ifndef COMMAND_FACTORY_HPP_
11#define COMMAND_FACTORY_HPP_
12
13#include <map>
14#include <string>
15
16namespace VMG
17{
18
19class Command;
20class CommandProxyBase;
21
22class CommandFactory
23{
24public:
25 CommandFactory();
26 virtual ~CommandFactory();
27
28 void Register(CommandProxyBase* command); ///< Registers a command
29 Command* Get(const std::string& id); ///< Returns a command
30 void Delete(const std::string& id); ///< Deletes a command
31
32 bool CheckNumberOfArguments(const std::string& id, const int& num_arguments);
33
34 void PrintAvailableCommands(); ///< Prints the names of all registered commands
35
36private:
37 std::map<std::string, CommandProxyBase*> proxy_map;
38 std::map<std::string, Command*> instance_map;
39
40};
41
42}
43
44#endif /* COMMAND_FACTORY_HPP_ */
45
Note: See TracBrowser for help on using the repository browser.