This class implements type-safe flags. More...
#include <Radiant/Flags.hpp>
Public Types | |
| typedef S | Int |
| Internal type used to store the flags. | |
Public Member Functions | |
| S | asInt () const |
| Convert the flags to integer. More... | |
| void | clear () |
| Clear all flags to zero. | |
| FlagsT () | |
| Construct empty flags object. | |
| FlagsT (T t) | |
| Construct flags. More... | |
| FlagsT (const FlagsT &f) | |
| Construct a copy. More... | |
| bool | operator! () const |
| Check if no flags are raised. More... | |
| bool | operator!= (const FlagsT &b) const |
| Compare if two flags are inequal. More... | |
| FlagsT | operator& (const FlagsT &b) const |
| Do a bit-wise AND of flags. More... | |
| FlagsT & | operator&= (const FlagsT &b) |
| Do a bit-wise AND of flags and assign the result to this. More... | |
| bool | operator< (const FlagsT< T > &t) const |
| FlagsT & | operator= (const FlagsT &b) |
| Copy flags. More... | |
| bool | operator== (const FlagsT &b) const |
| Compare if two flags are equal. More... | |
| FlagsT | operator^ (const FlagsT &b) const |
| Do a bit-wise XOR of flags. More... | |
| FlagsT & | operator^= (const FlagsT &b) |
| Do a bit-wise XOR of flags and assign the result to this. More... | |
| FlagsT | operator| (const FlagsT &b) const |
| Do a bit-wise OR of flags. More... | |
| FlagsT & | operator|= (const FlagsT &b) |
| Do a bit-wise OR of flags and assign the result to this. More... | |
| FlagsT | operator~ () const |
| Flip all the flags. More... | |
Static Public Member Functions | |
| static FlagsT< T > | fromInt (Int i) |
| Converts int to Flags. More... | |
This class implements type-safe flags.
| T | Type of the flag type (enum) |
| S | Internal type for storing the flags |
|
inline |
Construct flags.
| t | initial values |
|
inline |
Construct a copy.
| f | flags to copy |
|
inline |
Convert the flags to integer.
|
inlinestatic |
Converts int to Flags.
If you end up using this function, you better have a real good reason to do so.
| i | integers to convert from |
|
inline |
Check if no flags are raised.
|
inline |
Compare if two flags are inequal.
| b | flags to compare |
|
inline |
Do a bit-wise AND of flags.
| b | flags to AND |
|
inline |
Do a bit-wise AND of flags and assign the result to this.
| b | flags to AND |
|
inline |
Copy flags.
| b | flags to copy |
|
inline |
Compare if two flags are equal.
| b | flags to compare |
|
inline |
Do a bit-wise XOR of flags.
| b | flags to XOR |
|
inline |
Do a bit-wise XOR of flags and assign the result to this.
| b | flags to XOR |
|
inline |
Do a bit-wise OR of flags.
| b | flags to AND |
|
inline |
Do a bit-wise OR of flags and assign the result to this.
| b | flags to OR |
|
inline |
Flip all the flags.