parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
Loading...
Searching...
No Matches
parcel::ICellTypeDescriptor Struct Referenceabstract

Runtime descriptor for a cell type — type-erased face of a CellLike. More...

#include <descriptor.h>

Inheritance diagram for parcel::ICellTypeDescriptor:

Public Member Functions

virtual std::string_view kind () const =0
 Wire-stable kind identifier.
 
virtual DisplayInfo display_info () const =0
 Display info for this cell type.
 
virtual descriptor::CellCategory category () const =0
 Coarse classification (primitive, list, struct, …).
 
virtual std::type_index storage_type () const =0
 std::type_index of the cell's storage type.
 
virtual cell_t cell_from_json (const json_t &j, ParcelRegistry const &reg) const =0
 Construct a cell from JSON, dispatching to the concrete from_json.
 
virtual json_t to_json () const =0
 Serialize the descriptor itself (kind + display info + category + extras).
 

Detailed Description

Runtime descriptor for a cell type — type-erased face of a CellLike.

Held by the registry and used to dispatch deserialization into the right concrete cell when only a kind id is known at runtime.

See also
BaseCellTypeDescriptor — CRTP base used by every concrete descriptor.

Member Function Documentation

◆ cell_from_json()

virtual cell_t parcel::ICellTypeDescriptor::cell_from_json ( const json_t j,
ParcelRegistry const &  reg 
) const
pure virtual

Construct a cell from JSON, dispatching to the concrete from_json.

Parameters
jJSON object to deserialize.
regRegistry used to resolve nested polymorphic cells.
Returns
Newly built cell handle.
Exceptions
std::runtime_erroron shape or kind mismatch.

Implemented in parcel::SimpleCellTypeDescriptor< T >, parcel::ListCellTypeDescriptor, parcel::MapCellTypeDescriptor, parcel::HashMapCellTypeDescriptor, parcel::TypedListCellTypeDescriptor< T >, parcel::TypedMapCellTypeDescriptor< T >, parcel::StructCellTypeDescriptor< Derived, Payload >, and parcel::UnionCellTypeDescriptor< Ts >.

◆ to_json()


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