microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
microfmt::unwind_hint_registry_ref Class Reference

Type-erased, two-word handle to an unwind hint registry. More...

#include <unwind_hint.hpp>

Classes

struct  vtable
 Virtual table of registry operations. More...
 

Public Member Functions

constexpr unwind_hint_registry_ref () noexcept=default
 Constructs an empty (invalid) handle.
 
template<typename Tag , typename Context , typename Traits = unwind_hint_registry_traits<Tag>, std::enable_if_t< std::is_convertible_v< const Context *, const typename Traits::context_type * >, int > = 0>
constexpr unwind_hint_registry_ref (Tag, const Context &ctx RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS) noexcept
 Constructs a handle for a stateful registry tag.
 
template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
constexpr unwind_hint_registry_ref (Tag, Context &&)=delete
 
bool find_hint (uintptr_t pc, unwind_hint &out_hint) const noexcept
 Looks up the hint covering a PC.
 
constexpr operator bool () const noexcept
 Reports whether the handle is bound to a registry.
 

Static Public Member Functions

template<typename Tag , typename Context , typename Traits = unwind_hint_registry_traits<Tag>>
static constexpr unwind_hint_registry_ref make (const Context &ctx RELOCO_LIFETIMEBOUND) noexcept
 
template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
static unwind_hint_registry_ref make (Context &&)=delete
 

Detailed Description

Type-erased, two-word handle to an unwind hint registry.

Constructor & Destructor Documentation

◆ unwind_hint_registry_ref() [1/3]

constexpr microfmt::unwind_hint_registry_ref::unwind_hint_registry_ref ( )
constexprdefaultnoexcept

Constructs an empty (invalid) handle.

◆ unwind_hint_registry_ref() [2/3]

template<typename Tag , typename Context , typename Traits = unwind_hint_registry_traits<Tag>, std::enable_if_t< std::is_convertible_v< const Context *, const typename Traits::context_type * >, int > = 0>
constexpr microfmt::unwind_hint_registry_ref::unwind_hint_registry_ref ( Tag  ,
const Context &ctx RELOCO_LIFETIMEBOUND  RELOCO_LIFETIME_CAPTURE_BY_THIS 
)
inlineconstexprnoexcept

Constructs a handle for a stateful registry tag.

Template Parameters
TagRegistry tag type.
ContextConcrete context convertible to the trait context type.
Parameters
ctxContext object performing the lookup.

◆ unwind_hint_registry_ref() [3/3]

template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
constexpr microfmt::unwind_hint_registry_ref::unwind_hint_registry_ref ( Tag  ,
Context &&   
)
constexprdelete

Member Function Documentation

◆ find_hint()

bool microfmt::unwind_hint_registry_ref::find_hint ( uintptr_t  pc,
unwind_hint &  out_hint 
) const
inlinenoexcept

Looks up the hint covering a PC.

Parameters
pcPC being looked up.
out_hintReceives the matching hint.
Returns
true when a hint matched.

◆ make() [1/2]

template<typename Tag , typename Context , typename Traits = unwind_hint_registry_traits<Tag>>
static constexpr unwind_hint_registry_ref microfmt::unwind_hint_registry_ref::make ( const Context &ctx  RELOCO_LIFETIMEBOUND)
inlinestaticconstexprnoexcept

◆ make() [2/2]

template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0>
static unwind_hint_registry_ref microfmt::unwind_hint_registry_ref::make ( Context &&  )
staticdelete

◆ operator bool()

constexpr microfmt::unwind_hint_registry_ref::operator bool ( ) const
inlineexplicitconstexprnoexcept

Reports whether the handle is bound to a registry.

Returns
true when the handle is valid.

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