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 | Static Public Attributes | List of all members
nros::QoS Class Reference

#include <qos.hpp>

Public Types

using Liveliness = LivelinessPolicy
 Deprecated spelling of nros::LivelinessPolicy.
 

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 Duration deadline () const
 The deadline window. Duration() (zero) = infinite.
 
constexpr QoSdeadline (const Duration &d)
 
constexpr uint32_t deadline_ms () const
 
constexpr QoSdeadline_ms (uint32_t ms)
 
constexpr int depth () const
 Configured queue depth (only meaningful for KEEP_LAST).
 
constexpr DurabilityPolicy durability () const
 The durability policy.
 
constexpr int durability_raw () const
 
constexpr QoSdurability_volatile ()
 Set durability to VOLATILE — late joiners get nothing (default).
 
constexpr HistoryPolicy history () const
 The history policy.
 
constexpr int history_raw () const
 
constexpr QoSkeep_all ()
 Use KEEP_ALL history (bounded by transport).
 
constexpr QoSkeep_last (int depth)
 
constexpr Duration lifespan () const
 The lifespan window. Duration() (zero) = infinite.
 
constexpr QoSlifespan (const Duration &d)
 
constexpr uint32_t lifespan_ms () const
 
constexpr QoSlifespan_ms (uint32_t ms)
 
constexpr LivelinessPolicy liveliness () const
 The liveliness policy kind.
 
constexpr QoSliveliness (LivelinessPolicy kind)
 
constexpr Duration liveliness_lease_duration () const
 The liveliness lease window. Duration() (zero) = infinite.
 
constexpr QoSliveliness_lease_duration (const Duration &d)
 
constexpr uint32_t liveliness_lease_ms () const
 
constexpr QoSliveliness_lease_ms (uint32_t ms)
 
constexpr int liveliness_raw () const
 
constexpr QoS ()
 
constexpr QoS (int depth)
 
constexpr ReliabilityPolicy reliability () const
 The reliability policy.
 
constexpr int reliability_raw () const
 
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.
 
constexpr bool tx_express () const
 Whether this publisher's samples bypass transport tx batching.
 
constexpr QoStx_express (bool on)
 

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).
 

Static Public Attributes

static constexpr LivelinessPolicy LivelinessAutomatic
 
static constexpr LivelinessPolicy LivelinessManualByNode
 
static constexpr LivelinessPolicy LivelinessManualByTopic = ::nros::LivelinessManualByTopic
 
static constexpr LivelinessPolicy LivelinessNone
 

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.

Phase 379 W5 — the policy enums moved to namespace scope, the getters return them instead of int, and the three time windows take and return nros::Duration instead of carrying an _ms suffix. Every old spelling still compiles and is [[deprecated]].

Member Typedef Documentation

◆ Liveliness

Deprecated spelling of nros::LivelinessPolicy.

Constructor & Destructor Documentation

◆ QoS() [1/2]

constexpr nros::QoS::QoS ( )
inlineconstexpr

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

◆ QoS() [2/2]

constexpr nros::QoS::QoS ( int  depth)
inlineexplicitconstexpr

rclcpp-shape depth ctor: QoS(1) == default profile with keep-last(1). Lets ported rclcpp code (rclcpp::QoS{1}.transient_local()) keep its spelling on the native surface.

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() [1/2]

constexpr Duration nros::QoS::deadline ( ) const
inlineconstexpr

The deadline window. Duration() (zero) = infinite.

◆ deadline() [2/2]

constexpr QoS & nros::QoS::deadline ( const Duration &  d)
inlineconstexpr

Subscriber max-inter-arrival / publisher offered-rate. A zero or negative duration = infinite (no deadline check).

The C ABI underneath is uint32_t milliseconds, so a sub-millisecond window ROUNDS UP to 1 ms — it never truncates to 0, which the ABI reads as infinity. Above ~49.7 days it saturates. See detail::qos_window_ms.

◆ deadline_ms() [1/2]

constexpr uint32_t nros::QoS::deadline_ms ( ) const
inlineconstexpr
Deprecated:
Use deadline(), which returns nros::Duration.

◆ deadline_ms() [2/2]

constexpr QoS & nros::QoS::deadline_ms ( uint32_t  ms)
inlineconstexpr
Deprecated:
Use deadline(nros::Duration).

◆ 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()

constexpr DurabilityPolicy nros::QoS::durability ( ) const
inlineconstexpr

The durability policy.

◆ durability_raw()

constexpr int nros::QoS::durability_raw ( ) const
inlineconstexpr
Deprecated:
Use durability(), which returns DurabilityPolicy.

◆ durability_volatile()

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

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

◆ history()

constexpr HistoryPolicy nros::QoS::history ( ) const
inlineconstexpr

The history policy.

◆ history_raw()

constexpr int nros::QoS::history_raw ( ) const
inlineconstexpr
Deprecated:
Use history(), which returns HistoryPolicy.

◆ 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() [1/2]

constexpr Duration nros::QoS::lifespan ( ) const
inlineconstexpr

The lifespan window. Duration() (zero) = infinite.

◆ lifespan() [2/2]

constexpr QoS & nros::QoS::lifespan ( const Duration &  d)
inlineconstexpr

Sample expiry. A zero or negative duration = infinite. Same millisecond boundary as deadline().

◆ lifespan_ms() [1/2]

constexpr uint32_t nros::QoS::lifespan_ms ( ) const
inlineconstexpr
Deprecated:
Use lifespan(), which returns nros::Duration.

◆ lifespan_ms() [2/2]

constexpr QoS & nros::QoS::lifespan_ms ( uint32_t  ms)
inlineconstexpr
Deprecated:
Use lifespan(nros::Duration).

◆ liveliness() [1/2]

constexpr LivelinessPolicy nros::QoS::liveliness ( ) const
inlineconstexpr

The liveliness policy kind.

◆ liveliness() [2/2]

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

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

◆ liveliness_lease_duration() [1/2]

constexpr Duration nros::QoS::liveliness_lease_duration ( ) const
inlineconstexpr

The liveliness lease window. Duration() (zero) = infinite.

◆ liveliness_lease_duration() [2/2]

constexpr QoS & nros::QoS::liveliness_lease_duration ( const Duration &  d)
inlineconstexpr

Liveliness lease duration. A zero or negative duration = infinite. Same millisecond boundary as deadline().

◆ liveliness_lease_ms() [1/2]

constexpr uint32_t nros::QoS::liveliness_lease_ms ( ) const
inlineconstexpr
Deprecated:
Use liveliness_lease_duration(), which returns nros::Duration.

◆ liveliness_lease_ms() [2/2]

constexpr QoS & nros::QoS::liveliness_lease_ms ( uint32_t  ms)
inlineconstexpr
Deprecated:
Use liveliness_lease_duration(nros::Duration).

◆ liveliness_raw()

constexpr int nros::QoS::liveliness_raw ( ) const
inlineconstexpr
Deprecated:
Use liveliness(), which returns LivelinessPolicy.

◆ reliability()

constexpr ReliabilityPolicy nros::QoS::reliability ( ) const
inlineconstexpr

The reliability policy.

◆ reliability_raw()

constexpr int nros::QoS::reliability_raw ( ) const
inlineconstexpr
Deprecated:
Use reliability(), which returns ReliabilityPolicy.

◆ 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.

◆ tx_express() [1/2]

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

Whether this publisher's samples bypass transport tx batching.

◆ tx_express() [2/2]

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

Phase 282 (#145) — mark this publisher "express": its samples bypass transport tx batching (sent immediately even when the batching knob is on). A transport hint for control-tier / latency-sensitive topics; ignored on subscriptions and by backends without batching.

Member Data Documentation

◆ LivelinessAutomatic

constexpr LivelinessPolicy nros::QoS::LivelinessAutomatic
staticconstexpr
Initial value:
=
@ LivelinessAutomatic
Definition qos.hpp:118

◆ LivelinessManualByNode

constexpr LivelinessPolicy nros::QoS::LivelinessManualByNode
staticconstexpr
Initial value:
=
@ LivelinessManualByNode
Definition qos.hpp:120

◆ LivelinessManualByTopic

constexpr LivelinessPolicy nros::QoS::LivelinessManualByTopic = ::nros::LivelinessManualByTopic
staticconstexpr

◆ LivelinessNone

constexpr LivelinessPolicy nros::QoS::LivelinessNone
staticconstexpr
Initial value:
=
@ LivelinessNone
Definition qos.hpp:117

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