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

Pre-defined QoS profiles for common VLink communication patterns. 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 a reference to the global map of all named QoS profiles.

Detailed Description

Pre-defined QoS profiles for common VLink communication patterns.

The QosProfile namespace provides a set of ready-to-use Qos constant instances covering the most common autonomy and embedded system use cases. Each profile has valid = true and can be passed directly to any VLink endpoint.

Available profiles:

Profile Reliability History Durability PubMode Priority Use case
kEvent Reliable KeepLast(10) Volatile Sync RealTime Discrete control events
kMethod Reliable KeepAll(1) Volatile Sync High RPC request/response
kField Reliable KeepLast(1) TransientLocal Sync High Latest-value state sync
kSensor BestEffort KeepLast(20) Volatile ASync Normal High-rate sensor data
kParameter Reliable KeepLast(1000) Volatile Sync Normal Configuration parameters
kService Reliable KeepLast(10) TransientLocal Sync Normal Service discovery
kClock BestEffort KeepLast(1) Volatile ASync Low Time synchronisation
kStatic Reliable KeepAll(1) TransientLocal Sync Normal Static/slow-changing data
kLight Reliable KeepLast(1) Volatile ASync High Lightweight fast messaging
kPoor BestEffort KeepLast(5) Volatile ASync Background Low-priority best-effort
kBetter BestEffort KeepLast(50) Volatile Sync RealTime High-throughput best-effort
kBest Reliable KeepLast(200) Volatile Sync RealTime High-throughput reliable
kLarge Reliable KeepLast(500) Volatile Sync Low Large payload transfers
Lookup by name
get_available_qos_map() returns an unordered_map from profile name string to Qos, enabling runtime profile selection:
auto it = qos_map.find("sensor");
if (it != qos_map.end()) {
pub->set_qos(it->second);
}
Direct usage
auto pub = vlink::Publisher<MyMsg>::create("dds://sensor_data");
pub->set_qos(vlink::QosProfile::kSensor);