1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // Created by songchao.chen on 2019/7/4.
- // 区域中设定时间段人员超时限制
- //
- #ifndef WORKSPACE_AREA_PERSONS_THRE_TIME_H
- #define WORKSPACE_AREA_PERSONS_THRE_TIME_H
- #include <string>
- #include <map>
- #include <atomic>
- struct SArea_Persons_Thre
- {
- int db_id;
- int area_id;
- int thre_value;
- std::string sz_start_time;
- std::string sz_end_time;
- int start_time;
- int end_time;
- SArea_Persons_Thre()
- {
- db_id = 0;
- area_id = 0;
- thre_value = 0;
- start_time = 0;
- end_time = 0;
- sz_start_time = "";
- sz_end_time = "";
- }
- };
- typedef std::map<int,SArea_Persons_Thre> MAP_AREA_PERSONS_THRE;
- struct area_persons_thre_time
- {
- area_persons_thre_time(int _limit);
- MAP_AREA_PERSONS_THRE m_area_persons_thre;
- int m_default_limit_person_limit;
- // web修改数据
- std::atomic<bool> m_web_checkdata;
- void add_persons_thre(const SArea_Persons_Thre & thre);
- void del_persons_thre(int thre_db_id);
- void clear_persons_thre();
- //记录数量
- int get_count() const;
- // 获取区域cur_time超员的阈值,区域可能有时间段限制
- int get_limit_person_count(uint64_t cur_time = 0);
- };
- #endif //WORKSPACE_AREA_PERSONS_THRE_TIME_H
|