|
VLink 2.0.0
A high-performance communication middleware
|
Zero-serialisation in-process message container for intra:// transport. 更多...
类 | |
| struct | vlink::IntraDataType |
| Polymorphic base for all typed in-process message containers. 更多... | |
命名空间 | |
| namespace | vlink |
宏定义 | |
| #define | VLINK_INTRA_DATA_DECLARE(target_type, declare_name) |
| Generates a typed in-process message container pair. | |
类型定义 | |
| using | vlink::IntraData = std::shared_ptr<IntraDataType> |
Shared-ownership handle for an IntraDataType payload. | |
Zero-serialisation in-process message container for intra:// transport.
IntraData is the zero-copy message type used exclusively on the intra:// transport, where publisher and subscriber reside in the same process. Instead of serialising a message to Bytes and immediately deserialising it on the other side, a shared_ptr to the payload object is passed directly.
VLINK_INTRA_DATA_DECLARE(target_type, declare_name) macro generates two types for a given VLink message type T: declare_nameType – concrete IntraDataType subclass holding a T value plus serialisation/deserialisation helpers.declare_name – a std::shared_ptr<declare_nameType> wrapper with a static create() factory and implicit conversions from the base shared_ptr.IntraData messages are only supported on intra:// topics. Attempting to call write(IntraData) on a non-intra PublisherImpl logs a warning and returns false. | #define VLINK_INTRA_DATA_DECLARE | ( | target_type, | |
| declare_name ) |
Generates a typed in-process message container pair.
Expands to two declarations:
declare_nameType – a concrete IntraDataType subclass with:target_type value – the message payload.static constexpr Serializer::Type kValueType – compile-time type tag.bool operator<<(const Bytes&) – deserialise Bytes into value.bool operator>>(Bytes&) const – serialise value into Bytes.size_t get_serialized_size() const – byte count needed for serialisation.static std::string get_serialized_type() – type name string.static_assert ensuring target_type is a supported serialiser type.declare_name – a std::shared_ptr<declare_nameType> subclass with:shared_ptr.static declare_name create() – factory returning a heap-allocated instance.| target_type | The VLink message type (must be a supported Serializer::Type). |
| declare_name | The name to give the generated container types. |