exception_solver.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // Created by zx on 2020/8/20.
  3. //
  4. #ifndef NNXX_TESTS_ERROR_HANDLING_H
  5. #define NNXX_TESTS_ERROR_HANDLING_H
  6. #include "message_communicator.h"
  7. #include "central_control_message.pb.h"
  8. #include "thread_safe_map.h"
  9. #include "StoreProcessTask.h"
  10. #include "PickupProcessTask.h"
  11. class Exception_solver :public Singleton<Exception_solver>
  12. {
  13. friend Singleton<Exception_solver>;
  14. public:
  15. virtual ~Exception_solver();
  16. /*
  17. * 添加流程的任务取消标志位
  18. * license:车牌号,作为流程任务的唯一标识
  19. */
  20. Error_manager add_task_cancel_condition(std::string license,Process_task* task);
  21. /*
  22. * 删除流程的任务取消标志位
  23. * license:车牌号,作为流程任务的唯一标识
  24. */
  25. Error_manager delete_task_cancel_condition(std::string license);
  26. /*
  27. * 处理故障
  28. */
  29. Error_manager solve_exception(Error_manager code,Process_task* task);
  30. /*
  31. * 等待手动消息
  32. */
  33. Error_manager waitfor_manual_operate_msg(Process_task* task,message::Process_manual_operation_msg& msg);
  34. /*
  35. * 消息消费函数
  36. */
  37. Error_manager consume_msg(Communication_message* p_msg);
  38. //车位分配错误处理
  39. Error_manager parking_alloc_error_handling(Error_manager code,Process_task* task);
  40. protected:
  41. Exception_solver();
  42. private:
  43. thread_safe_map<std::string,tq::BaseTask*> m_ptask_map;
  44. thread_safe_map<std::string,message::Process_manual_operation_msg> m_manual_msg_map;
  45. };
  46. #endif //NNXX_TESTS_ERROR_HANDLING_H