C++ Source code from a tutorial

源代码在线查看: command.h

软件大小: 420 K
上传用户: wanghaihah
关键词: tutorial Source code from
下载地址: 免注册下载 普通下载 VIP

相关代码

				#ifndef _COMMAND_H_
				#define _COMMAND_H_
				
				class Command {
				public:
				    virtual void Execute() = 0;
				};
				
				template 
				class SpecificCommand : public Command {
				protected:
				    typedef void (CommandList::* Action)();
				    Action action;
				    CommandList *commandlist;
				public:
				    SpecificCommand(CommandList* c, Action a) { 
				        commandlist = c;
				        action = a;
				    }
				    void Execute() {
				        (commandlist->*action)();
				    }
				};
				
				#endif
				
							

相关资源