CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
Derived bitpack definition macros
Collaboration diagram for Derived bitpack definition macros:

Macros

#define BITPACK_DERIVED_PREFIX
 Capture the incantations often at the top of a BitpackDerived structure.
#define BITPACK_DERIVED_FIELD_INFO_FOR_TYPE(Type, lambda)
 Modify the field information for a type in a derived bitpack.
#define BITPACK_DERIVED_FIELD_CONST_FOR_TYPE(Type, c)
 Modify the constness field information for a type in a derived bitpack.

Detailed Description

Macro Definition Documentation

◆ BITPACK_DERIVED_FIELD_CONST_FOR_TYPE

#define BITPACK_DERIVED_FIELD_CONST_FOR_TYPE ( Type,
c )
Value:
BITPACK_DERIVED_FIELD_INFO_FOR_TYPE(Type, [](auto &fi) { fi.isConst = c; })
#define BITPACK_DERIVED_FIELD_INFO_FOR_TYPE(Type, lambda)
Modify the field information for a type in a derived bitpack.
Definition bitpack.hh:1086

Modify the constness field information for a type in a derived bitpack.

This is a thin wrapper around BITPACK_DERIVED_FIELD_INFO_FOR_TYPE.

Definition at line 1101 of file bitpack.hh.

◆ BITPACK_DERIVED_FIELD_INFO_FOR_TYPE

#define BITPACK_DERIVED_FIELD_INFO_FOR_TYPE ( Type,
lambda )
Value:
template<> \
constexpr FieldInfo field_info_for_type<Type>() \
{ \
static_assert( \
std::is_invocable_r_v<void, decltype(lambda), FieldInfo &>); \
auto fi = ParentBitpack::field_info_for_type<Type>(); \
lambda(fi); \
return fi; \
}

Modify the field information for a type in a derived bitpack.

Definition at line 1086 of file bitpack.hh.

◆ BITPACK_DERIVED_PREFIX

#define BITPACK_DERIVED_PREFIX
Value:
using BitpackDerived<ParentBitpack>::BitpackDerived; \
using BitpackDerived<ParentBitpack>::operator=; \
/* Inherit field info for most types from parent bitpack */ \
template<typename FieldType> \
static constexpr FieldInfo field_info_for_type() \
{ \
return ParentBitpack::field_info_for_type<FieldType>(); \
}
It is occasionally useful to derive one bitpack from another.
Definition bitpack.hh:913

Capture the incantations often at the top of a BitpackDerived structure.

especially one with type-directed field proxys.

Definition at line 1075 of file bitpack.hh.