notify_excutor.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // Created by zx on 2020/7/21.
  3. //
  4. #ifndef NNXX_NOTIFY_EXCUTOR_COMMUNICATOR_H
  5. #define NNXX_NOTIFY_EXCUTOR_COMMUNICATOR_H
  6. #include "message_communicator.h"
  7. #include "singleton.h"
  8. #include "notify_message.pb.h"
  9. #include "thread_safe_map.h"
  10. class Notify_excutor :public Singleton<Notify_excutor>
  11. {
  12. friend Singleton<Notify_excutor>;
  13. public:
  14. virtual ~Notify_excutor();
  15. Error_manager notify_request(message::Notify_request_msg& request,
  16. message::Notify_response_msg& response,Thread_condition& cancel_condition);
  17. /*
  18. * 提前取消请求
  19. */
  20. Error_manager cancel_request(message::Notify_request_msg& request);
  21. //检查节点状态
  22. Error_manager check_node_statu();
  23. //消费本模块的接收消息
  24. Error_manager consume_msg(Communication_message* p_msg);
  25. protected:
  26. Notify_excutor();
  27. private:
  28. thread_safe_map<std::string,message::Notify_response_msg> m_response_table;
  29. //取车调度模块状态
  30. message::Notify_status_msg m_notify_statu_msg;
  31. std::chrono::system_clock::time_point m_notify_statu_time;
  32. };
  33. #endif //NNXX_TESTS_DISPATCH_COMMUNICATOR_H