area_business_count_checker.h 907 B

12345678910111213141516171819202122232425262728
  1. #ifndef _area_business_count_checker_hpp_
  2. #define _area_business_count_checker_hpp_
  3. #include "area_business.h"
  4. /*
  5. 判断当前区域a中的人数是否超过设定人数,超过后告警
  6. 区域内实时人数存储在area对象中,在当前类on_enter/on_leave中进行更新
  7. 整个井下的超员和某个区域的超员都使用这个代码
  8. */
  9. struct area_business_count_checker:area_business
  10. {
  11. int area_business_type()
  12. {
  13. return 3;
  14. }
  15. //增加计数,并进行判断
  16. void on_enter(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr);
  17. void on_hover(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr);
  18. //减少计数
  19. void on_leave(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr);
  20. };
  21. #endif