|
parcel 0.2.2
Wrappable, wire-transferable C++23 value system with JSON serialization
|
Cell wrapping comms::OriginPtr (a std::unique_ptr<comms::IOrigin>).
More...
#include <commons.h>


Public Member Functions | |
| std::string_view | kind () const override |
| Wire-stable kind identifier for this cell. | |
| std::optional< DisplayInfo > const & | overridden_display_info () const override |
| Read-only access to this cell's optional display info. | |
| std::string | to_string () const override |
| Render the cell's value as a compact human-readable string. | |
| json_t | to_json () const override |
| Serialize this cell to its canonical JSON representation. | |
| cell_t | clone () const override |
| Deep-copy this cell. | |
| std::partial_ordering | compare (ICell const &other) const override |
| Three-way compare against another cell. | |
Public Member Functions inherited from parcel::ICell | |
| virtual std::string | to_formatted_string () const |
| Render the cell as a multi-line, indented string. | |
| virtual std::size_t | hash_value () const noexcept |
Equality-consistent hash that mirrors compare's display-info-insensitivity. | |
| cell_t | with_display_info (DisplayInfo m) const |
| Return a deep copy with the entire display info block replaced. | |
| cell_t | with_name (std::string v) const |
Return a deep copy with name set to v. | |
| cell_t | with_description (std::string v) const |
Return a deep copy with description set to v. | |
| cell_t | with_icon (comms::Icon icon) const |
Return a deep copy with icon set to the typed icon. | |
| cell_t | with_icon (std::string const &v) const |
Return a deep copy with icon parsed from an Iconify set:name string (e.g. | |
| cell_t | with_color (comms::Color color) const |
Return a deep copy with color set to the typed color. | |
| cell_t | with_color (std::string const &v) const |
Return a deep copy with color parsed from a color string (hex like "#ffcc00", a CSS-functional form, or a CSS color name). | |
Static Public Member Functions | |
| static cell_t | of (comms::OriginPtr v) |
Construct a shared_ptr<OriginCell> owning v. | |
Public Attributes | |
| comms::OriginPtr | value |
| Held origin (may be null). | |
Protected Member Functions | |
| void | set_display_info (std::optional< DisplayInfo > m) override |
| Replace this cell's display info in place. | |
Additional Inherited Members | |
Static Public Attributes inherited from parcel::ICell | |
| static constexpr std::string_view | KEY_KIND = "k" |
JSON key for the kind id ("k"). | |
| static constexpr std::string_view | KEY_VALUE = "v" |
JSON key for the value payload ("v"). | |
| static constexpr std::string_view | KEY_DESCRIPTION = "d" |
JSON key for the optional display info block ("d"). | |
Cell wrapping comms::OriginPtr (a std::unique_ptr<comms::IOrigin>).
Wire kind "origin"; value is a {"kind", …fields} object.
OriginPtr is move-only, so this cell derives directly from ICell rather than BaseCell (whose clone() copies the storage). The held origin serializes through commons' nlohmann::adl_serializer<comms::OriginPtr>; decoding resolves the "kind" discriminator against comms::GlobalOriginRegistry, throwing on an unknown kind.
|
inlineoverridevirtual |
Deep-copy this cell.
cell_t whose state is independent of the original. Implements parcel::ICell.
|
inlineoverridevirtual |
Three-way compare against another cell.
Compares by kind id first (lexicographic on the string view); within the same kind, compares the held value. Display info is intentionally ignored — two cells with the same kind/value but different DisplayInfo are equivalent under this relation.
| other | Cell to compare with. |
std::partial_ordering — unordered whenever the storage type only supports equality (or contains incomparable values such as floating-point NaN). Implements parcel::ICell.
|
inlineoverridevirtual |
Wire-stable kind identifier for this cell.
kind_id on the concrete type. Implements parcel::ICell.
|
inlineoverridevirtual |
Read-only access to this cell's optional display info.
Implements parcel::ICell.
|
inlineoverrideprotectedvirtual |
Replace this cell's display info in place.
Used by with_* builders on freshly cloned receivers and by JSON deserializers; no other public path mutates display info.
| m | New display info value (may be empty to clear). |
Implements parcel::ICell.
|
inlineoverridevirtual |
Serialize this cell to its canonical JSON representation.
{"k", "v", optional "d"}. Implements parcel::ICell.
|
inlineoverridevirtual |
Render the cell's value as a compact human-readable string.
Implements parcel::ICell.