Class FastDdsTransport
Defined in File fastdds_transport.hpp
Base Type
public nvidia::gxf::PubSubTransport
-
class FastDdsTransport : public nvidia::gxf::PubSubTransport
DDS-based implementation of PubSubTransport.
Uses FastDDS DataWriter/DataReader for message transport.
Public Functions
-
explicit FastDdsTransport(FastDdsPubSubContext *context)
Construct a FastDdsTransport with a FastDdsPubSubContext.
- Parameters
context – FastDdsPubSubContext providing DomainParticipant
-
~FastDdsTransport() override
Destructor - calls shutdown() if needed.
-
FastDdsTransport(const FastDdsTransport&) = delete
-
FastDdsTransport &operator=(const FastDdsTransport&) = delete
-
nvidia::gxf::Expected<void> initialize() override
-
nvidia::gxf::Expected<void> shutdown() override
-
bool is_initialized() const override
-
inline nvidia::gxf::TransportModel transport_model() const override
DDS is a topic-based transport.
PubSubContext uses this to call send(topic_name, …) once per publish instead of calling send(gid, …) once per subscriber.
-
inline bool native_topic_matching() const override
SEDP handles topic matching + QoS compatibility at the RTPS protocol level.
-
inline bool native_qos_enforcement() const override
RTPS-level reliability, durability, and deadline enforcement.
-
inline bool supports_multicast() const override
RTPS supports multicast for discovery and data.
-
inline bool requires_explicit_connections() const override
DDS DataWriters/DataReaders manage connections internally.
-
inline bool supports_native_buffers() const override
-
inline bool supports_mixed_local_remote_fanout() const override
-
inline bool supports_native_profile(const std::string &profile) const override
-
nvidia::gxf::Expected<void> send_native_descriptor(const std::string &topic_name, const nvidia::gxf::NativeDescriptorPayload &descriptor, const nvidia::gxf::MessageMetadata &metadata) override
Send a native descriptor on the sidecar topic “{topic}/_native_desc”.
-
void set_native_buffers_enabled(bool enabled)
Enable native buffer support (called by FastDdsPubSubNetworkContext)
-
nvidia::gxf::Expected<void> connect_to(const nvidia::gxf::EndpointInfo &remote_endpoint) override
No-op for DDS - discovery is automatic via SPDP/SEDP.
-
nvidia::gxf::Expected<void> disconnect_from(const nvidia::gxf::Gid &remote_gid) override
No-op for DDS - endpoint lifecycle managed by DDS.
-
bool is_connected_to(const nvidia::gxf::Gid &remote_gid) const override
Returns true for any endpoint (DDS handles discovery).
-
nvidia::gxf::Expected<void> create_publisher_endpoint(const std::string &topic_name, const nvidia::gxf::Gid &publisher_gid, const nvidia::gxf::QoSProfile &qos = nvidia::gxf::QoSProfile{}) override
Create a DataWriter for a topic.
Called automatically by PubSubContext::register_publisher(). Maps the QoSProfile to FastDDS DataWriterQos via dds_qos::apply_writer_qos().
- Parameters
topic_name – Name of the topic to publish to.
publisher_gid – GID to associate with this writer.
qos – QoS profile to apply to the DataWriter.
- Returns
Success or error if topic/writer creation fails.
-
nvidia::gxf::Expected<void> create_subscriber_endpoint(const std::string &topic_name, const nvidia::gxf::Gid &subscriber_gid, const nvidia::gxf::QoSProfile &qos = nvidia::gxf::QoSProfile{}) override
Create a DataReader for a topic.
Called automatically by PubSubContext::register_subscriber(). Maps the QoSProfile to FastDDS DataReaderQos via dds_qos::apply_reader_qos().
- Parameters
topic_name – Name of the topic to subscribe to.
subscriber_gid – GID to associate with this reader.
qos – QoS profile to apply to the DataReader.
- Returns
Success or error if topic/reader creation fails.
-
nvidia::gxf::Expected<void> remove_publisher_endpoint(const nvidia::gxf::Gid &publisher_gid) override
Remove a DataWriter.
Called automatically by PubSubContext::unregister_publisher() and PubSubContext::deinitialize(). For reliable QoS, calls wait_for_acknowledgments() before deletion.
- Parameters
publisher_gid – GID of the writer to remove.
- Returns
Success or error if writer not found.
-
nvidia::gxf::Expected<void> remove_subscriber_endpoint(const nvidia::gxf::Gid &subscriber_gid) override
Remove a DataReader.
Called automatically by PubSubContext::unregister_subscriber() and PubSubContext::deinitialize().
- Parameters
subscriber_gid – GID of the reader to remove.
- Returns
Success or error if reader not found.
-
nvidia::gxf::Expected<void> send(const nvidia::gxf::Gid &destination_gid, const std::vector<uint8_t> &payload, const nvidia::gxf::MessageMetadata &metadata) override
Send payload via DDS DataWriter (GID-based fallback).
This is the GID-based send required by the PubSubTransport interface. For kTopicBased transports, PubSubContext calls the topic-based send() overload instead, so this is a fallback only.
- Parameters
destination_gid – IGNORED - DDS publishes to topic, not endpoint.
payload – Serialized message (already staged to host memory).
metadata – Must contain publisher_gid identifying the writer.
- Returns
Success or error if no writer exists for the publisher.
-
nvidia::gxf::Expected<void> send(const std::string &topic_name, const std::vector<uint8_t> &payload, const nvidia::gxf::MessageMetadata &metadata) override
Send payload via DDS DataWriter (topic-based, preferred).
Looks up the DataWriter directly by topic name — no GID→topic mapping. This is the primary send path for DDS since transport_model() returns kTopicBased.
- Parameters
topic_name – Topic to publish on.
payload – Serialized message.
metadata – Message metadata (publisher_gid for diagnostics).
- Returns
Success or error if no writer exists for the topic.
-
void set_on_receive(ReceiveCallback callback) override
-
void set_on_connection_established(ConnectionEstablishedCallback callback) override
-
void set_on_connection_lost(ConnectionLostCallback callback) override
-
size_t get_send_queue_size() const override
-
size_t get_receive_queue_size() const override
-
size_t get_connection_count() const override
-
explicit FastDdsTransport(FastDdsPubSubContext *context)