source: src/base/proxy.hpp@ 2fad0e0

Last change on this file since 2fad0e0 was 48b662, checked in by Olaf Lenz <olenz@…>, 14 years ago

Moved files in scafacos_fcs one level up.

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

  • Property mode set to 100644
File size: 918 bytes
Line 
1/*
2 * command_proxy.hpp
3 *
4 * Created on: 15.03.2011
5 * Author: Julian Iseringhausen
6 */
7
8/**
9 * @file proxy.hpp
10 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
11 * @date Mon Apr 18 12:23:43 2011
12 *
13 * @brief Header file for the classes VMGCommandProxyBase and
14 * VMGCommandProxy, used register commands at the factory.
15 *
16 */
17
18
19#ifndef COMMAND_PROXY_HPP_
20#define COMMAND_PROXY_HPP_
21
22namespace VMG
23{
24
25class Command;
26
27class CommandProxyBase
28{
29public:
30 CommandProxyBase();
31 virtual Command* CreateCommand() const = 0;
32
33 virtual const char* Name() const = 0;
34 virtual int Arguments() const = 0;
35};
36
37template <class T>
38class CommandProxy : public CommandProxyBase
39{
40public:
41 Command* CreateCommand() const
42 {
43 return new T;
44 }
45
46 const char* Name() const
47 {
48 return T::Name();
49 }
50
51 int Arguments() const
52 {
53 return T::Arguments();
54 }
55};
56
57}
58
59#endif /* COMMAND_PROXY_HPP_ */
Note: See TracBrowser for help on using the repository browser.