123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- //
- // Created by zx on 2020/7/21.
- //
- #ifndef NNXX_TESTS_DISPATCH_COMMUNICATOR_H
- #define NNXX_TESTS_DISPATCH_COMMUNICATOR_H
- #include "message_communicator.h"
- #include "singleton.h"
- #include "dispatch_message.pb.h"
- #include "thread_safe_map.h"
- class Dispatch_excutor :public Singleton<Dispatch_excutor>
- {
- friend Singleton<Dispatch_excutor>;
- public:
- virtual ~Dispatch_excutor();
- Error_manager dispatch_request(message::Dispatch_request_msg& request,
- message::Dispatch_response_msg& result,Thread_condition& cancel_condition);
- /*
- * 提前取消请求
- */
- Error_manager cancel_request(message::Dispatch_request_msg& request);
- /*
- * 系统急停
- */
- //检查停车入口 调度节点状态
- Error_manager check_entrance_statu(int terminal_id);
- //检查取车出口 调度节点状态
- Error_manager check_export_statu(int terminal_id);
- //消费本模块的接收消息
- Error_manager consume_msg(Communication_message* p_msg);
- protected:
- Dispatch_excutor();
- private:
- thread_safe_map<std::string,message::Dispatch_response_msg> m_response_table;
- //停车调度模块状态
- thread_safe_map<int,message::Dispatch_terminal_status_msg> m_storing_dispatch_statu_msg_map;
- thread_safe_map<int,std::chrono::system_clock::time_point> m_storing_dispatch_statu_time_map;
- //取车调度模块状态
- thread_safe_map<int,message::Dispatch_terminal_status_msg> m_picking_dispatch_statu_msg_map;
- thread_safe_map<int,std::chrono::system_clock::time_point> m_picking_dispatch_statu_time_map;
- };
- #endif //NNXX_TESTS_DISPATCH_COMMUNICATOR_H
|