Wt
4.11.1
|
Utility class for type-safe combinations of enumeration flags. More...
#include <Wt/WFlags.h>
Public Member Functions | |
WFlags (NoFlagsType none=None) | |
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 | test (EnumType flag) const |
Returns whether a flag is set. | |
bool | empty () const |
Returns true if this WFlags contains no flags. | |
WFlags< EnumType > & | clear (EnumType value) |
Clears a flag. | |
operator EnumType () const | |
Cast to the enum type. | |
bool | operator! () const |
Negation operator. | |
WFlags< EnumType > | operator& (EnumType mask) const |
Bitwise AND operator. | |
WFlags< EnumType > | operator& (MaskType mask) const |
Bitwise AND operator. | |
WFlags< EnumType > & | operator&= (EnumType mask) |
Modifying bitwise AND operator. | |
WFlags< EnumType > & | operator&= (MaskType mask) |
Modifying bitwise AND operator. | |
WFlags< EnumType > | operator^ (WFlags< EnumType > other) const |
Bitwise XOR operator. | |
WFlags< EnumType > | operator^ (EnumType other) const |
Bitwise XOR operator. | |
WFlags< EnumType > & | operator^= (WFlags< EnumType > other) |
Modifying bitwise XOR operator. | |
WFlags< EnumType > & | operator^= (EnumType other) |
Modifying bitwise XOR operator. | |
WFlags< EnumType > | operator| (WFlags< EnumType > other) const |
Bitwise OR operator. | |
WFlags< EnumType > | operator| (EnumType other) const |
Bitwise OR operator. | |
WFlags< EnumType > & | operator|= (WFlags< EnumType > other) |
Modifying bitwise OR operator. | |
WFlags< EnumType > & | operator|= (EnumType other) |
Modifying bitwise OR operator. | |
WFlags< EnumType > | operator~ () const |
Inversion operator. |
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^ | ( | 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 | ) | const |
Bitwise XOR operator.
Returns flags that are 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 | ) |
Modifying bitwise XOR operator.
Sets as value the bitwise XOR 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 | ) | const |
Bitwise OR operator.
Returns flags that are 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|= | ( | WFlags< 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.