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

The shared vocabulary aliases re-exported from commons and the compile-time kind-id machinery. More...

#include <parcel/json.h>
#include <commons/display_info.hpp>
#include <commons/fixed_string.hpp>
#include <commons/types.hpp>
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <string>
#include <string_view>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  parcel::id_join< Parts >
 Compile-time concatenation of std::string_view references into a single std::string_view with static storage. More...
 
struct  parcel::id_join_lit< Parts >
 Compile-time concatenation of FixedString literals into a single std::string_view with static storage. More...
 
struct  parcel::prefixed_id< Prefix, Tail >
 Compile-time concatenation of a FixedString literal prefix with a std::string_view reference tail into one std::string_view with static storage. More...
 

Typedefs

using parcel::DisplayInfo = comms::DisplayInfo
 Display info attached to a cell or descriptor — re-exported from comms::DisplayInfo.
 

Variables

template<std::string_view const &... Parts>
constexpr std::string_view parcel::id_join_v = id_join<Parts...>::value
 Convenience alias yielding the joined std::string_view.
 
template<FixedString... Parts>
constexpr std::string_view parcel::id_join_lit_v = id_join_lit<Parts...>::value
 Convenience alias yielding the joined std::string_view.
 
template<FixedString Prefix, std::string_view const & Tail>
constexpr std::string_view parcel::prefixed_id_v = prefixed_id<Prefix, Tail>::value
 Convenience alias yielding the joined std::string_view.
 

Detailed Description

The shared vocabulary aliases re-exported from commons and the compile-time kind-id machinery.

The parcel::i128 / parcel::u128 aliases are re-exported from comms::i128 / comms::u128 and become available when 128-bit integers exist on the toolchain. Headers that declare 128-bit cells (primitive.h, builtins.h) gate them behind commons' own COMMONS_HAS_INT128 feature macro (defined in <commons/types.hpp>), so the gate always matches the source of the types.

This header also re-exports parcel::FixedString and parcel::DisplayInfo from commons, and centralizes the shared bits used by composite cells to synthesize their wire kind_id at compile time:

  • FixedString<N> — C++20 class-NTTP string-literal carrier.
  • id_join_v<Parts...> — concatenate std::string_view references.
  • id_join_lit_v<Parts...> — concatenate FixedString literals.
  • prefixed_id_v<Prefix, Tail>FixedString literal prefix joined with a std::string_view reference tail.

Typedef Documentation

◆ DisplayInfo

using parcel::DisplayInfo = typedef comms::DisplayInfo

Display info attached to a cell or descriptor — re-exported from comms::DisplayInfo.

Every ICell may carry an optional DisplayInfo (name / description / typed comms::Icon / typed comms::Color), serialized under the JSON key "d". It is purely display info for UI/tooling use and never affects the wire identity ("k") or value ("v") of a cell. It serializes via commons' free ADL to_json / from_json (there is no member to_json()).