1234567891011121314151617181920212223242526272829303132333435 |
- #include "AlarmInfo.h"
- AlarmInfo_t& AlarmInfo_t::operator=(const AlarmInfo_t& obj)
- {
- if (this == &obj)
- {
- return *this; // 防止自赋值
- }
- isAlarm = obj.isAlarm;
- CompareItemID = obj.CompareItemID;
- strCompareItemName = obj.strCompareItemName;
- RoadInfo = obj.RoadInfo;
- RoadType = obj.RoadType;
- AlarmType = obj.AlarmType;
- StartTime = obj.StartTime;
- EndTime = obj.EndTime;
- strAlarmFilePath = obj.strAlarmFilePath;
- AlarmStartPos = obj.AlarmStartPos;
- AlarmFileStartTime = obj.AlarmFileStartTime;
- return *this;
- }
- /* 比较是否相等,主要是比较是否报警、通道ID,报警类型,报警时间 */
- bool AlarmInfo_t::operator==(const AlarmInfo_t& other) const
- {
- return (isAlarm == other.isAlarm) &&
- (RoadInfo == other.RoadInfo) &&
- (AlarmType == other.AlarmType) &&
- (StartTime == other.StartTime) &&
- (EndTime == other.EndTime);
- }
|