nros rmw-cffi
C vtable for plugging a third-party RMW backend into nros
Loading...
Searching...
No Matches
Data Structures | Typedefs | Enumerations
rmw_event.h File Reference

Tier-1 status events: liveliness changes, deadline misses, message loss. More...

#include <stdint.h>
#include <stddef.h>
#include "nros/rmw_ret.h"
Include dependency graph for rmw_event.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nros_rmw_count_status_t
 
union  nros_rmw_event_payload_t
 
struct  nros_rmw_liveliness_changed_status_t
 

Typedefs

typedef void(* nros_rmw_event_callback_t) (nros_rmw_event_kind_t kind, const nros_rmw_event_payload_t *payload, void *user_context)
 

Enumerations

enum  nros_rmw_event_kind_t {
  NROS_RMW_EVENT_LIVELINESS_CHANGED = 0 , NROS_RMW_EVENT_REQUESTED_DEADLINE_MISSED = 1 , NROS_RMW_EVENT_MESSAGE_LOST = 2 , NROS_RMW_EVENT_LIVELINESS_LOST = 3 ,
  NROS_RMW_EVENT_OFFERED_DEADLINE_MISSED = 4
}
 

Detailed Description

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/concepts/status-events.md and book/src/design/rmw-vs-upstream.md Section 8 for the design.

Tier-2 / Tier-3 events skipped. MATCHED (Tier-2) is deferred until dynamic-discovery use cases appear — additive without ABI break (the enum is integer-valued; unknown values pass through). QOS_INCOMPATIBLE and INCOMPATIBLE_TYPE (Tier-3) are surfaced synchronously at create-time as nros_rmw_ret_t codes (NROS_RMW_RET_INCOMPATIBLE_QOS, NROS_RMW_RET_TOPIC_NAME_INVALID) rather than as runtime events.

Typedef Documentation

◆ nros_rmw_event_callback_t

typedef void(* nros_rmw_event_callback_t) (nros_rmw_event_kind_t kind, const nros_rmw_event_payload_t *payload, void *user_context)

User callback invoked when an event fires.

Parameters
kindIdentifies which member of payload is valid.
payloadPointer is valid for the duration of this call only — copy fields if needed beyond return.
user_contextOpaque pointer registered with the callback.

Threading. Invoked from inside drive_io on the executor thread. Must not block; long work should defer via a guard condition or queue.

Enumeration Type Documentation

◆ nros_rmw_event_kind_t

Tier-1 event kinds. Stable integer values; future kinds (Tier-2) extend the enum at end.

Enumerator
NROS_RMW_EVENT_LIVELINESS_CHANGED 

Subscriber: a tracked publisher's liveliness state changed.

NROS_RMW_EVENT_REQUESTED_DEADLINE_MISSED 

Subscriber: an expected sample didn't arrive within the configured deadline.

NROS_RMW_EVENT_MESSAGE_LOST 

Subscriber: backend dropped a sample (overflow / etc.).

NROS_RMW_EVENT_LIVELINESS_LOST 

Publisher: this publisher missed its own liveliness assertion.

NROS_RMW_EVENT_OFFERED_DEADLINE_MISSED 

Publisher: this publisher promised X Hz, fell behind.