/** * @file proxy.hpp * @author Julian Iseringhausen * @date Mon Apr 18 12:23:43 2011 * * @brief Header file for the classes VMG::CommandProxyBase and * VMG::CommandProxy, used register commands at the factory. * */ #ifndef COMMAND_PROXY_HPP_ #define COMMAND_PROXY_HPP_ namespace VMG { class Command; class CommandProxyBase { public: CommandProxyBase(); virtual Command* CreateCommand() const = 0; virtual const char* Name() const = 0; virtual int Arguments() const = 0; }; template class CommandProxy : public CommandProxyBase { public: Command* CreateCommand() const { return new T; } const char* Name() const { return T::Name(); } int Arguments() const { return T::Arguments(); } }; } #endif /* COMMAND_PROXY_HPP_ */