CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
"using enum" proxy operator macros
Collaboration diagram for "using enum" proxy operator macros:

Macros

#define BITPACK_OPERATE_ENUM(proxy, operator, value)
 Convenience for scoped enum fields, bringing the enumerators of the field type into scope while evaluating the value.
#define BITPACK_OPERATE_ENUM_DECLTYPE(b, T, operator, v)
 A fusion of BITPACK_MEMBER_DECLTYPE and BITPACK_OPERATE_ENUM.
#define BITPACK_OPERATE_ENUM_TYPE(b, T, operator, v)
 A fusion of .member<>() and BITPACK_OPERATE_ENUM.
#define BITPACK_WITH_ENUM(proxy, value)
 A specialization of BITPACK_OPERATE_ENUM using .with as the operator.
#define BITPACK_WITH_ENUM_DECLTYPE(b, T, v)
 A specialization of BITPACK_OPERATE_ENUM_DECLTYPE using .with as the operator.
#define BITPACK_WITH_ENUM_TYPE(b, T, v)
 A specialization of BITPACK_OPERATE_ENUM_TYPE using .with as the operator.

Detailed Description

Macro Definition Documentation

◆ BITPACK_OPERATE_ENUM

#define BITPACK_OPERATE_ENUM ( proxy,
operator,
value )
Value:
({ \
using E = decltype(proxy)::Field::Type; \
static_assert(std::is_enum_v<E>); \
using enum E; \
(proxy) operator(value); \
})

Convenience for scoped enum fields, bringing the enumerators of the field type into scope while evaluating the value.

Note that this uses using enum internally, and so cannot work with Proxy-s whose Field::Type-s are dependent. Alas, this precludes the existence of a BITPACK_*_ENUM_DEPENDENT family of helpers.

Probably prefer BITPACK_OPERATE_QUALIFY if you do not need repeated use of the enumeration's values within the passed value.

Definition at line 1285 of file bitpack.hh.

◆ BITPACK_OPERATE_ENUM_DECLTYPE

#define BITPACK_OPERATE_ENUM_DECLTYPE ( b,
T,
operator,
v )
Value:
#define BITPACK_MEMBER_DECLTYPE(b, T)
A convenience macro that presumes the type T is defined within the Bitpack b and finds such a field's...
Definition bitpack.hh:1053
#define BITPACK_OPERATE_ENUM(proxy, operator,value)
Convenience for scoped enum fields, bringing the enumerators of the field type into scope while evalu...
Definition bitpack.hh:1285

A fusion of BITPACK_MEMBER_DECLTYPE and BITPACK_OPERATE_ENUM.

Definition at line 1294 of file bitpack.hh.

◆ BITPACK_OPERATE_ENUM_TYPE

#define BITPACK_OPERATE_ENUM_TYPE ( b,
T,
operator,
v )
Value:
BITPACK_OPERATE_ENUM((b).template member<T>(), operator, v)

A fusion of .member<>() and BITPACK_OPERATE_ENUM.

Definition at line 1298 of file bitpack.hh.

◆ BITPACK_WITH_ENUM

#define BITPACK_WITH_ENUM ( proxy,
value )
Value:
BITPACK_OPERATE_ENUM(proxy, .with, value)

A specialization of BITPACK_OPERATE_ENUM using .with as the operator.

Definition at line 1302 of file bitpack.hh.

◆ BITPACK_WITH_ENUM_DECLTYPE

#define BITPACK_WITH_ENUM_DECLTYPE ( b,
T,
v )
Value:
#define BITPACK_OPERATE_ENUM_DECLTYPE(b, T, operator,v)
A fusion of BITPACK_MEMBER_DECLTYPE and BITPACK_OPERATE_ENUM.
Definition bitpack.hh:1294

A specialization of BITPACK_OPERATE_ENUM_DECLTYPE using .with as the operator.

Definition at line 1309 of file bitpack.hh.

◆ BITPACK_WITH_ENUM_TYPE

#define BITPACK_WITH_ENUM_TYPE ( b,
T,
v )
Value:
#define BITPACK_OPERATE_ENUM_TYPE(b, T, operator,v)
A fusion of .member<>() and BITPACK_OPERATE_ENUM.
Definition bitpack.hh:1298

A specialization of BITPACK_OPERATE_ENUM_TYPE using .with as the operator.

Definition at line 1313 of file bitpack.hh.