This repository has been archived on 2022-11-09. You can view files and clone it, but cannot push or open issues or pull requests.
patterns-old/lesson_6/SimpleCommand.hpp

25 lines
409 B
C++
Raw Normal View History

2021-11-04 19:47:40 +00:00
/*
* 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;
};