83 #include "../serializer.h"
143 #define VLINK_INTRA_DATA_DECLARE(target_type, declare_name) \
144 struct declare_name##Type : public vlink::IntraDataType { \
147 static constexpr vlink::Serializer::Type kValueType = vlink::Serializer::get_type_of<target_type>(); \
149 static_assert(vlink::Serializer::is_supported(kValueType), \
150 "VLINK_INTRA_DATA_DECLARE(target_type) is not a supported Serializer type."); \
152 bool operator<<(const vlink::Bytes& bytes) noexcept { \
153 return vlink::Serializer::deserialize<kValueType>(bytes, value); \
156 bool operator>>(vlink::Bytes& bytes) const noexcept { \
157 return vlink::Serializer::serialize<kValueType>(value, bytes); \
160 [[nodiscard]] size_t get_serialized_size() const noexcept { \
161 return vlink::Serializer::get_serialized_size<kValueType>(value); \
164 [[nodiscard]] static std::string get_serialized_type() noexcept { \
165 return vlink::Serializer::get_serialized_type<kValueType, target_type>(); \
168 [[nodiscard]] static constexpr vlink::SchemaType get_schema_type() noexcept { \
169 return vlink::Serializer::get_schema_type<kValueType, target_type>(); \
173 struct declare_name : public std::shared_ptr<declare_name##Type> { \
174 using Base = std::shared_ptr<declare_name##Type>; \
178 declare_name() noexcept = default; \
180 declare_name(Base&& other) noexcept : Base(std::move(other)) {} \
182 declare_name(const Base& other) noexcept : Base(other) {} \
184 [[nodiscard]] static declare_name create() noexcept { \
185 return declare_name(std::make_shared<declare_name##Type>()); \
std::shared_ptr< IntraDataType > IntraData
Shared-ownership handle for an IntraDataType payload.
Definition: intra_data.h:112
Polymorphic base of every in-process payload container.
Definition: intra_data.h:98
virtual ~IntraDataType()=default
Core enumerations and small value types shared by the entire VLink implementation layer.