pickup_terminal.h 798 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // Created by zx on 2020/7/16.
  3. //
  4. #ifndef NNXX_TESTS_PICKUP_TERMINAL_H
  5. #define NNXX_TESTS_PICKUP_TERMINAL_H
  6. #include <thread>
  7. #include "threadSafeQueue.h"
  8. #include "thread_condition.h"
  9. #include "error_code.h"
  10. #include "terminal_message.pb.h"
  11. class pickup_terminal {
  12. public:
  13. pickup_terminal(int terminal_id);
  14. ~pickup_terminal();
  15. Error_manager init(threadsafe_queue<message::Car_info>* queue);
  16. Error_manager pickup(message::Car_info& msg);
  17. protected:
  18. static void pickup_thread(pickup_terminal* pPickup);
  19. std::thread* m_pthread;
  20. int m_terminal_id;
  21. threadsafe_queue<message::Car_info>* m_thread_safe_queue;
  22. Thread_condition m_exit_cond;
  23. };
  24. #endif //NNXX_TESTS_PICKUP_TERMINAL_H