VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
dds_conf.h File Reference

Transport configuration for the dds:// Fast-DDS RTPS backend. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Detailed Description

Transport configuration for the dds:// Fast-DDS RTPS backend.

DdsConf configures the eProsima Fast-DDS (Fast-RTPS) transport, which provides standards-compliant DDS pub/sub and RPC over Ethernet. It is the primary cross-machine transport in VLink and is suitable for both LAN and WAN deployments.

Supported Node Types
dds:// supports all six node types: kPublisher, kSubscriber, kServer, kClient, kSetter, and kGetter.
URL Format
dds://<topic>[?domain=<N>&depth=<N>&qos=<name>]
dds://<topic>[?domain=<N>&part=<v>&topic=<v>&pub=<v>&sub=<v>&writer=<v>&reader=<v>]
Component Description
topic DDS topic name; formed from host + "/" + path
domain DDS Domain ID (?domain=, default from VLINK_DDS_DOMAIN env var)
depth History depth for the DDS endpoint (?depth=, default 0)
qos Named QoS profile registered via register_qos() (?qos=)
qos_ext Extended QoS map: part, topic, pub, sub, writer, reader
QoS Registration
Named QoS profiles must be registered before creating any dds:// nodes:
vlink::Qos my_qos;
my_qos.reliability = vlink::Reliability::kReliable;
my_qos.durability = vlink::Durability::kTransientLocal;
vlink::DdsConf::register_qos("my_profile", my_qos);
vlink::Subscriber<MyMsg> sub("dds://my_topic?qos=my_profile");
Type Support Registration
For CDR-serialised types the DDS type support factory must be registered before any publisher or subscriber is created on that topic:
// Register request type only (for pub/sub):
vlink::DdsConf::register_topic<MyMsgPubSubType>("my_topic");
// Register request + response types (for RPC):
vlink::DdsConf::register_topic<MyReqPubSubType, MyRespPubSubType>("my_rpc_topic");
// Register from a full URL:
vlink::DdsConf::register_url<MyMsgPubSubType>("dds://my_topic?domain=1");
Global QoS File
An XML QoS profile file can be loaded at startup so that DDS participants and endpoints inherit profiles by name:
vlink::DdsConf::load_global_qos_file("/etc/vlink/dds_profile.xml");
Note
This header is compiled only when VLINK_SUPPORT_DDS is defined.
qos and qos_ext are mutually exclusive; setting both causes is_valid() to return false.
Response topics are automatically registered with a "___resp" suffix.