34 out.write(opts.open_bracket);
36 uintptr_t current_node = 0;
37 if (!traits_type::get_head_node(context, container_addr, space, scratch, current_node)) {
38 out.write(opts.close_bracket);
42 size_t print_count = 0;
43 while (current_node != 0) {
44 if (print_count >= opts.max_print) {
46 out.write(opts.entry_separator);
51 out.write(opts.entry_separator);
53 if (!traits_type::format_node_element(context, space, scratch, current_node, out)) {
58 uintptr_t next_node = 0;
59 if (!traits_type::get_next_node(context, space, scratch, current_node, next_node)) {
63 current_node = next_node;
67 out.write(opts.close_bracket);
76template <
typename Tag>
82template <
typename Tag>
89template <
typename T,
typename RemotePtr>
91 using pointer_query =
decltype(make_remote_offset_query<uintptr_t, RemotePtr>(0));
100 span<std::byte>, uintptr_t &out_node_addr)
noexcept {
101 return context->head(space, container_addr, out_node_addr);
105 uintptr_t node_addr, uintptr_t &out_next_addr)
noexcept {
106 return context->next(space, node_addr, out_next_addr);
110 span<std::byte> scratch, uintptr_t node_addr,
const sink &out)
noexcept {
117 T *value = allocator.allocate<T>();
118 if (!value || !space.read_bytes(elem_addr, value,
sizeof(T)))
129template <
typename T,
typename RemotePtr = u
intptr_t>
131 ptrdiff_t next_offset, ptrdiff_t data_offset)
noexcept {
134 typename traits::context_type context{make_remote_offset_query<uintptr_t, RemotePtr>(head_offset),
135 make_remote_offset_query<uintptr_t, RemotePtr>(next_offset), data_offset};
Type-erased, two-word handle to a remote address space.
Definition address_space.hpp:204
Owning typed container bound to a compile-time traits dispatcher.
Definition remote_container.hpp:102
Definition remote_object.hpp:231
Zero-allocation bump allocator for scratch buffers.
Definition scratch_allocator.hpp:27
RELOCO_BEGIN_UNSAFE_CODE constexpr uintptr_t add_address_offset(uintptr_t address, ptrdiff_t offset) noexcept
Definition address_space.hpp:52
reloco::sink sink
Type-erased, zero-allocation output sink.
Definition microfmt.hpp:46
constexpr remote_forward_list< Tag > make_remote_forward_list(uintptr_t container_addr, typename remote_forward_list_traits< Tag >::context_type context) noexcept
Creates a typed remote forward list with caller-defined traits.
Definition remote_forward_list.hpp:84
Type-erased views and contexts for formatting remote containers.
Reusable callback and typed-offset accessors for remote layouts.
Remote object dumping, layout macros, and string pointer wrappers with 32-bit compatibility support.
Configuration options for formatting container views.
Definition remote_container.hpp:25
Definition remote_forward_list.hpp:72
Definition remote_forward_list.hpp:28
static bool format(value_ref< const context_type > context, uintptr_t container_addr, const container_options &opts, address_space_ref space, span< std::byte > scratch, const sink &out) noexcept
Definition remote_forward_list.hpp:32
typename traits_type::context_type context_type
Definition remote_forward_list.hpp:30
decltype(make_remote_offset_query< uintptr_t, RemotePtr >(0)) pointer_query
Definition remote_forward_list.hpp:91
static bool get_head_node(value_ref< const context_type > context, uintptr_t container_addr, address_space_ref space, span< std::byte >, uintptr_t &out_node_addr) noexcept
Definition remote_forward_list.hpp:99
static bool format_node_element(value_ref< const context_type > context, address_space_ref space, span< std::byte > scratch, uintptr_t node_addr, const sink &out) noexcept
Definition remote_forward_list.hpp:109
static bool get_next_node(value_ref< const context_type > context, address_space_ref space, span< std::byte >, uintptr_t node_addr, uintptr_t &out_next_addr) noexcept
Definition remote_forward_list.hpp:104
ptrdiff_t data_offset
Definition remote_forward_list.hpp:96
pointer_query next
Definition remote_forward_list.hpp:95
pointer_query head
Definition remote_forward_list.hpp:94
Static customization point for a remote forward-list implementation.
Definition remote_forward_list.hpp:24
Traits customization point for remote object metadata.
Definition remote_object.hpp:217
Definition remote_object.hpp:229