62 template<
typename BITS_ENUM,
typename UNDERLYING =
unsigned long>
76 explicit Flags(value_type v) : _v(v) {}
103 Flags(BITS_ENUM e) : _v(((value_type)1) << e) {}
113 operator Private_bool * ()
const 114 {
return _v != 0 ? (Private_bool *)1 : 0; }
121 {
return type(lhs._v | rhs._v); }
125 {
return lhs |
type(rhs); }
129 {
return type(lhs._v & rhs._v); }
133 {
return lhs &
type(rhs); }
188 template<
typename A,
typename B>
194 template<
bool EXP,
typename T =
void>
struct Enable_if {};
195 template<
typename T>
struct Enable_if<true, T> {
typedef T
type; };
197 template<
typename T1,
typename T2,
typename T =
void>
198 struct Enable_if_same : Enable_if<Same<T1, T2>::value, T> {};
200 template<
typename T>
struct Remove_const {
typedef T
type; };
201 template<
typename T>
struct Remove_const<T const> {
typedef T
type; };
202 template<
typename T>
struct Remove_volatile {
typedef T
type; };
203 template<
typename T>
struct Remove_volatile<T volatile> {
typedef T
type; };
204 template<
typename T>
struct Remove_cv
205 {
typedef typename Remove_const<typename Remove_volatile<T>::type>
::type type; };
207 template<
typename T>
struct Remove_pointer {
typedef T
type; };
208 template<
typename T>
struct Remove_pointer<T*> {
typedef T
type; };
209 template<
typename T>
struct Remove_reference {
typedef T
type; };
210 template<
typename T>
struct Remove_reference<T&> {
typedef T
type; };
211 template<
typename T>
struct Remove_pr {
typedef T
type; };
212 template<
typename T>
struct Remove_pr<T&> {
typedef T
type; };
213 template<
typename T>
struct Remove_pr<T*> {
typedef T
type; };
Compare two data types for equality.
value_type as_value() const
Get the underlying value.
Template for defining typical Flags bitmaps.
None_type
The none type to get an empty bitmap.
L4 low-level kernel interface.
Flags< BITS_ENUM, UNDERLYING > type
the Flags<> type itself
UNDERLYING value_type
type of the underlying value
Flags(BITS_ENUM e)
Make flags from bit name.
type & clear(bits_enum_type flag)
Clear the given flag.
friend type operator&(type lhs, type rhs)
Support & of two compatible Flags types.
Flags()
Make default Flags.
Bool< V > type
The meta type itself.
BITS_ENUM bits_enum_type
enum type defining a name for each bit
Use this to get an empty bitmap.
type operator~() const
Support ~ for Flags types.
Flags(None_type)
Make an empty bitmap.
type & operator&=(type rhs)
Support &= of two compatible Flags types.
static type from_raw(value_type v)
Make flags from a raw value of value_type.
friend type operator|(type lhs, type rhs)
Support | of two compatible Flags types.
bool operator!() const
Support for if (!flags) syntax (test for empty flags).
type & operator|=(type rhs)
Support |= of two compatible Flags types.