00001
00002
00008
00010
00011
00012 #ifndef __OSESSAME_SIMPLECOMMAND_H__
00013 #define __OSESSAME_SIMPLECOMMAND_H__
00014
00015 using namespace O_SESSAME;
00016
00017 namespace O_SESSAME {
00018
00024 template <class Receiver>
00025 class SimpleCommand : public Command
00026 {
00027 public:
00028 typedef void(Receiver::* Action)();
00029 SimpleCommand(Receiver* _pnewReceiver, Action _newAction) : m_pReceiver(_pnewReceiver), m_Action(_newAction) {}
00030 virtual ~Command();
00031
00032 virtual void Execute()
00033 {(m_pReceiver->*m_Action)();}
00034 protected:
00035 Action m_Action;
00036 Receiver* m_pReceiver;
00037 private:
00038
00039 };
00040 }
00041
00042 #endif
00043
00044
00045
00046
00047
00048
00049