diff options
author | Michael Wright <michaelwr@google.com> | 2013-05-21 14:11:34 -0700 |
---|---|---|
committer | Alex Ray <aray@google.com> | 2013-07-30 13:57:01 -0700 |
commit | d614ee455705047fd27db0ad7f3013e6ea64204d (patch) | |
tree | 2f9e9beb641e2560f30d8f9a927f641057f3c709 /include | |
parent | 214c701ec6de8bd4b57f6aec8874fb343c79d874 (diff) | |
download | system_core-d614ee455705047fd27db0ad7f3013e6ea64204d.zip system_core-d614ee455705047fd27db0ad7f3013e6ea64204d.tar.gz system_core-d614ee455705047fd27db0ad7f3013e6ea64204d.tar.bz2 |
Added bitwise-or and bitwise-and to BitSet
Change-Id: I9bbf41f9d2d4a2593b0e6d7d8be7e283f985bade
Diffstat (limited to 'include')
-rw-r--r-- | include/utils/BitSet.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/utils/BitSet.h b/include/utils/BitSet.h index e189d0c..19c03d1 100644 --- a/include/utils/BitSet.h +++ b/include/utils/BitSet.h @@ -101,6 +101,20 @@ struct BitSet32 { inline bool operator== (const BitSet32& other) const { return value == other.value; } inline bool operator!= (const BitSet32& other) const { return value != other.value; } + inline BitSet32 operator& (const BitSet32& other) const { + return BitSet32(value & other.value); + } + inline BitSet32& operator&= (const BitSet32& other) { + value &= other.value; + return *this; + } + inline BitSet32 operator| (const BitSet32& other) const { + return BitSet32(value | other.value); + } + inline BitSet32& operator|= (const BitSet32& other) { + value |= other.value; + return *this; + } }; ANDROID_BASIC_TYPES_TRAITS(BitSet32) |