// // Created by huli on 2020/6/28. // #ifndef NNXX_TESTS_SYSTEM_COMMUNICATION_H #define NNXX_TESTS_SYSTEM_COMMUNICATION_H #include "message_communicator.h" #include #include #include "terminal_message.pb.h" /*typedef Error_manager (*StoreCommandCallback)(message::Store_command_request_msg& msg,message::Store_command_response_msg& response); typedef Error_manager (*PickupCommandCallback)(message::Pickup_command_request_msg& msg,message::Pickup_command_response_msg& response);*/ class Command_accepter:public Singleton { // 子类必须把父类设定为友元函数,这样父类才能使用子类的私有构造函数。 friend class Singleton; private: // 父类的构造函数必须保护,子类的构造函数必须私有。 Command_accepter(); public: //必须关闭拷贝构造和赋值构造,只能通过 get_instance 函数来进行操作唯一的实例。 Command_accepter(const Command_accepter& other) = delete; Command_accepter& operator =(const Command_accepter& other) = delete; /* * 发送中控状态消息, 出入口状态消息 */ Error_manager post_process_statu(message::Storing_process_statu_msg& msg); Error_manager post_process_statu(message::Picking_process_statu_msg& msg); Error_manager post_central_statu(message::Central_controller_statu_msg& msg); /* * 消费消息 */ Error_manager consume_msg(Communication_message* p_msg); ~Command_accepter(); }; #endif //NNXX_TESTS_SYSTEM_COMMUNICATION_H