summaryrefslogtreecommitdiff
path: root/include/utils/BitSet.h
diff options
context:
space:
mode:
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
commit24beb02a7a6ce11d1805d9142748523ddbcdd0a7 (patch)
tree6c53d1a417b4830c72c13ba94e81aac69acfc274 /include/utils/BitSet.h
parentc40f4e64f267c78ff04862456092002d318a8adc (diff)
Added bitwise-or and bitwise-and to BitSet
Change-Id: I9bbf41f9d2d4a2593b0e6d7d8be7e283f985bade
Diffstat (limited to 'include/utils/BitSet.h')
-rw-r--r--include/utils/BitSet.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/utils/BitSet.h b/include/utils/BitSet.h
index e189d0c73d..19c03d1204 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)