// // 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 { friend Singleton; 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 m_response_table; //停车调度模块状态 thread_safe_map m_storing_dispatch_statu_msg_map; thread_safe_map m_storing_dispatch_statu_time_map; //取车调度模块状态 thread_safe_map m_picking_dispatch_statu_msg_map; thread_safe_map m_picking_dispatch_statu_time_map; }; #endif //NNXX_TESTS_DISPATCH_COMMUNICATOR_H