File graph_sync.hpp
FileList > astutedds > rmw > graph_sync.hpp
Go to the source code of this file
Cross-process ROS 2 graph synchronisation over a hidden ros_discovery_info DDS topic.More...
#include <cstdint>#include <rmw/types.h>
Public Functions
| Type | Name |
|---|---|
| void | graph_notify_local_nodes (AstuteDDSContext * ctx) |
| void | graph_sync_fini (AstuteDDSContext * ctx) |
| bool | graph_sync_init (AstuteDDSContext * ctx, const char * enclave) |
| void | graph_sync_remote_entities (AstuteDDSContext * ctx) |
| rmw_gid_t | graph_to_rmw_gid (const uint8_t bytes) |
Detailed Description
AstuteDDS's own discovery surface has no ROS "node" concept on the wire (see AstuteDDSContext's doc comment), so this RMW — like every other ROS 2 RMW — layers node/entity ownership on top using the standard rmw_dds_common::GraphCache plus a well-known ParticipantEntitiesInfo topic that every participant publishes to and subscribes from. This file owns the raw DDS entities backing that topic and the small amount of glue needed to drive AstuteDDSContext::graph_ctx.
Public Functions Documentation
function graph_notify_local_nodes
void graph_notify_local_nodes (
AstuteDDSContext * ctx
)
Trigger every currently-alive local node's graph guard condition. Call after any local or remote graph_cache mutation.
function graph_sync_fini
void graph_sync_fini (
AstuteDDSContext * ctx
)
Tear down the ros_discovery_info reader/writer/topic. Called once from rmw_shutdown(), before the participant's other entities are destroyed.
function graph_sync_init
bool graph_sync_init (
AstuteDDSContext * ctx,
const char * enclave
)
Create the ros_discovery_info topic/writer/reader, resolve this context's participant GID, install the reader listener that feeds incoming ParticipantEntitiesInfo samples into graph_ctx.graph_cache, and register the local participant. Called once from rmw_init().
Returns:
true on success. On failure the context still works for single-process graph queries (degrades to pre-existing local-only behaviour); the caller only needs to log a warning.
function graph_sync_remote_entities
void graph_sync_remote_entities (
AstuteDDSContext * ctx
)
Refresh graph_ctx.graph_cache's entity records (topic name / type / best-effort QoS) for every remote publisher and subscription this participant currently sees over SEDP. Idempotent — safe to call before every node-scoped topic query. Remote entity-to-node association still comes separately, over the wire, from each remote participant's own ParticipantEntitiesInfo updates; this only supplies the per-entity topic/type/QoS metadata GraphCache needs to answer _by_node queries, since AstuteDDS's C API only exposes discovery as a poll, not a persistent callback.
function graph_to_rmw_gid
rmw_gid_t graph_to_rmw_gid (
const uint8_t bytes
)
Convert a 16-byte AstuteDDS GID into an rmw_gid_t tagged with this RMW's implementation identifier.
The documentation for this class was generated from the following file include/astutedds/rmw/graph_sync.hpp