|
| constexpr | address_space_ref () noexcept=default |
| | Constructs an empty (invalid) handle.
|
| |
| template<typename Tag , typename Traits = address_space_traits<Tag>, std::enable_if_t< std::is_void_v< typename Traits::context_type >, int > = 0> |
| constexpr | address_space_ref (Tag) noexcept |
| | Constructs a handle for a stateless address-space tag.
|
| |
| template<typename Tag , typename Context , typename Traits = address_space_traits<Tag>, std::enable_if_t<!std::is_void_v< typename Traits::context_type > &&std::is_convertible_v< const Context *, const typename Traits::context_type * >, int > = 0> |
| constexpr | address_space_ref (Tag, const Context &ctx RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS) noexcept |
| | Constructs a handle for a stateful address-space tag.
|
| |
| template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0> |
| constexpr | address_space_ref (Tag, Context &&)=delete |
| |
| expected< void, address_space_error > | read_bytes (uintptr_t addr, void *dest, size_t size) const noexcept |
| | Reads raw bytes from the remote address space.
|
| |
| template<typename T > |
| expected< void, address_space_error > | read (uintptr_t addr, T &out_obj) const noexcept |
| | Reads a trivially-copyable object from the remote address space.
|
| |
| template<typename T > |
| expected< T, address_space_error > | read (uintptr_t addr) const noexcept |
| | Reads and returns a trivially-copyable object.
|
| |
| expected< void, address_space_error > | write_bytes (uintptr_t addr, const void *src, size_t size) const noexcept |
| | Writes raw bytes into the remote address space.
|
| |
| template<typename T > |
| expected< void, address_space_error > | write (uintptr_t addr, const T &object) const noexcept |
| | Writes a trivially-copyable object into the remote address space.
|
| |
| expected< string_chunk, address_space_error > | read_string_chunk (uintptr_t addr, span< char > buffer) const noexcept |
| | Reads a bounded chunk of a remote NUL-terminated string.
|
| |
| constexpr | operator bool () const noexcept |
| | Reports whether the handle is bound to an address space.
|
| |
| constexpr bool | can_write () const noexcept |
| | Reports whether the bound backend provides write access.
|
| |
|
| template<typename Tag , typename Traits = address_space_traits<Tag>, std::enable_if_t< std::is_void_v< typename Traits::context_type >, int > = 0> |
| static constexpr address_space_ref | make () noexcept |
| | Creates a handle for a stateless address-space tag.
|
| |
| template<typename Tag , typename Context , typename Traits = address_space_traits<Tag>, std::enable_if_t<!std::is_void_v< typename Traits::context_type >, int > = 0> |
| static constexpr address_space_ref | make (const Context &ctx RELOCO_LIFETIMEBOUND) noexcept |
| | Creates a handle for a stateful address-space tag.
|
| |
| template<typename Tag , typename Context , std::enable_if_t<!std::is_lvalue_reference_v< Context >, int > = 0> |
| static address_space_ref | make (Context &&)=delete |
| |
Type-erased, two-word handle to a remote address space.
Packs a context pointer and a virtual table into two words, avoiding allocations, RTTI, and virtual dispatch.
template<typename Tag , typename Context , typename Traits = address_space_traits<Tag>, std::enable_if_t<!std::is_void_v< typename Traits::context_type > &&std::is_convertible_v< const Context *, const typename Traits::context_type * >, int > = 0>
| constexpr microfmt::address_space_ref::address_space_ref |
( |
Tag |
, |
|
|
const Context &ctx RELOCO_LIFETIMEBOUND |
RELOCO_LIFETIME_CAPTURE_BY_THIS |
|
) |
| |
|
inlineconstexprnoexcept |
Constructs a handle for a stateful address-space tag.
- Template Parameters
-
| Tag | Address-space tag type. |
| Context | Concrete context type. |
| Traits | Specialized traits, enabled when context_type is non-void and Context converts to it. |
- Parameters
-
| ctx | Context object providing the reads. |