Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
net_instaweb::EnumSet< EnumType, NumEnums > Class Template Reference

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)
 Merges src into this, returning whether this resulted in a change. More...
 
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

Merges 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: