VLink  2.0.0
A high-performance communication middleware
qos_profile.h File Reference

Curated catalogue of pre-built Qos instances for common VLink workloads. More...

#include <string>
#include <unordered_map>
#include "../base/macros.h"
#include "./qos.h"
Include dependency graph for qos_profile.h:

Go to the source code of this file.

Namespaces

 
 

Functions

VLINK_EXPORT const std::unordered_map< std::string, Qos > & vlink::QosProfile::get_available_qos_map () noexcept
 Returns the name-to-Qos lookup table containing every profile in this namespace. More...
 

Detailed Description

Curated catalogue of pre-built Qos instances for common VLink workloads.

Picking the right Qos for a topic involves balancing reliability, history depth, durability, publish mode and priority. This file declares sixteen ready-to-use constexpr profiles inside vlink::QosProfile, each tuned for a specific class of traffic encountered in autonomy and embedded stacks. Every profile is constructed with valid set to true and can be passed straight to any VLink endpoint or registered with a transport (DdsConf::register_qos) before being referenced from a URL.

Profile catalogue (use-case oriented):

Profile Reliability History Durability PublishMode Priority
kEvent Reliable KeepLast(5) Volatile Sync RealTime
kMethod Reliable KeepAll Volatile Sync High
kField Reliable KeepLast(1) TransientLocal Sync High
kSensor BestEffort KeepLast(10) Volatile ASync Normal*
kParameter Reliable KeepLast(500) TransientLocal Sync Normal
kService Reliable KeepLast(10) TransientLocal Sync Normal
kClock BestEffort KeepLast(1) Volatile Sync Low*
kStatic Reliable KeepAll TransientLocal Sync Normal
kLight Reliable KeepLast(1) Volatile ASync High
kPoor BestEffort KeepLast(5) Volatile ASync Background
kBetter BestEffort KeepLast(50) Volatile Sync RealTime
kBest Reliable KeepLast(200) Volatile Sync RealTime
kLarge Reliable (HB500) KeepLast(500) Volatile Sync Low
kAlarm Reliable KeepAll TransientLocal Sync RealTime*
kCommand Reliable KeepLast(1) Volatile Sync RealTime
kLog Reliable KeepLast(100) Volatile ASync Background

Profiles marked * (kSensor, kClock, kAlarm) are dispatched as express (the is_express flag is set). Use-case mapping: kEvent = discrete control events, kMethod = RPC, kField = latest-value state sync, kSensor = high-rate sensors, kParameter = slow config, kService = discovery, kClock = time sync, kStatic = maps / calibration, kLight = small frequent traffic, kPoor = low-priority telemetry, kBetter = best-effort throughput, kBest = reliable throughput, kLarge = large payload (heartbeat 500 ms), kAlarm = safety-critical alarms, kCommand = actuator commands, kLog = log streams.

Looking profiles up by name
if (auto it = qos_map.find("sensor"); it != qos_map.end()) {
vlink::DdsConf::register_qos("my_sensor_qos", it->second);
}
Using a profile by URL
// Built-in names are recognised directly in URLs:
auto pub = vlink::Publisher<MyMsg>::create_unique("dds://sensor_data?qos=sensor");
// Or apply a profile programmatically:
vlink::Qos qos = vlink::QosProfile::kField;
qos.history.depth = 5; // tweak the depth before use
vlink::DdsConf::register_qos("my_field_qos", qos);