Commit 70a9ee39 authored by Michael Ott's avatar Michael Ott
Browse files

Overload == and & operators for SensorId class

parent 7faf7989
......@@ -118,11 +118,9 @@ public:
*/
bool patternMatch(std::string pattern);
#if 0
inline bool operator == (const SensorId& rhs) const {
return (data.raw[0] == rhs.data.raw[0]) &&
(data.raw[1] == rhs.data.raw[1]);}
#endif
inline bool operator < (const SensorId& rhs) const {
if (data.raw[0] == rhs.data.raw[0])
......@@ -138,6 +136,14 @@ public:
return data.raw[0] < rhs.data.raw[0];
}
inline SensorId operator & (const SensorId& rhs) const {
SensorId sid;
sid.data.raw[0] = (data.raw[0] & rhs.data.raw[0]);
sid.data.raw[1] = (data.raw[1] & rhs.data.raw[1]);
return sid;
}
SensorId();
SensorId(std::string mqttTopic);
virtual ~SensorId();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment