Locate_communicator.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // Created by zx on 2020/6/18.
  3. //
  4. #ifndef NNXX_TESTS_LOCATE_COMMUNICATOR_H
  5. #define NNXX_TESTS_LOCATE_COMMUNICATOR_H
  6. #include <mutex>
  7. #include "communication_socket_base.h"
  8. #include "singleton.h"
  9. #include "measure_message.pb.h"
  10. #include "error_code.h"
  11. #include "thread_safe_map.h"
  12. class Locate_communicator: public Singleton<Locate_communicator>, public Communication_socket_base
  13. {
  14. friend Singleton<Locate_communicator>;
  15. public:
  16. virtual ~Locate_communicator();
  17. Error_manager locate_request(message::Measure_request_msg& request,message::Measure_response_msg& result);
  18. message::Measure_status_msg get_statu();
  19. protected:
  20. Locate_communicator();
  21. virtual Error_manager encapsulate_msg(Communication_message* message);
  22. virtual Error_manager execute_msg(Communication_message* p_msg);
  23. protected:
  24. thread_safe_map<int,message::Measure_response_msg> m_response_table;
  25. Communication_message m_measure_statu_msg;
  26. };
  27. #endif //NNXX_TESTS_LOCATE_COMMUNICATOR_H