nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
nros::QoS Class Reference

#include <qos.hpp>

Public Types

enum  Liveliness { LivelinessNone = 0 , LivelinessAutomatic = 1 , LivelinessManualByTopic = 2 , LivelinessManualByNode = 3 }
 Liveliness policy kind. Matches DDS LIVELINESS_QOS_POLICY. More...
 

Public Member Functions

constexpr bool avoid_ros_namespace_conventions () const
 Whether to skip the /rt/ ROS topic-name prefix.
 
constexpr QoSavoid_ros_namespace_conventions (bool on)
 
constexpr QoSbest_effort ()
 Set reliability to BEST_EFFORT (fire-and-forget; default for sensors).
 
constexpr uint32_t deadline_ms () const
 Deadline in ms (0 = infinite).
 
constexpr QoSdeadline_ms (uint32_t ms)
 
constexpr int depth () const
 Configured queue depth (only meaningful for KEEP_LAST).
 
constexpr int durability_raw () const
 Durability as a raw int (0 = Volatile, 1 = TransientLocal).
 
constexpr QoSdurability_volatile ()
 Set durability to VOLATILE — late joiners get nothing (default).
 
constexpr int history_raw () const
 History as a raw int (0 = KeepLast, 1 = KeepAll).
 
constexpr QoSkeep_all ()
 Use KEEP_ALL history (bounded by transport).
 
constexpr QoSkeep_last (int depth)
 
constexpr uint32_t lifespan_ms () const
 Lifespan in ms (0 = infinite).
 
constexpr QoSlifespan_ms (uint32_t ms)
 Sample expiry. 0 = infinite.
 
constexpr QoSliveliness (Liveliness kind)
 
constexpr uint32_t liveliness_lease_ms () const
 Liveliness lease in ms (0 = infinite).
 
constexpr QoSliveliness_lease_ms (uint32_t ms)
 Liveliness lease duration. 0 = infinite.
 
constexpr int liveliness_raw () const
 Liveliness kind as a raw int (0..3).
 
constexpr QoS ()
 
constexpr int reliability_raw () const
 Reliability as a raw int (0 = Reliable, 1 = BestEffort).
 
constexpr QoSreliable ()
 Set reliability to RELIABLE (acked transport, retransmits on loss).
 
constexpr QoStransient_local ()
 Set durability to TRANSIENT_LOCAL — late joiners get the last value.
 

Static Public Member Functions

static constexpr QoS default_profile ()
 Default profile: RELIABLE + VOLATILE + KEEP_LAST(10).
 
static constexpr QoS sensor_data ()
 Sensor-data profile: BEST_EFFORT + VOLATILE + KEEP_LAST(5).
 
static constexpr QoS services ()
 Services profile: RELIABLE + VOLATILE + KEEP_LAST(10).
 

Detailed Description

QoS profile for publishers and subscriptions.

Mirrors rclcpp::QoS with chainable setters and predefined profiles. All methods are constexpr — profiles can be computed at compile time.

Phase 108.B.7 — extended with full DDS QoS surface (deadline, lifespan, liveliness kind + lease, avoid_ros_namespace_conventions). Backends advertise per-policy support; entities created with a profile the active backend can't honour return NROS_CPP_RET_INCOMPATIBLE_QOS synchronously at create time.

Member Enumeration Documentation

◆ Liveliness

Liveliness policy kind. Matches DDS LIVELINESS_QOS_POLICY.

Enumerator
LivelinessNone 
LivelinessAutomatic 
LivelinessManualByTopic 
LivelinessManualByNode 

Constructor & Destructor Documentation

◆ QoS()

constexpr nros::QoS::QoS ( )
inlineconstexpr

Default QoS: reliable, volatile, keep-last(10), automatic liveliness, no deadline / lifespan / lease.

Member Function Documentation

◆ avoid_ros_namespace_conventions() [1/2]

constexpr bool nros::QoS::avoid_ros_namespace_conventions ( ) const
inlineconstexpr

Whether to skip the /rt/ ROS topic-name prefix.

◆ avoid_ros_namespace_conventions() [2/2]

constexpr QoS & nros::QoS::avoid_ros_namespace_conventions ( bool  on)
inlineconstexpr

Skip the ROS /rt/ topic-name prefix. Off by default; enable when interoperating with non-ROS DDS endpoints.

◆ best_effort()

constexpr QoS & nros::QoS::best_effort ( )
inlineconstexpr

Set reliability to BEST_EFFORT (fire-and-forget; default for sensors).

◆ deadline_ms() [1/2]

constexpr uint32_t nros::QoS::deadline_ms ( ) const
inlineconstexpr

Deadline in ms (0 = infinite).

◆ deadline_ms() [2/2]

constexpr QoS & nros::QoS::deadline_ms ( uint32_t  ms)
inlineconstexpr

Subscriber max-inter-arrival / publisher offered-rate. 0 = infinite (no deadline check).

◆ default_profile()

static constexpr QoS nros::QoS::default_profile ( )
inlinestaticconstexpr

Default profile: RELIABLE + VOLATILE + KEEP_LAST(10).

◆ depth()

constexpr int nros::QoS::depth ( ) const
inlineconstexpr

Configured queue depth (only meaningful for KEEP_LAST).

◆ durability_raw()

constexpr int nros::QoS::durability_raw ( ) const
inlineconstexpr

Durability as a raw int (0 = Volatile, 1 = TransientLocal).

◆ durability_volatile()

constexpr QoS & nros::QoS::durability_volatile ( )
inlineconstexpr

Set durability to VOLATILE — late joiners get nothing (default).

◆ history_raw()

constexpr int nros::QoS::history_raw ( ) const
inlineconstexpr

History as a raw int (0 = KeepLast, 1 = KeepAll).

◆ keep_all()

constexpr QoS & nros::QoS::keep_all ( )
inlineconstexpr

Use KEEP_ALL history (bounded by transport).

◆ keep_last()

constexpr QoS & nros::QoS::keep_last ( int  depth)
inlineconstexpr

Use KEEP_LAST history with the given depth.

Parameters
depthmaximum number of messages buffered per entity.

◆ lifespan_ms() [1/2]

constexpr uint32_t nros::QoS::lifespan_ms ( ) const
inlineconstexpr

Lifespan in ms (0 = infinite).

◆ lifespan_ms() [2/2]

constexpr QoS & nros::QoS::lifespan_ms ( uint32_t  ms)
inlineconstexpr

Sample expiry. 0 = infinite.

◆ liveliness()

constexpr QoS & nros::QoS::liveliness ( Liveliness  kind)
inlineconstexpr

Liveliness kind. Pair with liveliness_lease_ms() for MANUAL_BY_TOPIC / MANUAL_BY_NODE. AUTOMATIC is the default.

◆ liveliness_lease_ms() [1/2]

constexpr uint32_t nros::QoS::liveliness_lease_ms ( ) const
inlineconstexpr

Liveliness lease in ms (0 = infinite).

◆ liveliness_lease_ms() [2/2]

constexpr QoS & nros::QoS::liveliness_lease_ms ( uint32_t  ms)
inlineconstexpr

Liveliness lease duration. 0 = infinite.

◆ liveliness_raw()

constexpr int nros::QoS::liveliness_raw ( ) const
inlineconstexpr

Liveliness kind as a raw int (0..3).

◆ reliability_raw()

constexpr int nros::QoS::reliability_raw ( ) const
inlineconstexpr

Reliability as a raw int (0 = Reliable, 1 = BestEffort).

◆ reliable()

constexpr QoS & nros::QoS::reliable ( )
inlineconstexpr

Set reliability to RELIABLE (acked transport, retransmits on loss).

◆ sensor_data()

static constexpr QoS nros::QoS::sensor_data ( )
inlinestaticconstexpr

Sensor-data profile: BEST_EFFORT + VOLATILE + KEEP_LAST(5).

◆ services()

static constexpr QoS nros::QoS::services ( )
inlinestaticconstexpr

Services profile: RELIABLE + VOLATILE + KEEP_LAST(10).

◆ transient_local()

constexpr QoS & nros::QoS::transient_local ( )
inlineconstexpr

Set durability to TRANSIENT_LOCAL — late joiners get the last value.


The documentation for this class was generated from the following file: