#ifndef ACTION_H #define ACTION_H #include "Arduino.h" #include "functional" #include "StreamEvent.h" template class Action { public: Action(function _funcEventMatchesAction, function _funcInvokeAction) : funcEventMatchesAction(_funcEventMatchesAction), funcInvokeAction(_funcInvokeAction) {} bool eventMatchesAction(StreamEvent* event) { return funcEventMatchesAction(event); } T* invokeAction(StreamEvent* event) { return funcInvokeAction(event); } private: function funcEventMatchesAction; function funcInvokeAction; }; #endif