tagval 0.2.0
Modern C++23 header-only library of tagged values (open/closed enumerations with metadata)
Loading...
Searching...
No Matches
parcel.hpp File Reference

Optional cpp-parcel integration. More...

#include <tagval/base.hpp>
#include <tagval/json_nlohmann.hpp>
#include <concepts>
#include <memory>
#include <string>
#include <string_view>
#include <parcel/parcel.h>
+ Include dependency graph for parcel.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tagval::TagValCell< TagT >
 

Namespaces

namespace  tagval
 

Detailed Description

Optional cpp-parcel integration.

Activates when parcel is on the include path (or when TAGVAL_WITH_PARCEL=1 is defined by CMake).

Wire envelope (parcel framing of tagval's bare-string JSON adapter):

DeviceKind::Phone   <->   {"k":"tagval","v":"phone"}

Limitation: every TagValCell<T> instantiation shares kind_id="tagval", so a single ParcelRegistry cannot dispatch by kind to multiple TagT. This matches dimval's documented constraint and is fine for the typical site-knows-the- type usage. Inner JSON validation: T::try_of() (called via the bare-string from_json adapter) reports unknown codes, so cross-kind mismatches still surface as exceptions when the codes don't happen to coincide.