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

Typed entity structs for the nros RMW C surface. More...

#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
Include dependency graph for rmw_entity.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_publisher_t
 
struct  nros_rmw_qos_t
 
struct  nros_rmw_service_client_t
 
struct  nros_rmw_service_server_t
 
struct  nros_rmw_session_t
 
struct  nros_rmw_subscriber_t
 

Macros

#define NROS_RMW_DURABILITY_TRANSIENT_LOCAL   1
 
#define NROS_RMW_DURABILITY_VOLATILE   0
 
#define NROS_RMW_HISTORY_KEEP_ALL   1
 
#define NROS_RMW_HISTORY_KEEP_LAST   0
 
#define NROS_RMW_QOS_PROFILE_DEFAULT
 
#define NROS_RMW_QOS_PROFILE_PARAMETERS
 
#define NROS_RMW_QOS_PROFILE_SENSOR_DATA
 
#define NROS_RMW_QOS_PROFILE_SERVICES_DEFAULT   NROS_RMW_QOS_PROFILE_DEFAULT
 
#define NROS_RMW_QOS_PROFILE_SYSTEM_DEFAULT   NROS_RMW_QOS_PROFILE_DEFAULT
 
#define NROS_RMW_RELIABILITY_BEST_EFFORT   0
 
#define NROS_RMW_RELIABILITY_RELIABLE   1
 

Enumerations

enum  nros_rmw_liveliness_kind_t { NROS_RMW_LIVELINESS_NONE = 0 , NROS_RMW_LIVELINESS_AUTOMATIC = 1 , NROS_RMW_LIVELINESS_MANUAL_BY_TOPIC = 2 , NROS_RMW_LIVELINESS_MANUAL_BY_NODE = 3 }
 

Detailed Description

Typed entity structs for the nros RMW C surface.

Same shape as upstream rmw.h's rmw_publisher_t / rmw_subscription_t family: visible metadata + a void * data tail (named backend_data here). No generic-handle typedef.

Lifetime rule. All const char * string fields are borrowed pointers — the storage pointing at them is owned by the caller (the runtime) and must outlive the entity. Backends never free or reallocate these strings; they hold them as-is for the entity's lifetime.

ABI commitment. These structs are part of the public ABI. Adding or reordering fields is a major version bump. Backends compile against this header and consumers compile against backend libraries — both sides must agree on the layout.

Forward-compat reserved bytes. Each entity carries an explicit _reserved[N] byte array sized to fill the natural alignment slot before backend_data. New fields up to N bytes can be added later without changing the struct's overall size or any field's offset after backend_data. Backends and runtime must zero the reserved bytes; the runtime relies on them being zero on read.

No-alloc + no-std preserved. No struct here owns heap-allocated storage. All metadata is either inline POD or a borrowed pointer.

Macro Definition Documentation

◆ NROS_RMW_DURABILITY_TRANSIENT_LOCAL

#define NROS_RMW_DURABILITY_TRANSIENT_LOCAL   1

◆ NROS_RMW_DURABILITY_VOLATILE

#define NROS_RMW_DURABILITY_VOLATILE   0

Durability policy values for nros_rmw_qos_t::durability.

◆ NROS_RMW_HISTORY_KEEP_ALL

#define NROS_RMW_HISTORY_KEEP_ALL   1

◆ NROS_RMW_HISTORY_KEEP_LAST

#define NROS_RMW_HISTORY_KEEP_LAST   0

History policy values for nros_rmw_qos_t::history.

◆ NROS_RMW_QOS_PROFILE_DEFAULT

#define NROS_RMW_QOS_PROFILE_DEFAULT
Value:
.liveliness_kind = NROS_RMW_LIVELINESS_AUTOMATIC, \
.depth = 10, \
._reserved0 = 0, \
.deadline_ms = 0, \
.lifespan_ms = 0, \
.liveliness_lease_ms = 0, \
.avoid_ros_namespace_conventions = 0, \
._reserved1 = {0, 0, 0}, \
})
#define NROS_RMW_DURABILITY_VOLATILE
Definition rmw_entity.h:47
#define NROS_RMW_HISTORY_KEEP_LAST
Definition rmw_entity.h:51
@ NROS_RMW_LIVELINESS_AUTOMATIC
Definition rmw_entity.h:60
#define NROS_RMW_RELIABILITY_RELIABLE
Definition rmw_entity.h:44
Definition rmw_entity.h:88

rmw_qos_profile_default-equivalent: reliable + volatile + keep-last(10), automatic liveliness, no deadline / lifespan.

◆ NROS_RMW_QOS_PROFILE_PARAMETERS

#define NROS_RMW_QOS_PROFILE_PARAMETERS
Value:
.liveliness_kind = NROS_RMW_LIVELINESS_AUTOMATIC, \
.depth = 1000, \
._reserved0 = 0, \
.deadline_ms = 0, \
.lifespan_ms = 0, \
.liveliness_lease_ms = 0, \
.avoid_ros_namespace_conventions = 0, \
._reserved1 = {0, 0, 0}, \
})

rmw_qos_profile_parameters-equivalent: reliable + volatile + keep-last(1000).

◆ NROS_RMW_QOS_PROFILE_SENSOR_DATA

#define NROS_RMW_QOS_PROFILE_SENSOR_DATA
Value:
.liveliness_kind = NROS_RMW_LIVELINESS_AUTOMATIC, \
.depth = 5, \
._reserved0 = 0, \
.deadline_ms = 0, \
.lifespan_ms = 0, \
.liveliness_lease_ms = 0, \
.avoid_ros_namespace_conventions = 0, \
._reserved1 = {0, 0, 0}, \
})
#define NROS_RMW_RELIABILITY_BEST_EFFORT
Definition rmw_entity.h:43

rmw_qos_profile_sensor_data-equivalent: best-effort + volatile + keep-last(5).

◆ NROS_RMW_QOS_PROFILE_SERVICES_DEFAULT

#define NROS_RMW_QOS_PROFILE_SERVICES_DEFAULT   NROS_RMW_QOS_PROFILE_DEFAULT

rmw_qos_profile_services_default-equivalent: reliable + volatile + keep-last(10).

◆ NROS_RMW_QOS_PROFILE_SYSTEM_DEFAULT

#define NROS_RMW_QOS_PROFILE_SYSTEM_DEFAULT   NROS_RMW_QOS_PROFILE_DEFAULT

rmw_qos_profile_system_default-equivalent: same as DEFAULT.

◆ NROS_RMW_RELIABILITY_BEST_EFFORT

#define NROS_RMW_RELIABILITY_BEST_EFFORT   0

Reliability policy values for nros_rmw_qos_t::reliability.

◆ NROS_RMW_RELIABILITY_RELIABLE

#define NROS_RMW_RELIABILITY_RELIABLE   1

Enumeration Type Documentation

◆ nros_rmw_liveliness_kind_t

Liveliness kind values for nros_rmw_qos_t::liveliness_kind.

Enumerator
NROS_RMW_LIVELINESS_NONE 

No liveliness assertion or tracking. Default for entities that don't care about liveliness.

NROS_RMW_LIVELINESS_AUTOMATIC 

Backend's keepalive task asserts liveliness automatically.

NROS_RMW_LIVELINESS_MANUAL_BY_TOPIC 

Application calls assert_liveliness() per topic explicitly.

NROS_RMW_LIVELINESS_MANUAL_BY_NODE 

Application calls assert_liveliness() at the node level.