|
nros rmw-cffi
C vtable for plugging a third-party RMW backend into nros
|
Tier-1 status events: liveliness changes, deadline misses, message loss. More...


Go to the source code of this file.
Data Structures | |
| struct | rmw_count_status_t |
| union | rmw_event_payload_t |
| struct | rmw_incompatible_type_status_t |
| struct | rmw_liveliness_changed_status_t |
| struct | rmw_matched_status_t |
Typedefs | |
| typedef void(* | rmw_event_callback_t) (const void *user_data, size_t number_of_events) |
| typedef void(* | rmw_status_event_callback_t) (rmw_event_type_t kind, const rmw_event_payload_t *payload, void *user_context) |
Tier-1 status events: liveliness changes, deadline misses, message loss.
The status-event surface for the nros RMW C vtable. Backends advertise per-event support; applications register a callback per (entity, event kind) pair.
Dispatch model. Callback-on-entity. Backends fire registered callbacks from inside drive_io when the event is detected — same thread, same priority, same constraints as message callbacks. No waitset, no take-event polling. See book/src/communicate/qos-status-events.md and book/src/extending/rmw-vs-upstream.md Section 8 for the design.
Matched and incompatible-type events (issue 1972). Iron/Jazzy's RMW_EVENT_{PUBLICATION,SUBSCRIPTION}_MATCHED and RMW_EVENT_{PUBLISHER,SUBSCRIPTION}_INCOMPATIBLE_TYPE are values 5..8, APPENDED. Upstream inserted them in the middle of its enum; ours was never value-compatible with upstream's (ours numbers LIVELINESS_LOST 3, upstream numbers it 6), so appending keeps every existing value and every compiled backend's switch arms. They travel through the same *_event_init / *_take_event slots as the Tier-1 kinds — no new slot.
Upstream's QOS_INCOMPATIBLE is still surfaced synchronously at create-time as NROS_RMW_RET_INCOMPATIBLE_QOS rather than as a runtime event.
| typedef void(* rmw_event_callback_t) (const void *user_data, size_t number_of_events) |
Upstream rmw_event_callback_t — the callback the set_on_new_* slots install. Distinct from rmw_status_event_callback_t above, which is the DDS STATUS-event callback; upstream binds this name to this shape and we now match it.
| typedef void(* rmw_status_event_callback_t) (rmw_event_type_t kind, const rmw_event_payload_t *payload, void *user_context) |
User callback invoked when an event fires.
| kind | Identifies which member of payload is valid. |
| payload | Pointer is valid for the duration of this call only — copy fields if needed beyond return. |
| user_context | Opaque pointer registered with the callback. |
Threading. Invoked on whatever context the BACKEND delivers on, which is not uniform and is not drive_io. This paragraph claimed "invoked from inside `drive_io` on the executor thread" until 2026-08-25; no backend did that, and the claim was load-bearing — it was the stated reason rmw_take_event could be declined (issue 0780). zenoh fires from take and has_data; a DDS backend's listeners fire on its own worker thread.
So: must not block, and must assume it may be running concurrently with the executor. A backend with no safe context to deliver from should leave *_event_init NULL and implement *_take_event instead, which hands the caller the deferral upstream gets from its wait set.
| enum rmw_event_type_t |
Status event kinds. Stable integer values; new kinds extend the enum at the END, never in the middle.