metadata 0.2.0
Modern C++23 header-only metadata container (JSON-like)
Loading...
Searching...
No Matches
md::ObjectCell Class Reference

Parcel cell wrapping an md::Object (a.k.a. More...

#include <parcel.hpp>

Inherits parcel::BaseCell< ObjectCell, Object >.

Public Member Functions

 ObjectCell (std::initializer_list< Object::value_type > il)
 Brace-init passthrough so md::ObjectCell{{"k", 1}, {"k2", "v"}} mirrors md::Object{...} exactly; no wrapper type at the call site.
 
std::string to_string () const override
 Compact textual rendering of the wrapped md::Object, identical to streaming via operator<<.
 

Static Public Member Functions

static parcel::cell_t from_json (parcel::json_t const &j, parcel::ParcelRegistry const &)
 Parcel deserialization entry point.
 
static parcel::cell_type_descriptor_t descriptor ()
 Registry descriptor for ObjectCell.
 

Static Public Attributes

static constexpr std::string_view kind_id = "md:o"
 Wire-stable kind id reported under the "k" slot.
 

Detailed Description

Parcel cell wrapping an md::Object (a.k.a.

md::Metadata).

Wire kind: md:o. The "v" slot is a JSON object whose values are themselves serialized through the md::Value JSON adapter.

Constructor & Destructor Documentation

◆ ObjectCell()

md::ObjectCell::ObjectCell ( std::initializer_list< Object::value_type il)
inline

Brace-init passthrough so md::ObjectCell{{"k", 1}, {"k2", "v"}} mirrors md::Object{...} exactly; no wrapper type at the call site.

Parameters
ilInitializer list of {key, value} pairs.

Member Function Documentation

◆ from_json()

static parcel::cell_t md::ObjectCell::from_json ( parcel::json_t const &  j,
parcel::ParcelRegistry const &   
)
inlinestatic

Parcel deserialization entry point.

Validates "k" == "md:o" and decodes "v" as an md::Object via the <md/json.hpp> ADL hooks.

Exceptions
parcel::ParcelExceptionon shape or kind mismatch.

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