command_accepter.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // Created by huli on 2020/6/28.
  3. //
  4. #ifndef NNXX_TESTS_SYSTEM_COMMUNICATION_H
  5. #define NNXX_TESTS_SYSTEM_COMMUNICATION_H
  6. #include "message_communicator.h"
  7. #include <process_message.pb.h>
  8. #include <central_control_message.pb.h>
  9. #include "terminal_message.pb.h"
  10. /*typedef Error_manager (*StoreCommandCallback)(message::Store_command_request_msg& msg,message::Store_command_response_msg& response);
  11. typedef Error_manager (*PickupCommandCallback)(message::Pickup_command_request_msg& msg,message::Pickup_command_response_msg& response);*/
  12. class Command_accepter:public Singleton<Command_accepter>
  13. {
  14. // 子类必须把父类设定为友元函数,这样父类才能使用子类的私有构造函数。
  15. friend class Singleton<Command_accepter>;
  16. private:
  17. // 父类的构造函数必须保护,子类的构造函数必须私有。
  18. Command_accepter();
  19. public:
  20. //必须关闭拷贝构造和赋值构造,只能通过 get_instance 函数来进行操作唯一的实例。
  21. Command_accepter(const Command_accepter& other) = delete;
  22. Command_accepter& operator =(const Command_accepter& other) = delete;
  23. /*
  24. * 发送中控状态消息, 出入口状态消息
  25. */
  26. Error_manager post_process_statu(message::Storing_process_statu_msg& msg);
  27. Error_manager post_process_statu(message::Picking_process_statu_msg& msg);
  28. Error_manager post_central_statu(message::Central_controller_statu_msg& msg);
  29. /*
  30. * 消费消息
  31. */
  32. Error_manager consume_msg(Communication_message* p_msg);
  33. ~Command_accepter();
  34. };
  35. #endif //NNXX_TESTS_SYSTEM_COMMUNICATION_H