123456789101112131415161718192021222324252627282930313233343536373839 |
- #ifndef AREA_BUSINESS_CAR_ATTENDANCE_H
- #define AREA_BUSINESS_CAR_ATTENDANCE_H
- #include"area_business.h"
- #include"unordered_map"
- class area_business_car_attendance:public area_business
- {
- public:
- area_business_car_attendance();
- void on_load_his(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr);
-
- void on_enter(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr);
- void on_hover(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr);
-
- void on_leave(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr);
-
- static void init_attendance_area_from_db();
- private:
- static bool is_attendance_area(int area_id, int vehicle_type_id)
- {
- return m_map.end() != m_map.find(to_list_id(area_id, vehicle_type_id));
- }
- static uint64_t to_list_id(int area_id, int vehicle_type_id)
- {
- return (static_cast<uint64_t>(area_id)<<32) | static_cast<uint64_t>(vehicle_type_id);
- }
-
- static std::unordered_map<uint64_t, int> m_map;
- };
- #endif
|