microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
microfmt::register_context_ref_with< State, FieldTraits > Class Template Reference

Typed owner that exposes a C/C++ register structure as a register_context_ref. More...

#include <register_context.hpp>

Public Member Functions

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
 

Friends

struct register_context_traits< detail::mapped_register_context_tag< State, FieldTraits... > >
 

Detailed Description

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:

Callback fields receive the wrapper's address space and may query hardware instead of returning a value stored in the bound state.

Constructor & Destructor Documentation

◆ register_context_ref_with() [1/4]

template<typename State , typename... FieldTraits>
constexpr microfmt::register_context_ref_with< State, FieldTraits >::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 = {} 
)
inlineconstexprnoexcept

◆ register_context_ref_with() [2/4]

template<typename State , typename... FieldTraits>
constexpr microfmt::register_context_ref_with< State, FieldTraits >::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 = {} 
)
inlineconstexprnoexcept

◆ register_context_ref_with() [3/4]

template<typename State , typename... FieldTraits>
microfmt::register_context_ref_with< State, FieldTraits >::register_context_ref_with ( State &&  ,
address_space_ref  ,
span< std::byte >  ,
register_context_ref  = {} 
)
delete

◆ register_context_ref_with() [4/4]

template<typename State , typename... FieldTraits>
microfmt::register_context_ref_with< State, FieldTraits >::register_context_ref_with ( const State &&  ,
address_space_ref  ,
span< std::byte >  ,
register_context_ref  = {} 
)
delete

Member Function Documentation

◆ operator register_context_ref() [1/2]

template<typename State , typename... FieldTraits>
microfmt::register_context_ref_with< State, FieldTraits >::operator register_context_ref ( ) &&
delete

◆ operator register_context_ref() [2/2]

template<typename State , typename... FieldTraits>
constexpr microfmt::register_context_ref_with< State, FieldTraits >::operator register_context_ref ( ) &
inlineexplicitconstexprnoexcept

◆ ref() [1/2]

template<typename State , typename... FieldTraits>
register_context_ref microfmt::register_context_ref_with< State, FieldTraits >::ref ( ) &&
delete

◆ ref() [2/2]

template<typename State , typename... FieldTraits>
constexpr register_context_ref microfmt::register_context_ref_with< State, FieldTraits >::ref ( ) &
inlineconstexprnoexcept

Creates a type-erased reference borrowing this wrapper.

This wrapper, its state, scratch storage, address-space context, and any fallback context must outlive the returned reference.

Friends And Related Symbol Documentation

◆ register_context_traits< detail::mapped_register_context_tag< State, FieldTraits... > >

template<typename State , typename... FieldTraits>
friend struct register_context_traits< detail::mapped_register_context_tag< State, FieldTraits... > >
friend

The documentation for this class was generated from the following file: