card.h 798 B

123456789101112131415161718192021222324252627282930
  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. struct card_list:single_base<card_list,uint64_t,std::shared_ptr<card_location_base>>
  8. {
  9. ///id64=-1为初始化所有卡, id格式为:10000001016
  10. void init_staffer(int64_t id64);
  11. void init_vehicle(int64_t id64);
  12. void on_message(zloop<task*> *loop,const message_locinfo&loc,bool is_history);
  13. void init_card_from_db();
  14. void load_his_card_postion_vehicle();
  15. void load_his_card_postion_staff();
  16. void load_his_card_postion_from_db();
  17. std::unique_ptr<std::thread> m_pThread;
  18. bool m_bflag=false;
  19. void run()
  20. {
  21. m_pThread.reset(new std::thread(std::bind(&card_list::onTimer,this)));
  22. }
  23. void onTimer();
  24. ~card_list(){m_bflag=true;}
  25. };
  26. #endif