card.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _CARD_HPP_
  2. #define _CARD_HPP_
  3. #include <thread>
  4. #include <ev++.h>
  5. #include "card_base.h"
  6. #include "write-copy.h"
  7. extern int three_rates_flag;
  8. extern int traffic_light_flag;
  9. extern int anti_coll_flag;
  10. extern int use_original_algo;
  11. struct card_list_visit:visitor<std::shared_ptr<card_location_base>>
  12. {
  13. bool visit(std::shared_ptr<card_location_base> c);
  14. bool _flag{false};
  15. };
  16. struct card_list:single_base<card_list,uint64_t,std::shared_ptr<card_location_base>>
  17. {
  18. ///lszId64=为初始化所有卡, lszId64格式为:0010000001016
  19. void init_staffer(const std::string & lszId64);
  20. void init_vehicle(const std::string & lszId64);
  21. void on_message(zloop<task*> *loop,message_locinfo&loc,bool is_history);
  22. void on_message(zloop<task*> *loop, message_tdoa_locinfo& loc, bool is_history);
  23. void on_message(zloop<task*> *loop, message_pdoa_locinfo& loc, bool is_history);
  24. void init_card_from_db();
  25. void load_his_card_postion_vehicle();
  26. void load_his_card_postion_staff();
  27. void load_his_card_postion_from_db();
  28. //获取卡数据 //标识id 人staff_id 车 vehicle_id
  29. const std::shared_ptr<card_location_base> get_card_by_cid(int cid);
  30. ~card_list(){}
  31. };
  32. #endif