1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| #include <iostream> #include <memory> #include <set> #include <functional>
class Message;
class MessagePolaris { public: using Ptr = std::unique_ptr<MessagePolaris>; void SetCallBack(std::function<bool (const std::set<std::string>&, Message*)> call_back) { call_back_ = call_back; }
private: std::function<bool (const std::set<std::string>&, Message*)> call_back_; };
class TaskPlan { public: using Ptr = std::unique_ptr<TaskPlan>; private: bool OnMessage(const std::set<std::string>& receivers, Message* msg) { return true; } private: MessagePolaris::Ptr msg_polaris_; };
|