|
parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
|
Runtime descriptor for a cell type — type-erased face of a CellLike.
More...
#include <descriptor.h>

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 ®) 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). | |
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.
|
pure virtual |
Construct a cell from JSON, dispatching to the concrete from_json.
| j | JSON object to deserialize. |
| reg | Registry used to resolve nested polymorphic cells. |
| std::runtime_error | on 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 >.
|
pure virtual |
Serialize the descriptor itself (kind + display info + category + extras).
Implemented in parcel::BaseCellTypeDescriptor< T >, parcel::BaseCellTypeDescriptor< Derived >, parcel::BaseCellTypeDescriptor< HashMapCell >, parcel::BaseCellTypeDescriptor< ListCell >, parcel::BaseCellTypeDescriptor< MapCell >, parcel::BaseCellTypeDescriptor< TypedHashMapCell< T > >, parcel::BaseCellTypeDescriptor< TypedListCell< T > >, parcel::BaseCellTypeDescriptor< TypedMapCell< T > >, parcel::BaseCellTypeDescriptor< UnionCell< Ts... > >, parcel::TypedListCellTypeDescriptor< T >, parcel::TypedMapCellTypeDescriptor< T >, parcel::StructCellTypeDescriptor< Derived, Payload >, and parcel::UnionCellTypeDescriptor< Ts >.