parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
Loading...
Searching...
No Matches
descriptor.h File Reference

Runtime cell-type descriptors and the schema-graph mix-ins (IHasFields, ISubTypes). More...

#include <parcel/cell.h>
#include <parcel/common.h>
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <typeindex>
#include <typeinfo>
#include <utility>
#include <vector>
Include dependency graph for descriptor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  parcel::ICellTypeDescriptor
 Runtime descriptor for a cell type — type-erased face of a CellLike. More...
 
struct  parcel::IFieldDescriptor
 Runtime descriptor for a single struct field. More...
 
struct  parcel::IHasFields
 Mix-in declaring a descriptor exposes a static set of named fields. More...
 
struct  parcel::ISubTypes
 Mix-in declaring a descriptor refers to other registered cell kinds. More...
 
class  parcel::BaseCellTypeDescriptor< T >
 CRTP base that fills in the boilerplate of every cell-type descriptor. More...
 
class  parcel::SimpleCellTypeDescriptor< T >
 Plain descriptor for cells in the Primitive category. More...
 

Typedefs

using parcel::field_descriptor_t = std::shared_ptr< IFieldDescriptor >
 Shared handle to a field descriptor.
 
using parcel::field_descriptors_t = std::map< std::string, field_descriptor_t >
 Ordered map of field key → descriptor.
 

Enumerations

enum class  parcel::descriptor::CellCategory
 Coarse runtime classification of a cell type. More...
 

Detailed Description

Runtime cell-type descriptors and the schema-graph mix-ins (IHasFields, ISubTypes).

Descriptors are the runtime, type-erased face of the static cell types. Each cell exposes its descriptor via the CellLike::descriptor() static, and the ParcelRegistry keeps them keyed by kind id so polymorphic dispatch (e.g. MapCell deserialization) can route to the right from_json. See the README "Descriptors and the registry" section.

Enumeration Type Documentation

◆ CellCategory

Coarse runtime classification of a cell type.

Mirrors the eight wire categories: Primitive, the typed and heterogeneous list/map variants, structs, unions, and a Custom escape hatch for user-supplied descriptors.