Wt
3.3.8
|
Utility class for type-safe combinations of enumeration flags. More...
#include <Wt/WFlags>
Public Member Functions | |
WFlags (Zero zero=0) | |
Default constructor. | |
WFlags (EnumType flag) | |
Construct from a single enum value. | |
WFlags (const WFlags< EnumType > &other) | |
Copy constructor. | |
WFlags< EnumType > & | operator= (const WFlags< EnumType > &other) |
Assignment operator. | |
WFlags< EnumType > & | operator= (const EnumType other) |
Assignment operator. | |
bool | testFlag (EnumType flag) const |
Returns whether a flag is set. | |
WFlags< EnumType > & | clear (EnumType value) |
Clears a flag. | |
operator EnumType () const | |
Cast to the enum type. More... | |
bool | operator! () const |
Negation operator. More... | |
WFlags< EnumType > | operator& (EnumType mask) const |
Bitwise AND operator. More... | |
WFlags< EnumType > | operator& (MaskType mask) const |
Bitwise AND operator. More... | |
WFlags< EnumType > & | operator&= (EnumType mask) |
Modifying bitwise AND operator. More... | |
WFlags< EnumType > & | operator&= (MaskType mask) |
Modifying bitwise AND operator. More... | |
WFlags< EnumType > | operator^ (WFlags< EnumType > other) const |
Bitwise XOR operator. More... | |
WFlags< EnumType > | operator^ (EnumType other) const |
Bitwise XOR operator. More... | |
WFlags< EnumType > & | operator^= (WFlags< EnumType > other) |
Modifying bitwise XOR operator. More... | |
WFlags< EnumType > & | operator^= (EnumType other) |
Modifying bitwise XOR operator. More... | |
WFlags< EnumType > | operator| (WFlags< EnumType > other) const |
Bitwise OR operator. More... | |
WFlags< EnumType > | operator| (EnumType other) const |
Bitwise OR operator. More... | |
WFlags< EnumType > & | operator|= (WFlags< EnumType > other) |
Modifying bitwise OR operator. More... | |
WFlags< EnumType > & | operator|= (EnumType other) |
Modifying bitwise OR operator. More... | |
WFlags< EnumType > | operator~ () const |
Inversion operator. More... | |
Utility class for type-safe combinations of enumeration flags.
This type is used in Wt API whenever one or more flag options are expected, instead of an int
. The class provides type safety, in the sense that it checks that the correct combination of enum values is bound to the argument, and does not cost any run-time overhead (internally it uses only an int
to represent the combination of flags.
Wt::WFlags< EnumType >::operator EnumType | ( | ) | const |
Cast to the enum type.
The internal int
representation is simply cast to the enum type, without any additional checks.
bool Wt::WFlags< EnumType >::operator! | ( | ) | const |
Negation operator.
Returns whether different from 0.
WFlags< EnumType > Wt::WFlags< EnumType >::operator& | ( | EnumType | mask | ) | const |
Bitwise AND operator.
Returns flags that are the bitwise AND of this and mask
.
WFlags< EnumType > Wt::WFlags< EnumType >::operator& | ( | MaskType | mask | ) | const |
Bitwise AND operator.
Returns flags that are the bitwise AND of this and mask
.
WFlags< EnumType > & Wt::WFlags< EnumType >::operator&= | ( | EnumType | mask | ) |
Modifying bitwise AND operator.
Sets as value the bitwise AND of this and mask
.
WFlags< EnumType > & Wt::WFlags< EnumType >::operator&= | ( | MaskType | mask | ) |
Modifying bitwise AND operator.
Sets as value the bitwise AND of this and mask
.
WFlags< EnumType > Wt::WFlags< EnumType >::operator^ | ( | WFlags< EnumType > | other | ) | const |
Bitwise XOR operator.
Returns flags that are the bitwise XOR of this and other
.
WFlags< EnumType > Wt::WFlags< EnumType >::operator^ | ( | EnumType | other | ) | const |
Bitwise XOR operator.
Returns flags that are the bitwise XOR of this and other
.
WFlags< EnumType > & Wt::WFlags< EnumType >::operator^= | ( | WFlags< EnumType > | other | ) |
Modifying bitwise XOR operator.
Sets as value the bitwise XOR of this and other
.
WFlags< EnumType > & Wt::WFlags< EnumType >::operator^= | ( | EnumType | other | ) |
Modifying bitwise XOR operator.
Sets as value the bitwise XOR of this and other
.
WFlags< EnumType > Wt::WFlags< EnumType >::operator| | ( | WFlags< EnumType > | other | ) | const |
Bitwise OR operator.
Returns flags that are the bitwise OR of this and other
.
WFlags< EnumType > Wt::WFlags< EnumType >::operator| | ( | EnumType | other | ) | const |
Bitwise OR operator.
Returns flags that are the bitwise OR of this and other
.
WFlags< EnumType > & Wt::WFlags< EnumType >::operator|= | ( | WFlags< EnumType > | other | ) |
Modifying bitwise OR operator.
Sets as value the bitwise OR of this and other
.
WFlags< EnumType > & Wt::WFlags< EnumType >::operator|= | ( | EnumType | other | ) |
Modifying bitwise OR operator.
Sets as value the bitwise OR of this and other
.
WFlags< EnumType > Wt::WFlags< EnumType >::operator~ | ( | ) | const |
Inversion operator.
Returns flags that are the inverted of this.