Holoscan SDK v4.2.0

Class FastDdsDiscovery

Base Type

  • public nvidia::gxf::PubSubDiscovery

class FastDdsDiscovery : public nvidia::gxf::PubSubDiscovery

DDS-based implementation of PubSubDiscovery.

Wraps FastDDS’s built-in SPDP/SEDP discovery protocols.

The announce_publisher and announce_subscriber methods don’t actually register with an external service; instead, they track local endpoints while DDS handles the actual discovery via SEDP.

Discovery callbacks are driven by DDS listener events.

Public Functions

explicit FastDdsDiscovery(FastDdsPubSubContext *context)

Construct a FastDdsDiscovery with a FastDdsPubSubContext.

Parameters

contextFastDdsPubSubContext providing DomainParticipant

~FastDdsDiscovery() override

Destructor - calls shutdown() if needed.

FastDdsDiscovery(const FastDdsDiscovery&) = delete
FastDdsDiscovery &operator=(const FastDdsDiscovery&) = delete
nvidia::gxf::Expected<void> initialize() override
nvidia::gxf::Expected<void> shutdown() override
bool is_initialized() const override
inline nvidia::gxf::DiscoveryModel discovery_model() const override

DDS uses decentralized passive discovery (SPDP/SEDP). announce_publisher()/announce_subscriber() are local bookkeeping only; actual network discovery happens when DataWriters/DataReaders are created.

nvidia::gxf::Expected<void> announce_publisher(const nvidia::gxf::PublisherInfo &info) override

Announce a local publisher (no-op for DDS).

Local endpoint tracking is handled by the shared TopicRegistry (set by PubSubContext via set_topic_registry()). The actual DDS discovery happens when FastDdsTransport::create_publisher_endpoint() creates the DataWriter.

nvidia::gxf::Expected<void> announce_subscriber(const nvidia::gxf::SubscriberInfo &info) override

Announce a local subscriber (no-op for DDS).

Local endpoint tracking is handled by the shared TopicRegistry (set by PubSubContext via set_topic_registry()). The actual DDS discovery happens when FastDdsTransport::create_subscriber_endpoint() creates the DataReader.

nvidia::gxf::Expected<void> remove_publisher(const nvidia::gxf::PublisherGid &gid) override
nvidia::gxf::Expected<void> remove_subscriber(const nvidia::gxf::SubscriberGid &gid) override
nvidia::gxf::Expected<std::vector<nvidia::gxf::PublisherInfo>> query_publishers(const std::string &topic_name) override

Query discovered publishers on a topic.

Parameters

topic_name – Topic to query (empty string returns all publishers)

Returns

List of publisher info, or error

nvidia::gxf::Expected<std::vector<nvidia::gxf::SubscriberInfo>> query_subscribers(const std::string &topic_name) override

Query discovered subscribers on a topic.

Parameters

topic_name – Topic to query (empty string returns all subscribers)

Returns

List of subscriber info, or error

nvidia::gxf::Expected<std::vector<std::string>> get_all_topics() override

Get all known topic names.

Returns

List of topic names with at least one publisher or subscriber

void set_on_publisher_discovered(PublisherDiscoveredCallback callback) override
void set_on_subscriber_discovered(SubscriberDiscoveredCallback callback) override
void set_on_publisher_lost(PublisherLostCallback callback) override
void set_on_subscriber_lost(SubscriberLostCallback callback) override
inline void set_local_native_capability(const nvidia::gxf::NativeBufferCapability &cap)

Set the local NativeBufferCapability to be serialized into participant UserData. Must be called before initialize() (the participant is already created by that point, so the capability is set during FastDdsPubSubContext::initialize()).

inline nvidia::gxf::NativeBufferCapability local_native_capability(int device_id = -1) const override

Public Static Functions

static std::vector<uint8_t> serialize_native_capability(const nvidia::gxf::NativeBufferCapability &cap)

Serialize NativeBufferCapability into participant UserData QoS bytes.

static nvidia::gxf::NativeBufferCapability parse_native_capability(const std::vector<uint8_t> &user_data)

Parse NativeBufferCapability from participant UserData QoS bytes.

Previous Class ExtensionManager
Next Class FastDdsEndpoint
© Copyright 2022-2026, NVIDIA. Last updated on May 11, 2026