OpenMS
2.8.0
|
Stores and handles combinations of enum values, e.g. a set of flags as bits flipped in an UInt64. More...
#include <OpenMS/DATASTRUCTURES/FlagSet.h>
Public Member Functions | |
FlagSet () | |
Constructors. More... | |
FlagSet (const ENUM &en) | |
C'tor from Enum. More... | |
FlagSet (const FlagSet &stat)=default | |
FlagSet & | operator= (const FlagSet &stat)=default |
Assignment. More... | |
FlagSet & | operator= (const ENUM &en)=delete |
no Assignment from Enum (would allow implicit conversion) More... | |
~FlagSet ()=default | |
Destructor (default) More... | |
bool | operator== (const FlagSet &stat) const |
Equality. More... | |
FlagSet | operator& (const ENUM &en) const |
bitwise AND More... | |
FlagSet | operator& (const FlagSet &rhs) const |
bitwise AND More... | |
FlagSet & | operator&= (const ENUM &en) |
bitwise AND= More... | |
FlagSet & | operator&= (const FlagSet &rhs) |
bitwise AND= More... | |
FlagSet | operator| (const ENUM &en) const |
bitwise OR More... | |
FlagSet | operator| (const FlagSet &rhs) const |
bitwise OR More... | |
FlagSet & | operator|= (const ENUM &en) |
bitwise OR= More... | |
FlagSet & | operator|= (const FlagSet &rhs) |
bitwise OR= More... | |
FlagSet | operator+ (const ENUM &en) const |
bitwise OR (same as |) More... | |
FlagSet | operator+ (const FlagSet &en) const |
bitwise OR (same as |) More... | |
FlagSet & | operator+= (const ENUM &rhs) |
bitwise OR= (same as |=) More... | |
FlagSet & | operator+= (const FlagSet &rhs) |
bitwise OR= (same as |=) More... | |
FlagSet | operator- (const FlagSet &rhs) |
remove all flags set in rhs from this More... | |
FlagSet & | operator-= (const FlagSet &rhs) |
remove all flags set in rhs from this More... | |
FlagSet | operator- (const ENUM &rhs) |
remove flag in rhs from this More... | |
FlagSet & | operator-= (const ENUM &rhs) |
remove flag in rhs from this More... | |
bool | isSuperSetOf (const FlagSet &required) const |
Check if this FlagSet has at least the active bits of another required FlagSet. More... | |
bool | isSuperSetOf (const ENUM &required) const |
Check if this FlagSet has the bit for required . More... | |
bool | empty () const |
checks if any bit is set More... | |
UInt64 | value () const |
internal representation (mostly for illustrative purposes) More... | |
Private Member Functions | |
UInt64 | getPow_ (const ENUM &en) const |
computes pow(2, r) More... | |
Private Attributes | |
UInt64 | value_ |
Stores and handles combinations of enum values, e.g. a set of flags as bits flipped in an UInt64.
Conversion from the enum is computed as `pow(2, r)`. Thus make sure that 0 <= 'r' <=63 for all enum values. Multiple enum values can be computed by bitwise 'or' (operator|=)
This class allows assignment and bit operations with itself and an object of type ENUM, i.e. not with any numeric types.
|
inline |
Constructors.
Referenced by FlagSet< ENUM >::operator-=().
|
inlineexplicit |
C'tor from Enum.
|
default |
Destructor (default)
|
inline |
checks if any bit is set
References FlagSet< ENUM >::value_.
|
inlineprivate |
computes pow(2, r)
References OPENMS_PRECONDITION.
Referenced by FlagSet< ENUM >::operator&=(), FlagSet< ENUM >::operator|(), and FlagSet< ENUM >::operator|=().
|
inline |
Check if this FlagSet has the bit for required
.
|
inline |
|
inline |
bitwise AND
|
inline |
bitwise AND=
References FlagSet< ENUM >::getPow_(), and FlagSet< ENUM >::value_.
bitwise AND=
References FlagSet< ENUM >::value_.
|
inline |
bitwise OR (same as |)
|
inline |
bitwise OR= (same as |=)
|
inline |
remove flag in rhs
from this
|
inline |
remove flag in rhs
from this
References FlagSet< ENUM >::FlagSet(), and FlagSet< ENUM >::value_.
remove all flags set in rhs
from this
References FlagSet< ENUM >::value_.
|
delete |
no Assignment from Enum (would allow implicit conversion)
|
inline |
Equality.
References FlagSet< ENUM >::value_.
|
inline |
bitwise OR
References FlagSet< ENUM >::getPow_(), and FlagSet< ENUM >::value_.
bitwise OR
References FlagSet< ENUM >::value_.
|
inline |
bitwise OR=
References FlagSet< ENUM >::getPow_(), and FlagSet< ENUM >::value_.
bitwise OR=
References FlagSet< ENUM >::value_.
|
inline |
internal representation (mostly for illustrative purposes)
References FlagSet< ENUM >::value_.