diff options
author | Michael Wright <michaelwr@google.com> | 2013-05-21 14:11:34 -0700 |
---|---|---|
committer | Michael Wright <michaelwr@google.com> | 2013-05-30 18:40:04 -0700 |
commit | 24beb02a7a6ce11d1805d9142748523ddbcdd0a7 (patch) | |
tree | 6c53d1a417b4830c72c13ba94e81aac69acfc274 /include | |
parent | c40f4e64f267c78ff04862456092002d318a8adc (diff) | |
download | frameworks_native-24beb02a7a6ce11d1805d9142748523ddbcdd0a7.zip frameworks_native-24beb02a7a6ce11d1805d9142748523ddbcdd0a7.tar.gz frameworks_native-24beb02a7a6ce11d1805d9142748523ddbcdd0a7.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) |