Page Speed Optimization Libraries  1.6.29.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
net_instaweb::EnumSet< EnumType, NumEnums > Class Template Reference

Represents a set of values -- implemented via a bitset. More...

#include "enum_set.h"

List of all members.

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.

Detailed Description

template<typename EnumType, size_t NumEnums>
class net_instaweb::EnumSet< EnumType, NumEnums >

Represents a set of values -- implemented via a bitset.


Member Function Documentation

template<typename EnumType, size_t NumEnums>
void net_instaweb::EnumSet< EnumType, NumEnums >::insert ( EnumType  value) [inline]

Inserts a value; no return value.

Todo:
TODO(jmarantz): change call-sites to Insert and remove this one.
template<typename EnumType, size_t NumEnums>
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().

template<typename EnumType, size_t NumEnums>
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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines