17#if !defined(PARCEL_HAS_ULID)
18#if defined(__has_include)
19#if __has_include(<ulid/ulid.h>)
20#define PARCEL_HAS_ULID 1
22#define PARCEL_HAS_ULID 0
25#define PARCEL_HAS_ULID 0
53class UlidCell :
public BaseCell<UlidCell, ulid::Ulid> {
54 using base_t = BaseCell<UlidCell, ulid::Ulid>;
58 using base_t::operator=;
60 static constexpr std::string_view kind_id =
"ulid";
62 [[nodiscard]] std::string
to_string()
const override {
63 return this->value.string();
66 static cell_t from_json(json_t
const& j, ParcelRegistry
const&) {
67 auto v = base_t::cell_from_json<ulid::Ulid>(j, kind_id);
68 auto cell = std::make_shared<UlidCell>(v);
69 base_t::absorb_display_info(j, cell);
74 static const auto d = std::make_shared<SimpleCellTypeDescriptor<UlidCell>>(
DisplayInfo{
75 .name =
"ULID", .description =
"ULID (26-char Crockford base32 string on the wire)"});
Core ICell interface, cell_t handle, BaseCell CRTP base, and CellLike concept.
std::string to_string(cell_t const &c)
Free to_string over cell_t; returns "<null>" for null handles.
Definition cell.h:711
std::shared_ptr< ICellTypeDescriptor > cell_type_descriptor_t
Shared handle to a runtime cell-type descriptor.
Definition cell.h:63
std::shared_ptr< ICell > cell_t
Shared handle to any ICell-derived value — the canonical cell pointer.
Definition cell.h:68
comms::DisplayInfo DisplayInfo
Display info attached to a cell or descriptor — re-exported from comms::DisplayInfo.
Definition common.h:75
The default_cell_for<T> trait that drives FieldsBuilder field-type inference.
#define PARCEL_DEFAULT_CELL(CellT)
Register a cell type as the default wrapper for its payload type.
Definition defaults.h:269
auto cell(T &&v)
Wrap a raw value into its default cell, returning a shared_ptr to the cell.
Definition defaults.h:192
Runtime cell-type descriptors and the schema-graph mix-ins (IHasFields, ISubTypes).
nlohmann::json typedef shared across cell types.