Class astutedds::dcps::DomainParticipant
ClassList > astutedds > dcps > DomainParticipant
Entry point for DDS communication in a domain. More...
#include <dcps.hpp>
Public Types
| Type | Name |
|---|---|
| typedef std::function< DataReader *(Topic *, Subscriber *)> | DataReaderFactory |
| typedef std::function< void(const std::string &topic, const ReceivedSample &)> | DataReceivedCallback Set callback for received data. |
| typedef std::function< DataWriter *(Topic *, Publisher *)> | DataWriterFactory Factory function types for creating typed DataWriter/DataReader subclasses. |
| typedef std::function< void(const std::string &topic_name, const std::vector< uint8_t > &data)> | SendDataCallback Set callback for sending data (used by transport layer) |
| typedef std::function< void(const std::string &topic_name)> | SubscribeCallback Set callback for subscribing to topics (used by transport layer) |
Public Functions
| Type | Name |
|---|---|
| DomainParticipant (uint32_t domain_id, uint32_t participant_id) |
|
| ContentFilteredTopic * | create_contentfilteredtopic (const char * name, Topic * related_topic, const char * filter_expression, const StringSeq & expression_parameters) Create a content-filtered topic. |
| Publisher * | create_publisher (const PublisherQos & qos=PublisherQos{}) Create a publisher. |
| Publisher * | create_publisher (const PublisherQos & qos, PublisherListener * listener, StatusMask mask=STATUS_MASK_ALL) Create a publisher with listener and status mask (PSM overload) |
| Subscriber * | create_subscriber (const SubscriberQos & qos=SubscriberQos{}) Create a subscriber. |
| Subscriber * | create_subscriber (const SubscriberQos & qos, SubscriberListener * listener, StatusMask mask=STATUS_MASK_ALL) Create a subscriber with listener and status mask (PSM overload) |
| Topic * | create_topic (const std::string & topic_name, const std::string & type_name, const TopicQos & qos=TopicQos{}) Create a topic in this domain. |
| Topic * | create_topic (const char * topic_name, const char * type_name, const TopicQos & qos, TopicListener * listener, StatusMask mask=STATUS_MASK_ALL) Create a topic with listener and status mask (PSM overload) |
| ReturnCode_t | delete_contained_entities () Delete all contained entities (topics, publishers, subscribers) |
| bool | delete_contentfilteredtopic (ContentFilteredTopic * cft) Delete a content-filtered topic. |
| bool | delete_publisher (Publisher * publisher) Delete a publisher. |
| bool | delete_subscriber (Subscriber * subscriber) Delete a subscriber. |
| bool | delete_topic (Topic * topic) Delete a topic. |
| void | deliver_data (const std::string & topic_name, const std::vector< uint8_t > & data, const rtps::GUID_t & writer_guid=rtps::GUID_t{}, int32_t ownershipStrength=0, const rtps::SequenceNumber_t & sequenceNumber=rtps::SequenceNumber_t{}) Deliver received data to appropriate DataReaders. |
| uint32_t | domain_id () const |
| bool | enable () Enable the participant (start discovery) |
| ReturnCode_t | get_default_publisher_qos (PublisherQos & qos) const |
| ReturnCode_t | get_default_subscriber_qos (SubscriberQos & qos) const |
| ReturnCode_t | get_default_topic_qos (TopicQos & qos) const |
| DomainParticipantListener * | get_listener () const |
| StatusMask | get_listener_mask () const |
| const DomainParticipantQos & | get_qos () const |
| DataReaderFactory | get_reader_factory (const std::string & type_name) const Look up a registered reader factory for the given type name. |
| DataWriterFactory | get_writer_factory (const std::string & type_name) const Look up a registered writer factory for the given type name. |
| const rtps::GuidPrefix_t & | guid_prefix () const |
| bool | is_enabled () const |
| void | match_reader_to_discovered_writers (DataReader * reader, const std::vector< std::string > & subPartitions) Match a newly created reader against already-discovered remote writers. Fires on_subscription_matched or on_requested_incompatible_qos as appropriate. |
| void | match_writer_to_discovered_readers (DataWriter * writer, const std::vector< std::string > & pubPartitions) Match a newly created writer against already-discovered remote readers. Fires on_publication_matched or on_offered_incompatible_qos as appropriate. |
| void | notify_subscription (const std::string & topic_name) Notify that a subscription was created. |
| uint32_t | participant_id () const |
| void | register_reader (const std::string & topic_name, const std::string & type_name, const std::vector< std::string > & partitions={}, const DataReaderQos & qos={}) Register a reader with the transport layer. |
| void | register_type_factory (const std::string & type_name, DataWriterFactory wf, DataReaderFactory rf) Register typed DataWriter/DataReader factories for a type name. |
| void | register_writer (const std::string & topic_name, const std::string & type_name, const std::vector< std::string > & partitions={}, const DataWriterQos & qos={}) Register a writer with the transport layer. |
| void | replay_history_to_reader (DataWriter * writer) Replay TRANSIENT_LOCAL writer history to a newly matched reader. Called when a new remote reader matches a local writer with TRANSIENT_LOCAL durability. |
| void | send_data (const std::string & topic_name, const std::vector< uint8_t > & data) Send data via the transport layer. |
| void | send_data (const std::string & topic_name, const std::vector< uint8_t > & xcdr1Data, const std::vector< uint8_t > & xcdr2Data) Send dual-encoded data via the transport layer. |
| void | set_data_received_callback (DataReceivedCallback callback) |
| void | set_listener (DomainParticipantListener * listener, StatusMask mask=STATUS_MASK_ALL) |
| void | set_qos (const DomainParticipantQos & qos) |
| void | set_send_data_callback (SendDataCallback callback) |
| void | set_subscribe_callback (SubscribeCallback callback) |
| void | stop () Stop the participant. |
| ~DomainParticipant () |
Detailed Description
The DomainParticipant provides: * Factory methods for Topics, Publishers, Subscribers * SPDP participant discovery * SEDP endpoint discovery * Transport management
Public Types Documentation
typedef DataReaderFactory
using astutedds::dcps::DomainParticipant::DataReaderFactory = std::function<DataReader *(Topic *, Subscriber *)>;
typedef DataReceivedCallback
Set callback for received data.
using astutedds::dcps::DomainParticipant::DataReceivedCallback = std::function<void(const std::string &topic, const ReceivedSample &)>;
typedef DataWriterFactory
Factory function types for creating typed DataWriter/DataReader subclasses.
using astutedds::dcps::DomainParticipant::DataWriterFactory = std::function<DataWriter *(Topic *, Publisher *)>;
Registered via register_type_factory(); used by Publisher::create_datawriter() and Subscriber::create_datareader() so that dynamic_cast to the typed subclass succeeds (required by the OMG interop test suite's shape_main.cxx).
typedef SendDataCallback
Set callback for sending data (used by transport layer)
using astutedds::dcps::DomainParticipant::SendDataCallback = std::function<void(const std::string &topic_name, const std::vector<uint8_t> &data)>;
typedef SubscribeCallback
Set callback for subscribing to topics (used by transport layer)
using astutedds::dcps::DomainParticipant::SubscribeCallback = std::function<void(const std::string &topic_name)>;
Public Functions Documentation
function DomainParticipant
astutedds::dcps::DomainParticipant::DomainParticipant (
uint32_t domain_id,
uint32_t participant_id
)
function create_contentfilteredtopic
Create a content-filtered topic.
ContentFilteredTopic * astutedds::dcps::DomainParticipant::create_contentfilteredtopic (
const char * name,
Topic * related_topic,
const char * filter_expression,
const StringSeq & expression_parameters
)
Parameters:
nameThe name of the filtered topicrelated_topicThe related Topicfilter_expressionSQL-like filter expressionexpression_parametersParameters for the filter expression
Returns:
Pointer to the new ContentFilteredTopic, or nullptr on error
function create_publisher [1/2]
Create a publisher.
Publisher * astutedds::dcps::DomainParticipant::create_publisher (
const PublisherQos & qos=PublisherQos {}
)
function create_publisher [2/2]
Create a publisher with listener and status mask (PSM overload)
inline Publisher * astutedds::dcps::DomainParticipant::create_publisher (
const PublisherQos & qos,
PublisherListener * listener,
StatusMask mask=STATUS_MASK_ALL
)
function create_subscriber [1/2]
Create a subscriber.
Subscriber * astutedds::dcps::DomainParticipant::create_subscriber (
const SubscriberQos & qos=SubscriberQos {}
)
function create_subscriber [2/2]
Create a subscriber with listener and status mask (PSM overload)
inline Subscriber * astutedds::dcps::DomainParticipant::create_subscriber (
const SubscriberQos & qos,
SubscriberListener * listener,
StatusMask mask=STATUS_MASK_ALL
)
function create_topic [1/2]
Create a topic in this domain.
Topic * astutedds::dcps::DomainParticipant::create_topic (
const std::string & topic_name,
const std::string & type_name,
const TopicQos & qos=TopicQos {}
)
function create_topic [2/2]
Create a topic with listener and status mask (PSM overload)
inline Topic * astutedds::dcps::DomainParticipant::create_topic (
const char * topic_name,
const char * type_name,
const TopicQos & qos,
TopicListener * listener,
StatusMask mask=STATUS_MASK_ALL
)
function delete_contained_entities
Delete all contained entities (topics, publishers, subscribers)
ReturnCode_t astutedds::dcps::DomainParticipant::delete_contained_entities ()
function delete_contentfilteredtopic
Delete a content-filtered topic.
bool astutedds::dcps::DomainParticipant::delete_contentfilteredtopic (
ContentFilteredTopic * cft
)
function delete_publisher
Delete a publisher.
bool astutedds::dcps::DomainParticipant::delete_publisher (
Publisher * publisher
)
function delete_subscriber
Delete a subscriber.
bool astutedds::dcps::DomainParticipant::delete_subscriber (
Subscriber * subscriber
)
function delete_topic
Delete a topic.
bool astutedds::dcps::DomainParticipant::delete_topic (
Topic * topic
)
function deliver_data
Deliver received data to appropriate DataReaders.
void astutedds::dcps::DomainParticipant::deliver_data (
const std::string & topic_name,
const std::vector< uint8_t > & data,
const rtps::GUID_t & writer_guid=rtps::GUID_t {},
int32_t ownershipStrength=0,
const rtps::SequenceNumber_t & sequenceNumber=rtps::SequenceNumber_t {}
)
function domain_id
inline uint32_t astutedds::dcps::DomainParticipant::domain_id () const
function enable
Enable the participant (start discovery)
bool astutedds::dcps::DomainParticipant::enable ()
function get_default_publisher_qos
inline ReturnCode_t astutedds::dcps::DomainParticipant::get_default_publisher_qos (
PublisherQos & qos
) const
function get_default_subscriber_qos
inline ReturnCode_t astutedds::dcps::DomainParticipant::get_default_subscriber_qos (
SubscriberQos & qos
) const
function get_default_topic_qos
inline ReturnCode_t astutedds::dcps::DomainParticipant::get_default_topic_qos (
TopicQos & qos
) const
function get_listener
inline DomainParticipantListener * astutedds::dcps::DomainParticipant::get_listener () const
function get_listener_mask
inline StatusMask astutedds::dcps::DomainParticipant::get_listener_mask () const
function get_qos
inline const DomainParticipantQos & astutedds::dcps::DomainParticipant::get_qos () const
function get_reader_factory
Look up a registered reader factory for the given type name.
DataReaderFactory astutedds::dcps::DomainParticipant::get_reader_factory (
const std::string & type_name
) const
function get_writer_factory
Look up a registered writer factory for the given type name.
DataWriterFactory astutedds::dcps::DomainParticipant::get_writer_factory (
const std::string & type_name
) const
Returns:
The factory, or nullptr-wrapping empty std::function if not registered.
function guid_prefix
inline const rtps::GuidPrefix_t & astutedds::dcps::DomainParticipant::guid_prefix () const
function is_enabled
inline bool astutedds::dcps::DomainParticipant::is_enabled () const
function match_reader_to_discovered_writers
Match a newly created reader against already-discovered remote writers. Fires on_subscription_matched or on_requested_incompatible_qos as appropriate.
void astutedds::dcps::DomainParticipant::match_reader_to_discovered_writers (
DataReader * reader,
const std::vector< std::string > & subPartitions
)
function match_writer_to_discovered_readers
Match a newly created writer against already-discovered remote readers. Fires on_publication_matched or on_offered_incompatible_qos as appropriate.
void astutedds::dcps::DomainParticipant::match_writer_to_discovered_readers (
DataWriter * writer,
const std::vector< std::string > & pubPartitions
)
function notify_subscription
Notify that a subscription was created.
void astutedds::dcps::DomainParticipant::notify_subscription (
const std::string & topic_name
)
function participant_id
inline uint32_t astutedds::dcps::DomainParticipant::participant_id () const
function register_reader
Register a reader with the transport layer.
void astutedds::dcps::DomainParticipant::register_reader (
const std::string & topic_name,
const std::string & type_name,
const std::vector< std::string > & partitions={},
const DataReaderQos & qos={}
)
Parameters:
topic_nameThe topic the reader is subscribing totype_nameThe IDL type name for the topicpartitionsPartition names for this reader's subscriber
function register_type_factory
Register typed DataWriter/DataReader factories for a type name.
void astutedds::dcps::DomainParticipant::register_type_factory (
const std::string & type_name,
DataWriterFactory wf,
DataReaderFactory rf
)
When create_datawriter()/create_datareader() sees a topic whose type_name() matches, it delegates object construction to these factories instead of allocating a plain DataWriter/DataReader.
function register_writer
Register a writer with the transport layer.
void astutedds::dcps::DomainParticipant::register_writer (
const std::string & topic_name,
const std::string & type_name,
const std::vector< std::string > & partitions={},
const DataWriterQos & qos={}
)
Parameters:
topic_nameThe topic the writer is publishing topartitionsPartition names for this writer's publisher
function replay_history_to_reader
Replay TRANSIENT_LOCAL writer history to a newly matched reader. Called when a new remote reader matches a local writer with TRANSIENT_LOCAL durability.
void astutedds::dcps::DomainParticipant::replay_history_to_reader (
DataWriter * writer
)
function send_data [1/2]
Send data via the transport layer.
void astutedds::dcps::DomainParticipant::send_data (
const std::string & topic_name,
const std::vector< uint8_t > & data
)
Parameters:
topic_nameThe topic to send ondataThe serialized data
function send_data [2/2]
Send dual-encoded data via the transport layer.
void astutedds::dcps::DomainParticipant::send_data (
const std::string & topic_name,
const std::vector< uint8_t > & xcdr1Data,
const std::vector< uint8_t > & xcdr2Data
)
Parameters:
topic_nameThe topic to send onxcdr1DataXCDR1 serialized dataxcdr2DataXCDR2 serialized data
function set_data_received_callback
inline void astutedds::dcps::DomainParticipant::set_data_received_callback (
DataReceivedCallback callback
)
function set_listener
inline void astutedds::dcps::DomainParticipant::set_listener (
DomainParticipantListener * listener,
StatusMask mask=STATUS_MASK_ALL
)
function set_qos
inline void astutedds::dcps::DomainParticipant::set_qos (
const DomainParticipantQos & qos
)
function set_send_data_callback
inline void astutedds::dcps::DomainParticipant::set_send_data_callback (
SendDataCallback callback
)
function set_subscribe_callback
inline void astutedds::dcps::DomainParticipant::set_subscribe_callback (
SubscribeCallback callback
)
function stop
Stop the participant.
void astutedds::dcps::DomainParticipant::stop ()
function ~DomainParticipant
astutedds::dcps::DomainParticipant::~DomainParticipant ()
The documentation for this class was generated from the following file include/astutedds/dcps/dcps.hpp