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

Umbrella header for the parcel cell adapters wrapping the aurimasniekis/cpp-commons vocabulary types. More...

Include dependency graph for commons.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Detailed Description

Umbrella header for the parcel cell adapters wrapping the aurimasniekis/cpp-commons vocabulary types.

Each cell family lives in its own focused header under parcel/commons/; this umbrella #includes them all (the same shape as <parcel/parcel.h>). Include <parcel/commons.h> to get every commons adapter at once.

  • ColorCellcomms::Color"color" (hex string).
  • IconCellcomms::Icon"icon" ("set:name" string).
  • DisplayInfoCellcomms::DisplayInfo"display_info" (JSON object).
  • FlagCellcomms::FlagRef"flag" (flag name string).
  • FlagSetCellcomms::FlagSet"flag_set" (array of names).
  • SemVerCellcomms::SemVer"semver" (version string).
  • VersionConstraintCellcomms::VersionConstraint"version_constraint" (range string).
  • OriginCellcomms::OriginPtr"origin" ({"kind",…} object).
  • ReasonCellcomms::ReasonPtr"reason" ({"kind",…} object).
  • FailureReasonCellcomms::FailureReasonPtr"failure_reason" ({"kind",…}).
  • AbilityCellcomms::AbilityPtr"ability" ({"kind",…} object).
  • IdentityCellcomms::IdentityPtr"identity" ({"kind",…} object).
  • AuditRecordCellcomms::AuditRecord"audit_record" (JSON object).
  • AuditRecordsCellcomms::AuditRecords"audit_records" (JSON array).
  • ChangeAuditRecordCell<P>"change_audit_record:" + P::kind_id (opt-in).
  • ChangeAuditRecordsCell<P>"change_audit_records:" + P::kind_id (opt-in).
  • ValueCell / ObjectCell / ArrayCellcomms::md::*"md:v" / "md:o" / "md:a".
  • LifecycleStatusCellcomms::LifecycleStatus"lifecycle_status" (string).
  • StatusTransitionCell<P>comms::StatusTransition<P::storage_t>"status_transition:" + P::kind_id (object).
  • StatusReportCell<P>comms::StatusReport<P::storage_t>"status_report:" + P::kind_id (object).
  • StatusTransitionTimelineCell<P> — the transition history → "status_transition_timeline:" + P::kind_id (array). (P defaults to LifecycleStatusCell; the <> instantiations are registered, other P are opt-in.)

Each cell reuses commons' ADL to_json / from_json (auto-enabled because nlohmann/json is on the include path), so the inherited serialization just works — only to_string, kind_id, from_json, and descriptor() are defined per cell, following the ext/filesystem.h PathCell pattern.

The polymorphic cells (OriginCell / ReasonCell / FailureReasonCell / AbilityCell / IdentityCell) are open sets: decoding resolves the inner "kind" against the matching commons global registry and throws on an unknown kind, so third-party kinds that self-register decode correctly too.