microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Functions | Variables
remote_object.hpp File Reference

Remote object dumping, layout macros, and string pointer wrappers with 32-bit compatibility support. More...

#include "../microfmt.hpp"
#include "compat32.hpp"
#include "foreign_string_view.hpp"
#include <cstddef>
#include <cstdint>
#include <type_traits>
Include dependency graph for remote_object.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  microfmt::remote_field_desc
 Static descriptor for a single field in a remote structure layout. More...
 
struct  microfmt::remote_field_traits< T, Enable >
 Default field formatter policy. Can be specialized or overloaded for custom remote types, smart pointers, etc. More...
 
struct  microfmt::remote_field_traits< string_ptr >
 
struct  microfmt::remote_field_traits< string32_ptr >
 
class  microfmt::string_ptr
 64-bit/Native remote string pointer wrapper. More...
 
struct  microfmt::formatter< string_ptr >
 
struct  microfmt::formatter< string32_ptr >
 
struct  microfmt::remote_object_traits< T, Enable >
 Traits customization point for remote object metadata. More...
 
struct  microfmt::type_tag< T >
 
class  microfmt::remote_object_view
 
struct  microfmt::formatter< remote_object_view >
 

Namespaces

namespace  microfmt
 

Macros

#define MICROFMT_REMOTE_STRUCT_BEGIN(StructName)
 
#define MICROFMT_REMOTE_FIELD(Name, ...)    {#Name, offsetof(CurrentStruct, Name), &microfmt::remote_field_traits<__VA_ARGS__>::format},
 
#define MICROFMT_REMOTE_STRUCT_END()
 

Typedefs

using microfmt::remote_field_format_fn = void(*)(address_space_ref space, const void *field_ptr, span< char > work_buf, const sink &out) noexcept
 Type-erased function pointer for formatting a single remote object field from a loaded local struct buffer.
 

Functions

class MICROFMT_API_CLASS microfmt::alignas (uint32_t) string32_ptr
 32-bit compatibility string pointer wrapper (for 64-bit hosts).
 

Variables

 microfmt::RELOCO_END_UNSAFE_CODE
 

Detailed Description

Remote object dumping, layout macros, and string pointer wrappers with 32-bit compatibility support.

Macro Definition Documentation

◆ MICROFMT_REMOTE_FIELD

#define MICROFMT_REMOTE_FIELD (   Name,
  ... 
)     {#Name, offsetof(CurrentStruct, Name), &microfmt::remote_field_traits<__VA_ARGS__>::format},

◆ MICROFMT_REMOTE_STRUCT_BEGIN

#define MICROFMT_REMOTE_STRUCT_BEGIN (   StructName)
Value:
template <> struct microfmt::remote_object_traits<StructName> { \
static constexpr size_t struct_size = sizeof(StructName); \
static constexpr size_t struct_align = alignof(StructName); \
static constexpr bool is_registered = true; \
static microfmt::span<const remote_field_desc> fields() noexcept { \
using CurrentStruct = StructName; \
static constexpr microfmt::remote_field_desc static_fields[] = {
Static descriptor for a single field in a remote structure layout.
Definition remote_object.hpp:34
Traits customization point for remote object metadata.
Definition remote_object.hpp:217
static constexpr size_t struct_align
Definition remote_object.hpp:221
static constexpr bool is_registered
Definition remote_object.hpp:218
static constexpr span< const remote_field_desc > fields() noexcept
Definition remote_object.hpp:219
static constexpr size_t struct_size
Definition remote_object.hpp:220

◆ MICROFMT_REMOTE_STRUCT_END

#define MICROFMT_REMOTE_STRUCT_END ( )
Value:
} \
; \
return {static_fields, sizeof(static_fields) / sizeof(static_fields[0])}; \
} \
} \
;