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

Formattable view over a shared pointer and its remote control block. More...

#include <remote_smart_ptr.hpp>

Public Member Functions

constexpr remote_shared_ptr_view (uintptr_t shared_ptr_addr, address_space_ref space, span< std::byte > scratch RELOCO_LIFETIMEBOUND, ptrdiff_t ptr_offset, ptrdiff_t control_block_offset, ptrdiff_t use_count_offset, ptrdiff_t weak_count_offset) noexcept
 Constructs a view over a remote shared-pointer object.
 
bool format (const sink &out) const noexcept
 Loads and renders the pointee and reference counts.
 

Detailed Description

template<typename T, typename RemotePtr = uintptr_t, typename RemoteRefCount = int32_t>
class microfmt::remote_shared_ptr_view< T, RemotePtr, RemoteRefCount >

Formattable view over a shared pointer and its remote control block.

Template Parameters
TPointee type.
RemotePtrPointer representation in the target process.
RemoteRefCountReference-count representation in the target process.

Constructor & Destructor Documentation

◆ remote_shared_ptr_view()

template<typename T , typename RemotePtr = uintptr_t, typename RemoteRefCount = int32_t>
constexpr microfmt::remote_shared_ptr_view< T, RemotePtr, RemoteRefCount >::remote_shared_ptr_view ( uintptr_t  shared_ptr_addr,
address_space_ref  space,
span< std::byte > scratch  RELOCO_LIFETIMEBOUND,
ptrdiff_t  ptr_offset,
ptrdiff_t  control_block_offset,
ptrdiff_t  use_count_offset,
ptrdiff_t  weak_count_offset 
)
inlineconstexprnoexcept

Constructs a view over a remote shared-pointer object.

Parameters
shared_ptr_addrAddress of the remote shared-pointer object.
spaceAddress space containing the pointer, pointee, and control block.
scratchStorage used to load the pointee.
ptr_offsetOffset to the stored pointee pointer.
control_block_offsetOffset to the control-block pointer.
use_count_offsetOffset in the control block to the strong count.
weak_count_offsetOffset in the control block to the weak count.

Member Function Documentation

◆ format()

template<typename T , typename RemotePtr = uintptr_t, typename RemoteRefCount = int32_t>
bool microfmt::remote_shared_ptr_view< T, RemotePtr, RemoteRefCount >::format ( const sink &  out) const
inlinenoexcept

Loads and renders the pointee and reference counts.

Parameters
outDestination sink.
Returns
true on success; false when required pointer reads fail.

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