25 lines
409 B
C++
25 lines
409 B
C++
/*
|
||
* SimpleCommand.hpp
|
||
*
|
||
* Created on: 4 нояб. 2021 г.
|
||
* Author: alexander
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
#include "Command.hpp"
|
||
|
||
template<class Receiver>
|
||
class SimpleCommand: public Command
|
||
{
|
||
public:
|
||
typedef void (Receiver::*Action)();
|
||
SimpleCommand(Receiver *r, Action a) : _receiver(r), _action(a)
|
||
{
|
||
}
|
||
virtual void Execute();
|
||
private:
|
||
Action _action;
|
||
Receiver *_receiver;
|
||
};
|