|
| constexpr | register_context_ref_with (State &state RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS, address_space_ref space, span< std::byte > scratch RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS, register_context_ref fallback={}) noexcept |
| |
| constexpr | register_context_ref_with (const State &state RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS, address_space_ref space, span< std::byte > scratch RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS, register_context_ref fallback={}) noexcept |
| |
| | register_context_ref_with (State &&, address_space_ref, span< std::byte >, register_context_ref={})=delete |
| |
| | register_context_ref_with (const State &&, address_space_ref, span< std::byte >, register_context_ref={})=delete |
| |
| constexpr register_context_ref | ref () &noexcept RELOCO_LIFETIMEBOUND |
| | Creates a type-erased reference borrowing this wrapper.
|
| |
| constexpr | operator register_context_ref () &noexcept RELOCO_LIFETIMEBOUND |
| |
| register_context_ref | ref () &&=delete |
| |
| | operator register_context_ref () &&=delete |
| |
template<typename State, typename... FieldTraits>
class microfmt::register_context_ref_with< State, FieldTraits >
Typed owner that exposes a C/C++ register structure as a register_context_ref.
Field traits are checked in declaration order. The first matching trait handles the register. Unmatched indexes are delegated to the optional fallback context, allowing mapped contexts to be chained.
A custom field trait must define:
state_type and trivially-copyable value_type;
static bool matches(uint32_t) noexcept;
- either
get functions returning pointers to stored values, or typed read and optional write functions;
- omit mutable
get or write to make the field read-only.
Callback fields receive the wrapper's address space and may query hardware instead of returning a value stored in the bound state.