92 #include <string_view>
94 #include "../base/bytes.h"
95 #include "../base/functional.h"
96 #include "../base/macros.h"
260 [[maybe_unused]]
static constexpr std::chrono::milliseconds
kInfinite{-1};
356 [[nodiscard]]
static constexpr
SchemaType infer_ser_type(std::string_view ser_type) noexcept;
373 std::string_view encoding = {}) noexcept;
457 constexpr
auto kHasPrefixFunction = [](std::string_view value, std::string_view prefix) noexcept {
458 if VUNLIKELY (prefix.size() > value.size()) {
462 for (
size_t i = 0; i < prefix.size(); ++i) {
463 if (value[i] != prefix[i]) {
471 if (kHasPrefixFunction(ser_type,
"vlink::zerocopy::")) {
475 if (ser_type ==
"raw" || ser_type ==
"string" || ser_type ==
"std::string" || ser_type ==
"text" ||
476 ser_type ==
"json" || ser_type ==
"application/json" || ser_type ==
"text/json") {
Fixed-size 128-byte buffer holder with SBO, five ownership modes and integrated codecs.
Definition: bytes.h:120
Move-only type-erased callable analogue of std::move_only_function with pool spill.
Definition: functional.h:134
#define VUNLIKELY(...)
Short alias for VLINK_UNLIKELY.
Definition: macros.h:289
#define VLINK_EXPORT
Definition: macros.h:81
constexpr bool is_valid() noexcept
Definition: name_detector.h:382
InitType
Selects between immediate and deferred node initialisation.
Definition: types.h:154
@ kWithoutInit
Defer initialisation; call init() manually.
@ kWithInit
Initialise immediately in the constructor.
SchemaType
Coarse runtime schema family used by discovery, bag metadata and proxy routing.
Definition: types.h:207
@ kUnknown
Decoding family unknown.
@ kZeroCopy
Decode through the VLink zero-copy structs.
@ kProtobuf
Decode through the Protocol Buffers stack.
@ kFlatbuffers
Decode through the FlatBuffers stack.
@ kRaw
Treat the payload as opaque bytes.
ActionType
Labels for messages captured by the recording infrastructure.
Definition: types.h:185
@ kSet
Value written by a Setter node.
@ kServerRequest
RPC request observed by a Server node.
@ kPublish
Message emitted by a Publisher node.
@ kUnknownAction
Action category is not classified.
@ kGet
Value observed by a Getter node.
@ kClientResponse
RPC response observed by a Client node.
@ kSubscribe
Message observed by a Subscriber node.
@ kServerResponse
RPC response emitted by a Server node.
@ kClientRequest
RPC request emitted by a Client node.
TransportType
Enumeration of every transport backend recognised by VLink.
Definition: types.h:128
@ kShm2
Iceoryx2 shared memory (shm2://).
@ kSomeip
SOME/IP through vsomeip (someip://).
@ kUnknown
Unknown or unsupported transport.
@ kZenoh
Zenoh publish / subscribe (zenoh://).
@ kDds
Fast-DDS RTPS (dds://).
@ kDdsc
CycloneDDS (ddsc://).
@ kQnx
QNX IPC (qnx://; QNX only).
@ kIntra
In-process queue (intra://).
@ kDdsr
RTI DDS (ddsr://).
@ kDdst
TravoDDS (ddst://).
@ kShm
Iceoryx shared memory (shm://).
@ kFdbus
FDBus IPC (fdbus://).
ImplType
Bitmask identifying the role of a VLink node implementation.
Definition: types.h:110
@ kGetter
Field getter (reads latest value).
Definition: types.h:117
@ kSubscriber
Event subscriber (receives broadcasts).
Definition: types.h:115
@ kClient
Method client (RPC caller).
Definition: types.h:113
@ kSetter
Field setter (writes latest value).
Definition: types.h:116
@ kPublisher
Event publisher (one-to-many broadcast).
Definition: types.h:114
@ kUnknownImplType
Type not yet determined.
Definition: types.h:111
@ kServer
Method server (RPC responder).
Definition: types.h:112
SecurityType
Compile-time selector for the per-node message security variant.
Definition: types.h:172
@ kWithSecurity
Encrypted and authenticated transport.
@ kWithoutSecurity
Plain, unauthenticated transport.
One recorded or replayed message as it flows through the bag pipeline.
Definition: types.h:230
Bytes data
Serialised payload bytes.
Definition: types.h:236
SchemaType schema_type
Coarse schema family; reader fills it before user output.
Definition: types.h:234
ActionType action_type
Recorded action kind.
Definition: types.h:235
int64_t timestamp
Canonical time in microseconds (record / playback).
Definition: types.h:231
std::string ser_type
Serialisation type; reader fills it before user output.
Definition: types.h:233
std::string url
Topic URL.
Definition: types.h:232
Aggregate of cumulative delivered / lost sample counts.
Definition: types.h:273
uint64_t total
Total number of samples expected (delivered + lost).
Definition: types.h:274
uint64_t lost
Number of samples that were dropped or missed.
Definition: types.h:275
VLINK_EXPORT friend std::ostream & operator<<(std::ostream &ostream, const SampleLostInfo &info) noexcept
Streams a human-readable summary to ostream.
Wire-format-neutral wrapper around one serialised schema blob.
Definition: types.h:301
Bytes data
Raw serialised schema bytes (FileDescriptorSet, BFBS, ...).
Definition: types.h:305
static std::string_view convert_type(SchemaType schema_type) noexcept
Converts a schema type to its canonical persisted encoding label.
static SchemaType resolve_type(SchemaType schema_type, std::string_view ser_type={}, std::string_view encoding={}) noexcept
Resolves the best available schema family from explicit, encoding and ser hints.
static bool is_real_type(SchemaType schema_type) noexcept
Returns whether schema_type carries concrete schema metadata.
static bool is_valid_type(SchemaType schema_type) noexcept
Returns whether schema_type is within the supported enum range.
std::string encoding
Schema encoding identifier, e.g. "protobuf" or "flatbuffers".
Definition: types.h:303
std::string name
Schema subject (usually a fully qualified message or table name).
Definition: types.h:302
static SchemaType convert_encoding(std::string_view encoding) noexcept
Parses an encoding string back into a SchemaType value.
Compile-time timeout constants used by the public blocking wait helpers.
Definition: types.h:257
static constexpr std::chrono::milliseconds kInfinite
Wait indefinitely (negative timeout).
Definition: types.h:260
static constexpr std::chrono::milliseconds kDefaultInterval
Default wait timeout: 5 seconds.
Definition: types.h:258
Semantic version number with comparison and string-conversion helpers.
Definition: types.h:385
bool operator==(const Version &target) const noexcept
Tests equality with target.
bool operator!=(const Version &target) const noexcept
Tests inequality with target.
std::string to_string() const noexcept
Serialises this version back to a "major.minor.patch" string.
static Version from_string(const std::string &version_str) noexcept
Parses a version string in "major.minor.patch" form.
bool operator>(const Version &target) const noexcept
Reports whether this version is strictly newer than target.
bool operator<(const Version &target) const noexcept
Reports whether this version is strictly older than target.