less than operator overloads
This commit is contained in:
parent
7a1bcd74ca
commit
777732e378
|
@ -194,6 +194,22 @@ bool operator== (const discoveredUniverse& a, const discoveredUniverse& b)
|
|||
a.source == b.source);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief operator <
|
||||
* @param a
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
bool operator< (const discoveredUniverse& a, const discoveredUniverse& b)
|
||||
{
|
||||
if (a.universe != b.universe)
|
||||
return (a.universe < b.universe);
|
||||
|
||||
return a.source < b.source;
|
||||
}
|
||||
|
||||
|
||||
} // DISCOVERY
|
||||
} // EXTENDED
|
||||
} // SACN
|
||||
|
|
|
@ -146,6 +146,8 @@ struct discoveredUniverse
|
|||
|
||||
friend bool operator== (const discoveredUniverse& a,
|
||||
const discoveredUniverse& b);
|
||||
friend bool operator< (const discoveredUniverse& a,
|
||||
const discoveredUniverse& b);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -431,6 +431,18 @@ bool operator== (const uuid& a, const uuid& b)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief operator <
|
||||
* @param a
|
||||
* @param b
|
||||
* @return
|
||||
*/
|
||||
bool operator< (const uuid& a, const uuid& b)
|
||||
{
|
||||
return (std::memcmp(a.raw_, b.raw_, UUID_LENGTH) < 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief uuid::operator const uint8_t *
|
||||
*/
|
||||
|
|
|
@ -149,6 +149,7 @@ public:
|
|||
// operator overloads
|
||||
uuid& operator= (const uuid& other);
|
||||
friend bool operator== (const uuid&, const uuid&);
|
||||
friend bool operator< (const uuid&, const uuid&);
|
||||
|
||||
// typecast overload
|
||||
operator const uint8_t * () const;
|
||||
|
|
Loading…
Reference in New Issue