Lines Matching refs:EnumSet

19 class EnumSet;
22 EnumSet<E, Min, Max> Union(EnumSet<E, Min, Max> set1,
23 EnumSet<E, Min, Max> set2);
26 EnumSet<E, Min, Max> Intersection(EnumSet<E, Min, Max> set1,
27 EnumSet<E, Min, Max> set2);
30 EnumSet<E, Min, Max> Difference(EnumSet<E, Min, Max> set1,
31 EnumSet<E, Min, Max> set2);
33 // An EnumSet is a set that can hold enum values between a min and a
39 // (say, fewer than 64), you can efficiently pass around an EnumSet
43 class EnumSet {
57 // Iterator is a forward-only read-only iterator for EnumSet. Its
63 // for (EnumSet<...>::Iterator it = enums.First(); it.Good(); it.Inc()) {
70 // EnumSet<...> SomeFn() { ... }
73 // for (EnumSet<...>::Iterator it = SomeFun().First(); ...
76 // modify an EnumSet while traversing it with an iterator.
80 // Good(). You need to call First() on an EnumSet to get a usable
87 // Returns true iff the iterator points to an EnumSet and it
88 // hasn't yet traversed the EnumSet entirely.
100 // Moves the iterator to the next value in the EnumSet. Good()
108 friend Iterator EnumSet::First() const;
124 // You can construct an EnumSet with 0, 1, 2, or 3 initial values.
126 EnumSet() {}
128 explicit EnumSet(E value) {
132 EnumSet(E value1, E value2) {
137 EnumSet(E value1, E value2, E value3) {
143 // Returns an EnumSet with all possible values.
144 static EnumSet All() {
147 return EnumSet(enums);
150 ~EnumSet() {}
164 void PutAll(EnumSet other) {
171 void RetainAll(EnumSet other) {
183 void RemoveAll(EnumSet other) {
199 bool HasAll(EnumSet other) const {
205 bool Equals(const EnumSet& other) const {
225 friend EnumSet Union<E, MinEnumValue, MaxEnumValue>(
226 EnumSet set1, EnumSet set2);
227 friend EnumSet Intersection<E, MinEnumValue, MaxEnumValue>(
228 EnumSet set1, EnumSet set2);
229 friend EnumSet Difference<E, MinEnumValue, MaxEnumValue>(
230 EnumSet set1, EnumSet set2);
232 explicit EnumSet(EnumBitSet enums) : enums_(enums) {}
255 const E EnumSet<E, MinEnumValue, MaxEnumValue>::kMinValue;
258 const E EnumSet<E, MinEnumValue, MaxEnumValue>::kMaxValue;
261 const size_t EnumSet<E, MinEnumValue, MaxEnumValue>::kValueCount;
266 EnumSet<E, Min, Max> Union(EnumSet<E, Min, Max> set1,
267 EnumSet<E, Min, Max> set2) {
268 return EnumSet<E, Min, Max>(set1.enums_ | set2.enums_);
272 EnumSet<E, Min, Max> Intersection(EnumSet<E, Min, Max> set1,
273 EnumSet<E, Min, Max> set2) {
274 return EnumSet<E, Min, Max>(set1.enums_ & set2.enums_);
278 EnumSet<E, Min, Max> Difference(EnumSet<E, Min, Max> set1,
279 EnumSet<E, Min, Max> set2) {
280 return EnumSet<E, Min, Max>(set1.enums_ & ~set2.enums_);