source: src/base/proxy.hpp@ e7e9a6

Last change on this file since e7e9a6 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: 826 bytes
Line 
1/**
2 * @file proxy.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 12:23:43 2011
5 *
6 * @brief Header file for the classes VMG::CommandProxyBase and
7 * VMG::CommandProxy, used register commands at the factory.
8 *
9 */
10
11
12#ifndef COMMAND_PROXY_HPP_
13#define COMMAND_PROXY_HPP_
14
15namespace VMG
16{
17
18class Command;
19
20class CommandProxyBase
21{
22public:
23 CommandProxyBase();
24 virtual Command* CreateCommand() const = 0;
25
26 virtual const char* Name() const = 0;
27 virtual int Arguments() const = 0;
28};
29
30template <class T>
31class CommandProxy : public CommandProxyBase
32{
33public:
34 Command* CreateCommand() const
35 {
36 return new T;
37 }
38
39 const char* Name() const
40 {
41 return T::Name();
42 }
43
44 int Arguments() const
45 {
46 return T::Arguments();
47 }
48};
49
50}
51
52#endif /* COMMAND_PROXY_HPP_ */
Note: See TracBrowser for help on using the repository browser.