module_solid_ball.h 675 B

1234567891011121314151617181920212223242526
  1. #include <tpm_common.h>
  2. #include <boost/serialization/singleton.hpp>
  3. class solid_ball_module{
  4. public:
  5. std::shared_ptr<sb_card> get(const std::string& sid)
  6. {
  7. auto itc = m_card_list.find(sid);
  8. if(itc == m_card_list.end())
  9. {
  10. return nullptr;
  11. }
  12. return itc->second;
  13. }
  14. int do_business(std::shared_ptr<sb_card> ptr_card);
  15. public:
  16. std::map<std::string, std::shared_ptr<sb_card>> m_card_list;
  17. private:
  18. double get_distance(const point& p, const std::string& sid);
  19. };
  20. //单件定义
  21. using singleton_solid_ball_module = boost::serialization::singleton<solid_ball_module>
  22. #define ssolid_ball_module singleton_solid_ball_module::get_mutable_instance()