// // Created by zx on 2020/6/18. // #ifndef NNXX_TESTS_LOCATE_COMMUNICATOR_H #define NNXX_TESTS_LOCATE_COMMUNICATOR_H #include #include "message_communicator.h" #include "measure_message.pb.h" #include "thread_safe_map.h" /* * 注册消息的比较函数,用于重载==与<符号,使其可以用作map中的key */ class Measure_excutor: public Singleton { friend Singleton; public: virtual ~Measure_excutor(); Error_manager locate_request(message::Measure_request_msg& request, message::Measure_response_msg& result,Thread_condition& cancel_condition); Error_manager consume_msg(Communication_message* p_msg); /* * 提前取消请求 */ Error_manager cancel_request(message::Measure_request_msg& request); Error_manager check_statu(int terminal_id); protected: Measure_excutor(); protected: thread_safe_map m_response_table; thread_safe_map m_measure_statu_msg_map; thread_safe_map m_statu_recv_time_map; }; #endif //NNXX_TESTS_LOCATE_COMMUNICATOR_H