Page Speed Optimization Libraries
1.5.27.2
|
Represents a set of values -- implemented via a bitset. More...
#include "enum_set.h"
Public Member Functions | |
bool | IsSet (EnumType value) const |
bool | Insert (EnumType value) |
Inserts a new value, returning true if a change was made. | |
void | insert (EnumType value) |
bool | Erase (EnumType value) |
Returns true if a change was made. | |
bool | Merge (const EnumSet &src) |
Mergess src into this, returning whether this resulted in a change. | |
bool | MergeInverted (const EnumSet &src) |
void | EraseSet (const EnumSet &src) |
void | SetAll () |
Sets all the entries to true. | |
void | clear () |
Standard STL-like methods. | |
size_t | size () const |
bool | empty () const |
bool | operator== (const EnumSet &that) const |
This overload is required for use in EXPECT_EQ in tests. |
Represents a set of values -- implemented via a bitset.
void net_instaweb::EnumSet< EnumType, NumEnums >::insert | ( | EnumType | value | ) | [inline] |
Inserts a value; no return value.
bool net_instaweb::EnumSet< EnumType, NumEnums >::Merge | ( | const EnumSet< EnumType, NumEnums > & | src | ) | [inline] |
Mergess src into this, returning whether this resulted in a change.
We save the current version of the set in order to see whether the merge resulted in a change. Note that copying and comparing the bits is very cheap; probably cheaper than calling count().
bool net_instaweb::EnumSet< EnumType, NumEnums >::MergeInverted | ( | const EnumSet< EnumType, NumEnums > & | src | ) | [inline] |
Merges the entries *not* set in src into this, returning whether this resulted in a change.