parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
Loading...
Searching...
No Matches
parcel::TypedMapCellTypeDescriptor< T > Class Template Referencefinal

Descriptor for TypedMapCell<T>. More...

#include <map.h>

Inheritance diagram for parcel::TypedMapCellTypeDescriptor< T >:
Collaboration diagram for parcel::TypedMapCellTypeDescriptor< T >:

Public Member Functions

 TypedMapCellTypeDescriptor (DisplayInfo info)
 Construct with the given display info.
 
std::string_view element_kind () const
 Wire kind id of the map's value type.
 
descriptor::CellCategory category () const override
 Coarse classification (primitive, list, struct, …).
 
std::vector< std::string_view > sub_kinds () const override
 Sub-kind ids reachable from this descriptor.
 
cell_t cell_from_json (json_t const &j, ParcelRegistry const &reg) const override
 Construct a cell from JSON, dispatching to the concrete from_json.
 
json_t to_json () const override
 Serialize the descriptor itself (kind + display info + category + extras).
 
- Public Member Functions inherited from parcel::BaseCellTypeDescriptor< TypedMapCell< T > >
 BaseCellTypeDescriptor (DisplayInfo info)
 Construct with the given display info.
 

Additional Inherited Members

- Static Public Attributes inherited from parcel::BaseCellTypeDescriptor< TypedMapCell< T > >
static constexpr std::string_view kind_id
 Wire-stable kind id, lifted from T::kind_id.
 
- Protected Member Functions inherited from parcel::BaseCellTypeDescriptor< TypedMapCell< T > >
json_t base_to_json () const
 Common JSON skeleton (kind, display_info, category) reused by overrides.
 
- Protected Attributes inherited from parcel::BaseCellTypeDescriptor< TypedMapCell< T > >
DisplayInfo display_info_
 Stored display info.
 

Detailed Description

template<CellLike T>
class parcel::TypedMapCellTypeDescriptor< T >

Descriptor for TypedMapCell<T>.

Adds an "element_kind" field to the JSON descriptor and exposes the element kind through ISubTypes so the registry's schema walker reaches the inner type.

Template Parameters
TElement cell type.

Constructor & Destructor Documentation

◆ TypedMapCellTypeDescriptor()

template<CellLike T>
parcel::TypedMapCellTypeDescriptor< T >::TypedMapCellTypeDescriptor ( DisplayInfo  info)
inlineexplicit

Construct with the given display info.

Parameters
infoDisplay info.

Member Function Documentation

◆ cell_from_json()

template<CellLike T>
cell_t parcel::TypedMapCellTypeDescriptor< T >::cell_from_json ( json_t const &  j,
ParcelRegistry const &  reg 
) const
inlineoverridevirtual

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.

Implements parcel::ICellTypeDescriptor.

◆ to_json()

template<CellLike T>
json_t parcel::TypedMapCellTypeDescriptor< T >::to_json ( ) const
inlineoverridevirtual

Serialize the descriptor itself (kind + display info + category + extras).

Returns
JSON object describing this cell type.

Reimplemented from parcel::BaseCellTypeDescriptor< TypedMapCell< T > >.


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