Class astutedds::rtps::RtpsUdpTransport

ClassList > astutedds > rtps > RtpsUdpTransport

RTPS UDP transport with full discovery and reliable delivery. More...

  • #include <udp_transport.hpp>

Classes

Type Name
struct TopicTrafficStats
Per-topic traffic counters (user data only, not discovery traffic)

Public Types

Type Name
typedef std::function< void(const std::string &topicName, const std::vector< std::string > &fieldNames)> TypeLookupCallback

Public Functions

Type Name
RtpsUdpTransport (uint32_t domainId=0)
RtpsUdpTransport (uint32_t domainId, uint32_t participantId)
RtpsUdpTransport (const RtpsUdpTransport &) = delete
const DiscoveryConfig & discovery_config () const
std::vector< DiscoveredReader > get_all_discovered_readers () const
Get all discovered readers across all topics (§8.5.4)
std::vector< DiscoveredWriter > get_all_discovered_writers () const
Get all discovered writers across all topics (§8.5.3)
std::map< std::string, TopicTrafficStats > get_all_traffic_stats () const
Get current per-topic traffic statistics.
std::vector< DiscoveredParticipant > get_discovered_participants () const
Get discovered participants.
std::vector< DiscoveredReader > get_discovered_readers (const std::string & topicName) const
Get discovered readers for a topic.
std::vector< DiscoveredWriter > get_discovered_writers (const std::string & topicName) const
Get discovered writers for a topic.
DiscoveryRuntimeInfo get_discovery_runtime_info () const
Returns effective runtime discovery settings and peers.
const GuidPrefix_t & guid_prefix () const
Get the GUID prefix for this participant.
bool init ()
Initialize the transport (creates sockets, starts discovery)
bool is_running () const
Check if transport is running.
bool load_discovery_config_file (const std::string & path)
RtpsUdpTransport & operator= (const RtpsUdpTransport &) = delete
uint32_t participant_id () const
Get the participant ID.
bool publish (const std::string & topicName, const std::vector< uint8_t > & data)
Publish data on a topic.
bool publish (const std::string & topicName, const std::vector< uint8_t > & xcdr1Data, const std::vector< uint8_t > & xcdr2Data)
Publish data on a topic with dual encoding.
EntityId_t register_reader (const std::string & topicName, const std::string & typeName, const std::vector< std::string > & partitions={}, const dcps::DataReaderQos & qos={})
Register a reader for a topic.
EntityId_t register_writer (const std::string & topicName, const std::string & typeName, const std::vector< std::string > & partitions={}, const dcps::DataWriterQos & qos={})
Register a writer for a topic.
bool reload_discovery_config ()
Reload the existing discovery JSON path (if configured).
void send_type_lookup_request (const GuidPrefix_t & remoteGuid, const std::array< uint8_t, 4 > & metatrafficAddr, uint16_t metatrafficPort, const std::string & topicName, const std::array< uint8_t, 14 > & hash)
void set_data_callback (DataReceivedCallback callback)
Set callback for received data.
void set_discovery_config (const DiscoveryConfig & config)
Apply discovery config (explicit peers and interface filters).
void set_participant_discovered_callback (ParticipantDiscoveredCallback callback)
Set callback for participant discovery.
void set_reader_discovered_callback (ReaderDiscoveredCallback callback)
Set callback for reader discovery.
void set_type_lookup_callback (TypeLookupCallback cb)
Register a callback to receive type schema from TLS replies.
void set_writer_discovered_callback (WriterDiscoveredCallback callback)
Set callback for writer discovery.
void stop ()
Stop the transport.
void subscribe (const std::string & topicName)
Subscribe to a topic (enables reception)
void unregister_reader (const EntityId_t & entityId)
Unregister a reader.
void unregister_writer (const EntityId_t & entityId)
Unregister a writer.
void unsubscribe (const std::string & topicName)
Unsubscribe from a topic.
~RtpsUdpTransport ()

Detailed Description

Provides interoperability with: * eProsima Fast DDS * Eclipse Cyclone DDS * RTI Connext DDS * OpenDDS

Public Types Documentation

typedef TypeLookupCallback

using astutedds::rtps::RtpsUdpTransport::TypeLookupCallback =  std::function<void(const std::string& topicName, const std::vector<std::string>& fieldNames)>;

Callback fired when a TypeLookup_Reply delivers field names for a topic. Invoked from the receive thread — callers must marshal to their own thread.


Public Functions Documentation

function RtpsUdpTransport [1/3]

explicit astutedds::rtps::RtpsUdpTransport::RtpsUdpTransport (
    uint32_t domainId=0
) 

function RtpsUdpTransport [2/3]

astutedds::rtps::RtpsUdpTransport::RtpsUdpTransport (
    uint32_t domainId,
    uint32_t participantId
) 

function RtpsUdpTransport [3/3]

astutedds::rtps::RtpsUdpTransport::RtpsUdpTransport (
    const RtpsUdpTransport &
) = delete

function discovery_config

inline const DiscoveryConfig & astutedds::rtps::RtpsUdpTransport::discovery_config () const

function get_all_discovered_readers

Get all discovered readers across all topics (§8.5.4)

std::vector< DiscoveredReader > astutedds::rtps::RtpsUdpTransport::get_all_discovered_readers () const


function get_all_discovered_writers

Get all discovered writers across all topics (§8.5.3)

std::vector< DiscoveredWriter > astutedds::rtps::RtpsUdpTransport::get_all_discovered_writers () const


function get_all_traffic_stats

Get current per-topic traffic statistics.

std::map< std::string, TopicTrafficStats > astutedds::rtps::RtpsUdpTransport::get_all_traffic_stats () const


function get_discovered_participants

Get discovered participants.

std::vector< DiscoveredParticipant > astutedds::rtps::RtpsUdpTransport::get_discovered_participants () const


function get_discovered_readers

Get discovered readers for a topic.

std::vector< DiscoveredReader > astutedds::rtps::RtpsUdpTransport::get_discovered_readers (
    const std::string & topicName
) const


function get_discovered_writers

Get discovered writers for a topic.

std::vector< DiscoveredWriter > astutedds::rtps::RtpsUdpTransport::get_discovered_writers (
    const std::string & topicName
) const


function get_discovery_runtime_info

Returns effective runtime discovery settings and peers.

DiscoveryRuntimeInfo astutedds::rtps::RtpsUdpTransport::get_discovery_runtime_info () const


function guid_prefix

Get the GUID prefix for this participant.

inline const GuidPrefix_t & astutedds::rtps::RtpsUdpTransport::guid_prefix () const


function init

Initialize the transport (creates sockets, starts discovery)

bool astutedds::rtps::RtpsUdpTransport::init () 

Returns:

true on success


function is_running

Check if transport is running.

inline bool astutedds::rtps::RtpsUdpTransport::is_running () const


function load_discovery_config_file

bool astutedds::rtps::RtpsUdpTransport::load_discovery_config_file (
    const std::string & path
) 

Load discovery config from JSON file. Returns true on successful parse.


function operator=

RtpsUdpTransport & astutedds::rtps::RtpsUdpTransport::operator= (
    const RtpsUdpTransport &
) = delete

function participant_id

Get the participant ID.

inline uint32_t astutedds::rtps::RtpsUdpTransport::participant_id () const


function publish [1/2]

Publish data on a topic.

bool astutedds::rtps::RtpsUdpTransport::publish (
    const std::string & topicName,
    const std::vector< uint8_t > & data
) 

Parameters:

  • topicName Topic name
  • data Serialized data (XCDR1 format)

Returns:

true on success


function publish [2/2]

Publish data on a topic with dual encoding.

bool astutedds::rtps::RtpsUdpTransport::publish (
    const std::string & topicName,
    const std::vector< uint8_t > & xcdr1Data,
    const std::vector< uint8_t > & xcdr2Data
) 

Parameters:

  • topicName Topic name
  • xcdr1Data Serialized data in XCDR1 format
  • xcdr2Data Serialized data in XCDR2 format

Returns:

true on success

Sends XCDR1 to multicast and readers that advertise XCDR1 (or no preference). Sends XCDR2 to readers that only advertise XCDR2.


function register_reader

Register a reader for a topic.

EntityId_t astutedds::rtps::RtpsUdpTransport::register_reader (
    const std::string & topicName,
    const std::string & typeName,
    const std::vector< std::string > & partitions={},
    const dcps::DataReaderQos & qos={}
) 

Parameters:

  • topicName Topic name to subscribe to
  • typeName IDL type name as registered via TypeSupport (e.g., "MyModule::MyType")
  • qos Optional DataReaderQos (defaults to interop-friendly settings)

Returns:

EntityId for the new reader


function register_writer

Register a writer for a topic.

EntityId_t astutedds::rtps::RtpsUdpTransport::register_writer (
    const std::string & topicName,
    const std::string & typeName,
    const std::vector< std::string > & partitions={},
    const dcps::DataWriterQos & qos={}
) 

Returns:

EntityId for the new writer


function reload_discovery_config

Reload the existing discovery JSON path (if configured).

bool astutedds::rtps::RtpsUdpTransport::reload_discovery_config () 


function send_type_lookup_request

void astutedds::rtps::RtpsUdpTransport::send_type_lookup_request (
    const GuidPrefix_t & remoteGuid,
    const std::array< uint8_t, 4 > & metatrafficAddr,
    uint16_t metatrafficPort,
    const std::string & topicName,
    const std::array< uint8_t, 14 > & hash
) 

Send a TypeLookup GET_TYPES request (§7.6.3.3) to the remote participant.

Parameters:

  • remoteGuid GUID prefix of the target participant
  • metatrafficAddr Remote metatraffic unicast IPv4 address
  • metatrafficPort Remote metatraffic unicast port
  • topicName Topic whose type we are querying (for callback routing)
  • hash 14-byte EK_COMPLETE EquivalenceHash from PID_TYPE_INFORMATION

function set_data_callback

Set callback for received data.

inline void astutedds::rtps::RtpsUdpTransport::set_data_callback (
    DataReceivedCallback callback
) 


function set_discovery_config

Apply discovery config (explicit peers and interface filters).

void astutedds::rtps::RtpsUdpTransport::set_discovery_config (
    const DiscoveryConfig & config
) 


function set_participant_discovered_callback

Set callback for participant discovery.

inline void astutedds::rtps::RtpsUdpTransport::set_participant_discovered_callback (
    ParticipantDiscoveredCallback callback
) 


function set_reader_discovered_callback

Set callback for reader discovery.

inline void astutedds::rtps::RtpsUdpTransport::set_reader_discovered_callback (
    ReaderDiscoveredCallback callback
) 


function set_type_lookup_callback

Register a callback to receive type schema from TLS replies.

inline void astutedds::rtps::RtpsUdpTransport::set_type_lookup_callback (
    TypeLookupCallback cb
) 


function set_writer_discovered_callback

Set callback for writer discovery.

inline void astutedds::rtps::RtpsUdpTransport::set_writer_discovered_callback (
    WriterDiscoveredCallback callback
) 


function stop

Stop the transport.

void astutedds::rtps::RtpsUdpTransport::stop () 


function subscribe

Subscribe to a topic (enables reception)

void astutedds::rtps::RtpsUdpTransport::subscribe (
    const std::string & topicName
) 


function unregister_reader

Unregister a reader.

void astutedds::rtps::RtpsUdpTransport::unregister_reader (
    const EntityId_t & entityId
) 


function unregister_writer

Unregister a writer.

void astutedds::rtps::RtpsUdpTransport::unregister_writer (
    const EntityId_t & entityId
) 


function unsubscribe

Unsubscribe from a topic.

void astutedds::rtps::RtpsUdpTransport::unsubscribe (
    const std::string & topicName
) 


function ~RtpsUdpTransport

astutedds::rtps::RtpsUdpTransport::~RtpsUdpTransport () 


The documentation for this class was generated from the following file include/astutedds/rtps/udp_transport.hpp