diff --git a/libraries/shared/src/PropertyFlags.h b/libraries/shared/src/PropertyFlags.h index 9b21ff9f9f..846c4886b0 100644 --- a/libraries/shared/src/PropertyFlags.h +++ b/libraries/shared/src/PropertyFlags.h @@ -49,7 +49,7 @@ public: Enum lastFlag() const { return (Enum)_maxFlag; } void setHasProperty(Enum flag, bool value = true); - bool getHasProperty(Enum flag); + bool getHasProperty(Enum flag) const; QByteArray encode(); void decode(const QByteArray& fromEncoded); @@ -61,42 +61,42 @@ public: PropertyFlags& operator=(const PropertyFlags& other); - PropertyFlags& operator|=(PropertyFlags other); + PropertyFlags& operator|=(const PropertyFlags& other); PropertyFlags& operator|=(Enum flag); - PropertyFlags& operator&=(PropertyFlags other); + PropertyFlags& operator&=(const PropertyFlags& other); PropertyFlags& operator&=(Enum flag); - PropertyFlags& operator+=(PropertyFlags other); + PropertyFlags& operator+=(const PropertyFlags& other); PropertyFlags& operator+=(Enum flag); - PropertyFlags& operator-=(PropertyFlags other); + PropertyFlags& operator-=(const PropertyFlags& other); PropertyFlags& operator-=(Enum flag); - PropertyFlags& operator<<=(PropertyFlags other); + PropertyFlags& operator<<=(const PropertyFlags& other); PropertyFlags& operator<<=(Enum flag); - PropertyFlags operator|(PropertyFlags other) const; + PropertyFlags operator|(const PropertyFlags& other) const; PropertyFlags operator|(Enum flag) const; - PropertyFlags operator&(PropertyFlags other) const; + PropertyFlags operator&(const PropertyFlags& other) const; PropertyFlags operator&(Enum flag) const; - PropertyFlags operator+(PropertyFlags other) const; + PropertyFlags operator+(const PropertyFlags& other) const; PropertyFlags operator+(Enum flag) const; - PropertyFlags operator-(PropertyFlags other) const; + PropertyFlags operator-(const PropertyFlags& other) const; PropertyFlags operator-(Enum flag) const; - PropertyFlags operator<<(PropertyFlags other) const; + PropertyFlags operator<<(const PropertyFlags& other) const; PropertyFlags operator<<(Enum flag) const; // NOTE: due to the nature of the compact storage of these property flags, and the fact that the upper bound of the // enum is not know, these operators will only perform their bitwise operations on the set of properties that have // been previously set - PropertyFlags& operator^=(PropertyFlags other); + PropertyFlags& operator^=(const PropertyFlags& other); PropertyFlags& operator^=(Enum flag); - PropertyFlags operator^(PropertyFlags other) const; + PropertyFlags operator^(const PropertyFlags& other) const; PropertyFlags operator^(Enum flag) const; PropertyFlags operator~() const; @@ -146,7 +146,7 @@ template inline void PropertyFlags::setHasProperty(Enum fla } } -template inline bool PropertyFlags::getHasProperty(Enum flag) { +template inline bool PropertyFlags::getHasProperty(Enum flag) const { if (flag > _maxFlag) { return _trailingFlipped; // usually false } @@ -253,7 +253,7 @@ template inline PropertyFlags& PropertyFlags::operato return *this; } -template inline PropertyFlags& PropertyFlags::operator|=(PropertyFlags other) { +template inline PropertyFlags& PropertyFlags::operator|=(const PropertyFlags& other) { _flags |= other._flags; _maxFlag = std::max(_maxFlag, other._maxFlag); _minFlag = std::min(_minFlag, other._minFlag); @@ -268,7 +268,7 @@ template inline PropertyFlags& PropertyFlags::operato return *this; } -template inline PropertyFlags& PropertyFlags::operator&=(PropertyFlags other) { +template inline PropertyFlags& PropertyFlags::operator&=(const PropertyFlags& other) { _flags &= other._flags; shinkIfNeeded(); return *this; @@ -281,7 +281,7 @@ template inline PropertyFlags& PropertyFlags::operato return *this; } -template inline PropertyFlags& PropertyFlags::operator^=(PropertyFlags other) { +template inline PropertyFlags& PropertyFlags::operator^=(const PropertyFlags& other) { _flags ^= other._flags; shinkIfNeeded(); return *this; @@ -294,7 +294,7 @@ template inline PropertyFlags& PropertyFlags::operato return *this; } -template inline PropertyFlags& PropertyFlags::operator+=(PropertyFlags other) { +template inline PropertyFlags& PropertyFlags::operator+=(const PropertyFlags& other) { for(int flag = (int)other.firstFlag(); flag <= (int)other.lastFlag(); flag++) { if (other.getHasProperty((Enum)flag)) { setHasProperty((Enum)flag, true); @@ -308,7 +308,7 @@ template inline PropertyFlags& PropertyFlags::operato return *this; } -template inline PropertyFlags& PropertyFlags::operator-=(PropertyFlags other) { +template inline PropertyFlags& PropertyFlags::operator-=(const PropertyFlags& other) { for(int flag = (int)other.firstFlag(); flag <= (int)other.lastFlag(); flag++) { if (other.getHasProperty((Enum)flag)) { setHasProperty((Enum)flag, false); @@ -322,7 +322,7 @@ template inline PropertyFlags& PropertyFlags::operato return *this; } -template inline PropertyFlags& PropertyFlags::operator<<=(PropertyFlags other) { +template inline PropertyFlags& PropertyFlags::operator<<=(const PropertyFlags& other) { for(int flag = (int)other.firstFlag(); flag <= (int)other.lastFlag(); flag++) { if (other.getHasProperty((Enum)flag)) { setHasProperty((Enum)flag, true); @@ -336,7 +336,7 @@ template inline PropertyFlags& PropertyFlags::operato return *this; } -template inline PropertyFlags PropertyFlags::operator|(PropertyFlags other) const { +template inline PropertyFlags PropertyFlags::operator|(const PropertyFlags& other) const { PropertyFlags result(*this); result |= other; return result; @@ -349,7 +349,7 @@ template inline PropertyFlags PropertyFlags::operator return result; } -template inline PropertyFlags PropertyFlags::operator&(PropertyFlags other) const { +template inline PropertyFlags PropertyFlags::operator&(const PropertyFlags& other) const { PropertyFlags result(*this); result &= other; return result; @@ -362,7 +362,7 @@ template inline PropertyFlags PropertyFlags::operator return result; } -template inline PropertyFlags PropertyFlags::operator^(PropertyFlags other) const { +template inline PropertyFlags PropertyFlags::operator^(const PropertyFlags& other) const { PropertyFlags result(*this); result ^= other; return result; @@ -375,7 +375,7 @@ template inline PropertyFlags PropertyFlags::operator return result; } -template inline PropertyFlags PropertyFlags::operator+(PropertyFlags other) const { +template inline PropertyFlags PropertyFlags::operator+(const PropertyFlags& other) const { PropertyFlags result(*this); result += other; return result; @@ -387,7 +387,7 @@ template inline PropertyFlags PropertyFlags::operator return result; } -template inline PropertyFlags PropertyFlags::operator-(PropertyFlags other) const { +template inline PropertyFlags PropertyFlags::operator-(const PropertyFlags& other) const { PropertyFlags result(*this); result -= other; return result; @@ -399,7 +399,7 @@ template inline PropertyFlags PropertyFlags::operator return result; } -template inline PropertyFlags PropertyFlags::operator<<(PropertyFlags other) const { +template inline PropertyFlags PropertyFlags::operator<<(const PropertyFlags& other) const { PropertyFlags result(*this); result <<= other; return result;