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

Fixed-capacity, zero-allocation registry of ELF images. More...

#include <elf_enumerator.hpp>

Public Member Functions

constexpr multi_elf_registry_context () noexcept=default
 Constructs an empty registry.
 
constexpr bool register_image (const elf_image_info &info) noexcept
 Registers an image, failing when the table is full.
 
constexpr bool enumerate (span< elf_image_info > out_buffer, size_t &out_count) const noexcept
 Copies registered images into a caller buffer.
 
constexpr bool find_by_pc (uintptr_t pc, elf_image_info &out_info) const noexcept
 Locates the registered image containing pc.
 
constexpr size_t size () const noexcept
 Returns the number of registered images.
 

Detailed Description

template<size_t MaxImages>
class microfmt::multi_elf_registry_context< MaxImages >

Fixed-capacity, zero-allocation registry of ELF images.

Template Parameters
MaxImagesMaximum number of registered images.

Constructor & Destructor Documentation

◆ multi_elf_registry_context()

template<size_t MaxImages>
constexpr microfmt::multi_elf_registry_context< MaxImages >::multi_elf_registry_context ( )
constexprdefaultnoexcept

Constructs an empty registry.

Member Function Documentation

◆ enumerate()

template<size_t MaxImages>
constexpr bool microfmt::multi_elf_registry_context< MaxImages >::enumerate ( span< elf_image_info >  out_buffer,
size_t &  out_count 
) const
inlineconstexprnoexcept

Copies registered images into a caller buffer.

Parameters
out_bufferDestination buffer.
out_countReceives the number of images stored.
Returns
Always true.

◆ find_by_pc()

template<size_t MaxImages>
constexpr bool microfmt::multi_elf_registry_context< MaxImages >::find_by_pc ( uintptr_t  pc,
elf_image_info &  out_info 
) const
inlineconstexprnoexcept

Locates the registered image containing pc.

Parameters
pcCode address to look up.
out_infoReceives the owning image record.
Returns
true when an owning image was found.

◆ register_image()

template<size_t MaxImages>
constexpr bool microfmt::multi_elf_registry_context< MaxImages >::register_image ( const elf_image_info &  info)
inlineconstexprnoexcept

Registers an image, failing when the table is full.

Parameters
infoImage record to append.
Returns
true on success, false when at capacity.

◆ size()

template<size_t MaxImages>
constexpr size_t microfmt::multi_elf_registry_context< MaxImages >::size ( ) const
inlineconstexprnoexcept

Returns the number of registered images.

Returns
Current image count.

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