RTI Connext Modern C++ API  Version 7.0.0
dds::domain::DomainParticipant Class Reference

<<reference-type>> Container for all dds::core::Entity objects. More...

#include <dds/domain/DomainParticipant.hpp>

Inheritance diagram for dds::domain::DomainParticipant:
dds::core::Entity

Public Types

typedef DomainParticipantListener Listener
 The Listener type that DomainParticipants use. More...
 

Public Member Functions

 DomainParticipant (int32_t the_domain_id)
 Create a new DomainParticipant with default Qos. More...
 
 DomainParticipant (int32_t the_domain_id, const dds::domain::qos::DomainParticipantQos &the_qos, dds::domain::DomainParticipantListener *the_listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all())
 Create a new DomainParticipant. More...
 
 DomainParticipant (int32_t the_domain_id, const dds::domain::qos::DomainParticipantQos &the_qos, std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all())
 Create a new DomainParticipant. More...
 
void listener (Listener *l, const dds::core::status::StatusMask &mask)
 Register a listener with the DomainParticipant. More...
 
Listenerlistener () const
 Get the DomainParticipant listener. More...
 
void set_listener (std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &event_mask)
 Sets the listener associated with this participant. More...
 
void set_listener (std::shared_ptr< Listener > the_listener)
 Sets the listener associated with this participant. More...
 
std::shared_ptr< Listenerget_listener () const
 Returns the listener currently associated with this participant. More...
 
const dds::domain::qos::DomainParticipantQos qos () const
 Gets the current QoS policies of this DomainParticipant. More...
 
void qos (const dds::domain::qos::DomainParticipantQos &the_qos)
 Set the DomainParticipantQos setting for this DomainParticipant instance. More...
 
DomainParticipantoperator<< (const dds::domain::qos::DomainParticipantQos &the_qos)
 Equivalent to set_qos(the_qos) More...
 
const DomainParticipantoperator>> (dds::domain::qos::DomainParticipantQos &the_qos) const
 Equivalent to get_qos() More...
 
int32_t domain_id () const
 Get the unique domain identifier. More...
 
void assert_liveliness ()
 Manually assert the liveliness of the DomainParticipant. More...
 
void property (const std::string &property_name, const std::string &value, bool propagate)
 Set the value for a property that applies to a DomainParticipant. More...
 
bool contains_entity (const dds::core::InstanceHandle &a_handle)
 Check whether or not the given handle represents an Entity that was created from the DomainParticipant. More...
 
dds::core::Time current_time ()
 Get the current time. More...
 
dds::pub::qos::PublisherQos default_publisher_qos () const
 Get the current default dds::pub::qos::PublisherQos. More...
 
DomainParticipantdefault_publisher_qos (const dds::pub::qos::PublisherQos &the_qos)
 Set the default dds::pub::qos::PublisherQos for this DomainParticipant. More...
 
dds::sub::qos::SubscriberQos default_subscriber_qos () const
 Get the current default dds::sub::qos::SubscriberQos. More...
 
DomainParticipantdefault_subscriber_qos (const dds::sub::qos::SubscriberQos &the_qos)
 Set the default dds::sub::qos::SubscriberQos for this DomainParticipant. More...
 
dds::topic::qos::TopicQos default_topic_qos () const
 Get the current default dds::topic::qos::TopicQos. More...
 
DomainParticipantdefault_topic_qos (const dds::topic::qos::TopicQos &the_qos)
 Set the default dds::topic::qos::TopicQos for this DomainParticipant. More...
 
void close_contained_entities ()
 <<extension>> Closes all the entities created from this DomainParticipant More...
 
dds::pub::qos::DataWriterQos default_datawriter_qos () const
 <<extension>> Get the current default dds::pub::qos::DataWriterQos. More...
 
void default_datawriter_qos (const ::dds::pub::qos::DataWriterQos &qos)
 <<extension>> Set the default dds::pub::qos::DataWriterQos for this DomainParticipant. More...
 
dds::sub::qos::DataReaderQos default_datareader_qos () const
 <<extension>> Get the current default dds::sub::qos::DataReaderQos. More...
 
void default_datareader_qos (const ::dds::sub::qos::DataReaderQos &qos)
 <<extension>> Set the default dds::sub::qos::DataReaderQos for this DomainParticipant. More...
 
void register_contentfilter (const rti::topic::CustomFilter< rti::topic::ContentFilterBase > &custom_filter, const std::string &filter_name)
 <<extension>> Register a content filter which can be used to create a dds::topic::ContentFilteredTopic. More...
 
void unregister_contentfilter (const std::string &filter_name)
 <<extension>> Unregister a content filter previously registered with dds::domain::DomainParticipant::register_contentfilter( const rti::topic::CustomFilter<rti::topic::ContentFilterBase>& custom_filter, const std::string& filter_name). More...
 
void unregister_type (const std::string &name)
 <<extension>> Unregister a type that has previously been registered to this dds::domain::DomainParticipant. More...
 
bool is_type_registered (const std::string &name) const
 <<extension>> Check if a type has previously been registered to this dds::domain::DomainParticipant. More...
 
void add_peer (const std::string &peer_descr_string)
 <<extension>> Attempt to contact one or more additional peer participants. More...
 
void remove_peer (const std::string &peer_descr_string)
 <<extension>> Remove one or more peer participants from the list of peers with which this dds::domain::DomainParticipant will try to communicate. More...
 
dds::core::Duration dns_tracker_polling_period () const
 Retrieves the frequency used by the DNS tracker thread to query the DNS service. More...
 
void dns_tracker_polling_period (const dds::core::Duration &polling_period)
 Configures the frequency in which the DNS tracker queries the DNS service. More...
 
void resume_endpoint_discovery (const dds::core::InstanceHandle &remote_participant_handle)
 <<extension>> Initiates endpoint discovery with the remote dds::domain::DomainParticipant identified by its InstanceHandle. More...
 
void delete_durable_subscription (const rti::core::EndpointGroup &group)
 <<extension>> Deletes an existing Durable Subscription on all Persistence Services. More...
 
void register_durable_subscription (const rti::core::EndpointGroup &group, const std::string &topic_name)
 <<extension>> Registers a Durable Subscription on the specified dds::topic::Topic on all Persistence Services. More...
 
rti::core::status::DomainParticipantProtocolStatus participant_protocol_status ()
 <<extension>> Get the protocol status for this participant More...
 
- Public Member Functions inherited from dds::core::Entity
void enable ()
 Enables this entity (if it was created disabled) More...
 
const dds::core::status::StatusMask status_changes ()
 Retrieves the list of communication statuses that are triggered. More...
 
const dds::core::InstanceHandle instance_handle () const
 Get the instance handle that represents this entity. More...
 
void close ()
 Forces the destruction of this entity. More...
 
void retain ()
 Disables the automatic destruction of this entity. More...
 

Static Public Member Functions

static void participant_factory_qos (const dds::domain::qos::DomainParticipantFactoryQos &qos)
 Set the dds::domain::qos::DomainParticipantFactoryQos. More...
 
static dds::domain::qos::DomainParticipantFactoryQos participant_factory_qos ()
 Get the current dds::domain::qos::DomainParticipantFactoryQos. More...
 
static void finalize_participant_factory ()
 Finalize the DomainParticipantFactory. More...
 
static dds::domain::qos::DomainParticipantQos default_participant_qos ()
 Get the current DomainParticipantQos for this instance. More...
 
static void default_participant_qos (const dds::domain::qos::DomainParticipantQos &qos)
 Set the DomainParticipantQos. More...
 

Related Functions

(Note that these are not member functions.)

void ignore (const dds::domain::DomainParticipant &participant, const dds::core::InstanceHandle &handle)
 Instructs RTI Connext to locally ignore a remote dds::domain::DomainParticipant. More...
 
template<typename FwdIterator >
void ignore (const dds::domain::DomainParticipant &participant, FwdIterator begin, FwdIterator end)
 Instructs RTI Connext to locally ignore a group of remote dds::domain::DomainParticipant. More...
 
dds::core::InstanceHandleSeq discovered_participants (const dds::domain::DomainParticipant &participant)
 Retrieves the list of other participants discovered by this participant. More...
 
template<typename FwdIterator >
FwdIterator discovered_participants (const dds::domain::DomainParticipant &participant, FwdIterator begin, FwdIterator end)
 Retrieves the list of other participants discovered by this participant. More...
 
dds::topic::ParticipantBuiltinTopicData discovered_participant_data (const dds::domain::DomainParticipant &participant, const dds::core::InstanceHandle &participant_handle)
 Retrieves the information about one participant discovered by this participant. More...
 
DomainParticipant find (int32_t domain_id)
 Locates an existing dds::domain::DomainParticipant. More...
 
void banish_ignored_participants (const dds::domain::DomainParticipant &participant)
 <<extension>> Prevents ignored remote DomainParticipants from receiving traffic from the local DomainParticipant. More...
 
rti::core::optional_value< std::string > discovered_participant_subject_name (const dds::domain::DomainParticipant &participant, const dds::core::InstanceHandle &participant_handle)
 <<extension>> Returns rti::core::policy::EntityName::name for the specified DomainParticipant. More...
 
dds::core::InstanceHandleSeq discovered_participants_from_subject_name (const dds::domain::DomainParticipant &participant, const rti::core::optional_value< std::string > &subject_name)
 <<extension>> Returns a list of discovered DomainParticipant entities that have the given rti::core::policy::EntityName::name. More...
 
dds::domain::DomainParticipant find_participant_by_name (const std::string &participant_name)
 <<extension>> Locates an existing dds::domain::DomainParticipant by name. More...
 
template<typename ParticipantFwdIterator >
uint32_t find_participants (ParticipantFwdIterator begin, uint32_t max_size)
 <<extension>> Retrieves all the participants created by the application up to a maximum number More...
 
template<typename ParticipantFwdIterator >
uint32_t find_participants (ParticipantFwdIterator begin)
 <<extension>> Retrieves all the participants created by the application More...
 
const dds::core::xtypes::DynamicTypefind_type (const dds::domain::DomainParticipant &participant, const std::string &type_name)
 <<extension>> Retrieves a type registered with this participant More...
 
void register_type (dds::domain::DomainParticipant &participant, const std::string &name, const dds::core::xtypes::DynamicType &type, const rti::core::xtypes::DynamicDataTypeSerializationProperty &serialization_property=rti::core::xtypes::DynamicDataTypeSerializationProperty::DEFAULT)
 <<extension>> Registers a DynamicType with specific serialization properties More...
 
template<typename T >
void register_type (const std::string &registered_type_name=dds::topic::topic_type_name< T >::value())
 <<extension>> Registers a User-Generated Type with RTI Connext. This function is used along with XML Application Creation. More...
 

Detailed Description

<<reference-type>> Container for all dds::core::Entity objects.

  • It represents the participation of the application on a communication plane that isolates applications running on the same set of physical computers from each other. A domain establishes a virtual network linking all applications that share the same domainId and isolating them from applications running on different domains. In this way, several independent distributed applications can coexist in the same physical network without interfering, or even being aware of each other.

The following operations may be called even if the dds::domain::DomainParticipant is not enabled. Operations NOT in this list will fail with dds::core::NotEnabledError \ if called on a disabled DomainParticipant.

QoS:
dds::domain::qos::DomainParticipantQos
Status:
Status Kinds
Listener:
DomainParticipantListener
See also
Operations Allowed in Listener Callbacks
Other operations related to a DomainParticipant in other namespaces:
dds::core::QosProvider::create_participant_from_config to create a DomainParticipant from an XML definition
Participant Use Cases
Entity Use Cases
Examples:
Foo.hpp, Foo_publisher.cxx, and Foo_subscriber.cxx.

Member Typedef Documentation

◆ Listener

typedef DomainParticipantListener dds::domain::DomainParticipant::Listener

The Listener type that DomainParticipants use.

Constructor & Destructor Documentation

◆ DomainParticipant() [1/3]

dds::domain::DomainParticipant::DomainParticipant ( int32_t  the_domain_id)
inlineexplicit

◆ DomainParticipant() [2/3]

dds::domain::DomainParticipant::DomainParticipant ( int32_t  the_domain_id,
const dds::domain::qos::DomainParticipantQos the_qos,
dds::domain::DomainParticipantListener the_listener = NULL,
const dds::core::status::StatusMask mask = dds::core::status::StatusMask::all() 
)
inline

Create a new DomainParticipant.

[DEPRECATED] When using a listener, prefer the constructor that receives a shared_ptr<Listener> instead of a regular Listener* pointer.

The DomainParticipant signifies that the application intends to join the Domain identified by the domain_id argument.

Parameters
the_domain_idthe id of the domain joined by this DomainParticipant. [range] [>=0], and does not violate guidelines stated in rti::core::RtpsWellKnownPorts.
the_qosThe QoS settings for this DomainParticipant. See also set_qos().
the_listenerThe listener (NULL by default)
maskChanges of communication status to be invoked on the listener.
Precondition
The specified QoS policies must be consistent or the operation will fail and no dds::domain::DomainParticipant will be created.

If you want to create multiple participants on a given host in the same domain, make sure each one has a different participant index (set in the rti::core::policy::WireProtocol). This in turn will ensure each participant uses a different port number (since the unicast port numbers are calculated from the participant index and the domain ID).

Note that if there is a single participant per host in a given domain, the participant index can be left at the default value (-1).

MT Safety:
UNSAFE. It is not safe to create a dds::domain::DomainParticipant while another thread may be simultaneously creating another dds::domain::DomainParticipant.
See also
Specifying QoS on entities for information on setting QoS before entity creation
dds::domain::qos::DomainParticipantQos for rules on consistency among QoS
NDDS_DISCOVERY_PEERS
dds::core::QosProvider
dds::domain::DomainParticipant::default_participant_qos()
dds::domain::DomainParticipant::set_listener

◆ DomainParticipant() [3/3]

dds::domain::DomainParticipant::DomainParticipant ( int32_t  the_domain_id,
const dds::domain::qos::DomainParticipantQos the_qos,
std::shared_ptr< Listener the_listener,
const dds::core::status::StatusMask mask = dds::core::status::StatusMask::all() 
)
inline

Create a new DomainParticipant.

The DomainParticipant signifies that the application intends to join the Domain identified by the domain_id argument.

Parameters
the_domain_idthe id of the domain joined by this DomainParticipant. [range] [>=0], and does not violate guidelines stated in rti::core::RtpsWellKnownPorts.
the_qosThe QoS settings for this DomainParticipant. See also set_qos().
the_listenerA shared_ptr to the listener. See set_listener() for more information.
maskChanges of communication status to be invoked on the listener.
Precondition
The specified QoS policies must be consistent or the operation will fail and no dds::domain::DomainParticipant will be created.

If you want to create multiple participants on a given host in the same domain, make sure each one has a different participant index (set in the rti::core::policy::WireProtocol). This in turn will ensure each participant uses a different port number (since the unicast port numbers are calculated from the participant index and the domain ID).

Note that if there is a single participant per host in a given domain, the participant index can be left at the default value (-1).

MT Safety:
UNSAFE. It is not safe to create a dds::domain::DomainParticipant while another thread may be simultaneously creating another dds::domain::DomainParticipant.
See also
Specifying QoS on entities for information on setting QoS before entity creation
dds::domain::qos::DomainParticipantQos for rules on consistency among QoS
NDDS_DISCOVERY_PEERS
dds::core::QosProvider
dds::domain::DomainParticipant::default_participant_qos()
dds::domain::DomainParticipant::set_listener

Member Function Documentation

◆ listener() [1/2]

void dds::domain::DomainParticipant::listener ( Listener l,
const dds::core::status::StatusMask mask 
)
inline

Register a listener with the DomainParticipant.

[DEPRECATED] The use of set_listener() is recommended. Unlike this function, set_listener receives a shared_ptr which simplifies the management of listener's lifecycle.

◆ listener() [2/2]

Listener* dds::domain::DomainParticipant::listener ( ) const
inline

Get the DomainParticipant listener.

[DEPRECATED] Prefer get_listener() instead of this function.

Returns
The existing listener attached to the DomainParticipant or NULL if no listener has been set.

◆ set_listener() [1/2]

void dds::domain::DomainParticipant::set_listener ( std::shared_ptr< Listener the_listener,
const dds::core::status::StatusMask event_mask 
)
inline

Sets the listener associated with this participant.

The DomainParticipant will hold the shared_ptr, ensuring that the listener is not deleted at least until this DomainParticipant is deleted or the listener is reset with set_listener(nullptr).

Warning
It's recommended that the listener implementation doesn't hold a permanent reference to the participant. If it does, the application needs to manually reset the listener or manually close this participant to ensure that there is no cycle that prevents the destruction of these two objects.
Parameters
the_listenerA shared pointer to the listener to receive status updates or nullptr to reset the current listener and stop receiving status updates.
event_maskA mask that indicates which status updates will be notified to the listener
MT Safety:
Unsafe. This method is not synchronized with the listener callbacks, so it is possible to set a new listener on a participant when the old listener is in a callback.

Care should therefore be taken not to delete any listener that has been set on an enabled participant unless some application-specific means are available of ensuring that the old listener cannot still be in use.

Exceptions
Oneof the Standard Exceptions
See also
set_listener (abstract)

◆ set_listener() [2/2]

void dds::domain::DomainParticipant::set_listener ( std::shared_ptr< Listener the_listener)
inline

Sets the listener associated with this participant.

If the_listener is not nullptr, this overload is equivalent to:

If the_listener is nullptr, it is equivalent to:

Parameters
the_listenerA shared pointer to the listener to receive status updates or nullptr to reset the current listener and stop receiving status updates.

◆ get_listener()

std::shared_ptr<Listener> dds::domain::DomainParticipant::get_listener ( ) const
inline

Returns the listener currently associated with this participant.

Returns
The shared pointer to the current listener or nullptr if there is currently no listener associated to this entity.

◆ qos() [1/2]

const dds::domain::qos::DomainParticipantQos dds::domain::DomainParticipant::qos ( ) const
inline

Gets the current QoS policies of this DomainParticipant.

Returns
The current QoS policies.

◆ qos() [2/2]

void dds::domain::DomainParticipant::qos ( const dds::domain::qos::DomainParticipantQos the_qos)
inline

Set the DomainParticipantQos setting for this DomainParticipant instance.

Parameters
the_qosSet of policies to be applied to the DomainParticipant. Immutable policies cannot be changed after this entity has been enabled.
Exceptions
dds::core::ImmutablePolicyErrorif the_qos contains a different value for an immutable policy.
dds::core::InconsistentPolicyErrorif some policies are inconsistent.
See also
dds::domain::qos::DomainParticipantQos for rules on consistency among QoS policies
set_qos (abstract)
default_participant_qos()
dds::core::QosProvider::participant_qos()

◆ operator<<()

DomainParticipant& dds::domain::DomainParticipant::operator<< ( const dds::domain::qos::DomainParticipantQos the_qos)
inline

Equivalent to set_qos(the_qos)

◆ operator>>()

const DomainParticipant& dds::domain::DomainParticipant::operator>> ( dds::domain::qos::DomainParticipantQos the_qos) const
inline

Equivalent to get_qos()

Parameters
the_qosthe new qos for this DomainParticipant.

◆ domain_id()

int32_t dds::domain::DomainParticipant::domain_id ( ) const
inline

Get the unique domain identifier.

This operation retrieves the domain id used to create the dds::domain::DomainParticipant. The domain id identifies the DDS domain to which the dds::domain::DomainParticipant belongs. Each DDS domain represents a separate data 'communication plane' isolated from other domains.

Returns
the domain id

◆ assert_liveliness()

void dds::domain::DomainParticipant::assert_liveliness ( )
inline

Manually assert the liveliness of the DomainParticipant.

This is used in combination with the dds::core::policy::Liveliness to indicate to RTI Connext that the entity remains active.

You need to use this operation if the dds::domain::DomainParticipant contains dds::pub::DataWriter entities with the dds::core::policy::Liveliness::kind set to dds::core::policy::LivelinessKind::MANUAL_BY_PARTICIPANT and it only affects the liveliness of those dds::pub::DataWriter entities. Otherwise, it has no effect.

Note: writing data via the dds::pub::DataWriter::write() or dds::pub::DataWriter::write(const T&,const dds::core::Time&) operation asserts liveliness on the dds::pub::DataWriter itself and its dds::domain::DomainParticipant. Consequently the use of assert_liveliness() is only needed if the application is not writing data regularly.

◆ property()

void dds::domain::DomainParticipant::property ( const std::string &  property_name,
const std::string &  value,
bool  propagate 
)
inline

Set the value for a property that applies to a DomainParticipant.

Parameters
property_name<<in>>. Name of the property that you want to set.
value<<in>>. New value for the property.
propagate<<in>>. Indicates if the property will be propagated or not.
Exceptions
Oneof the Standard Exceptions
See also
dds::pub::DataWriter::set_property
dds::sub::DataReader::set_property
dds::domain::DomainParticipant::qos(const dds::domain::qos::DomainParticipantQos&)

◆ contains_entity()

bool dds::domain::DomainParticipant::contains_entity ( const dds::core::InstanceHandle a_handle)
inline

Check whether or not the given handle represents an Entity that was created from the DomainParticipant.

This operation checks whether or not the given a_handle represents an dds::core::Entity that was created from the dds::domain::DomainParticipant. The containment applies recursively. That is, it applies both to entities (TopicDescription, dds::pub::Publisher, or dds::sub::Subscriber) created directly using the dds::domain::DomainParticipant as well as entities created using a contained dds::pub::Publisher, or dds::sub::Subscriber as the factory, and so forth.

The instance handle for an dds::core::Entity may be obtained from built-in topic data, from various statuses, or from the operation dds::core::Entity::instance_handle().

Parameters
a_handle<<in>> dds::core::InstanceHandle of the dds::core::Entity to be checked.
Returns
true if dds::core::Entity is contained by the dds::domain::DomainParticipant, or false otherwise.

◆ current_time()

dds::core::Time dds::domain::DomainParticipant::current_time ( )
inline

Get the current time.

The current value of the time that RTI Connext uses to time-stamp dds::pub::DataWriter and to set the reception-timestamp for the data updates that it receives.

Exceptions
Oneof the Standard Exceptions
Returns
The current time

◆ participant_factory_qos() [1/2]

static void dds::domain::DomainParticipant::participant_factory_qos ( const dds::domain::qos::DomainParticipantFactoryQos qos)
inlinestatic

Set the dds::domain::qos::DomainParticipantFactoryQos.

Parameters
qosThe DomainParticipantFactoryQos to set.

◆ participant_factory_qos() [2/2]

static dds::domain::qos::DomainParticipantFactoryQos dds::domain::DomainParticipant::participant_factory_qos ( )
inlinestatic

Get the current dds::domain::qos::DomainParticipantFactoryQos.

Returns
The current DomainParticipantFactoryQos

◆ finalize_participant_factory()

static void dds::domain::DomainParticipant::finalize_participant_factory ( )
inlinestatic

Finalize the DomainParticipantFactory.

The DomainParticipantFactory is a singleton that the C++ API uses implicitly to create participants. RTI Connext provides this operation for users who want to release memory used by the participant factory.

Warning
This method uses a static variable. To avoid undefined behavior in the order of destruction it shouldn't be called in the destructor of a type for which other global or static variables exist.
Examples:
Foo_publisher.cxx, and Foo_subscriber.cxx.

◆ default_participant_qos() [1/2]

static dds::domain::qos::DomainParticipantQos dds::domain::DomainParticipant::default_participant_qos ( )
inlinestatic

Get the current DomainParticipantQos for this instance.

Returns
The current DomainParticipantQos
See also
Default QoS

◆ default_participant_qos() [2/2]

static void dds::domain::DomainParticipant::default_participant_qos ( const dds::domain::qos::DomainParticipantQos qos)
inlinestatic

Set the DomainParticipantQos.

The UserData and EntityFactory policies can be changed. The other policies are immutable.

Parameters
qosThe DomainParticipantQos to set.
See also
Default QoS

◆ default_publisher_qos() [1/2]

dds::pub::qos::PublisherQos dds::domain::DomainParticipant::default_publisher_qos ( ) const
inline

Get the current default dds::pub::qos::PublisherQos.

The retrieved qos will match the set of values specified on the last successful call to default_publisher_qos(const dds::pub::qos::PublisherQos& qos), or else, if the call was never made, the RTI Connext default values for the dds::pub::qos::PublisherQos.

This method may potentially allocate memory depending on the sequences contained in some QoS policies.

If no PublisherQos is specified when a dds::pub::Publisher is constructed, the default value of the QoS set in the factory, equivalent to the value obtained by calling this method, will be used to create the Publisher.

MT Safety:
UNSAFE. It is not safe to retrieve the default publisher QoS from a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_publisher_qos
Returns
The current default PublisherQos

◆ default_publisher_qos() [2/2]

DomainParticipant& dds::domain::DomainParticipant::default_publisher_qos ( const dds::pub::qos::PublisherQos the_qos)
inline

Set the default dds::pub::qos::PublisherQos for this DomainParticipant.

This set of default values will be used for a newly created dds::pub::Publisher if no dds::pub::qos::PublisherQos is specified when constructing the Publisher.

Precondition
The specified QoS policies must be consistent, or else the operation will have no effect and fail with dds::core::InconsistentPolicyError
MT Safety:
UNSAFE. It is not safe to set the default publisher QoS for a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_publisher_qos, dds::domain::DomainParticipant::default_publisher_qos() or creating a Publisher with default QoS values.
Parameters
the_qosThe PublisherQos to set.
Returns
This DomainParticipant instance
Exceptions
Oneof the standard Exceptions, or dds::core::InconsistentPolicyError

◆ default_subscriber_qos() [1/2]

dds::sub::qos::SubscriberQos dds::domain::DomainParticipant::default_subscriber_qos ( ) const
inline

Get the current default dds::sub::qos::SubscriberQos.

The retrieved qos will match the set of values specified on the last successful call to dds::domain::DomainParticipant::default_subscriber_qos(const dds::sub::qos::SubscriberQos & qos ), or dds::domain::DomainParticipant::set_default_subscriber_qos_with_profile, or else, if the call was never made, the default values listed in dds::sub::qos::SubscriberQos.

This method may potentially allocate memory depending on the sequences contained in some QoS policies.

If no SubscriberQos is specified when a dds::sub::Subscriber is constructed, the default value of the QoS set in the factory, equivalent to the value obtained by calling this method, will be used to create the Subscriber.

MT Safety:
UNSAFE. It is not safe to retrieve the default Subscriber QoS from a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_subscriber_qos(const dds::sub::qos::SubscriberQos & qos ).
See also
dds::sub::Subscriber::Subscriber
Returns
The current default SubscriberQos

◆ default_subscriber_qos() [2/2]

DomainParticipant& dds::domain::DomainParticipant::default_subscriber_qos ( const dds::sub::qos::SubscriberQos the_qos)
inline

Set the default dds::sub::qos::SubscriberQos for this DomainParticipant.

This set of default values will be used for a newly created dds::sub::Subscriber if SUBSCRIBER_QOS_DEFAULT is specified as the qos parameter when dds::sub::Subscriber::Subscriber is called.

Precondition
The specified QoS policies must be consistent, or else the operation will have no effect and fail with dds::core::InconsistentPolicyError
MT Safety:
UNSAFE. It is not safe to set the default Subscriber QoS for a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_subscriber_qos(const dds::sub::qos::SubscriberQos & qos ), dds::domain::DomainParticipant::default_subscriber_qos or calling dds::sub::Subscriber::Subscriber with SUBSCRIBER_QOS_DEFAULT as the qos parameter.
Parameters
the_qosThe SubscriberQos to set.
Exceptions
Oneof the standard Exceptions, or dds::core::InconsistentPolicyError

◆ default_topic_qos() [1/2]

dds::topic::qos::TopicQos dds::domain::DomainParticipant::default_topic_qos ( ) const
inline

Get the current default dds::topic::qos::TopicQos.

The retrieve d qos will match the set of values specified on the last successful call to default_topic_qos(const dds::topic::qos::TopicQos& qos), or else, if the call was never made, the RTI Connext default values for the dds::topic::qos::TopicQos.

This method may potentially allocate memory depending on the sequences contained in some QoS policies.

If no TopicQos is specified when a dds::topic::Topic is constructed, the default value of the QoS set in the factory, equivalent to the value obtained by calling this method, will be used to create the Topic.

MT Safety:
UNSAFE. It is not safe to retrieve the default Topic QoS from a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_topic_qos
Returns
The current default TopicQos

◆ default_topic_qos() [2/2]

DomainParticipant& dds::domain::DomainParticipant::default_topic_qos ( const dds::topic::qos::TopicQos the_qos)
inline

Set the default dds::topic::qos::TopicQos for this DomainParticipant.

This set of default values will be used for a newly created dds::topic::Topic if no dds::topic::qos::TopicQos is specified when constructing the Topic.

Precondition
The specified QoS policies must be consistent, or else the operation will have no effect and fail with dds::core::InconsistentPolicyError
MT Safety:
UNSAFE. It is not safe to set the default topic QoS for a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_topic_qos, dds::domain::DomainParticipant::default_topic_qos() or creating a Topic with default QoS values.
Parameters
the_qosThe TopicQos to set.
Returns
This DomainParticipant instance
Exceptions
Oneof the standard Exceptions, or dds::core::InconsistentPolicyError

◆ close_contained_entities()

void close_contained_entities ( )

<<extension>> Closes all the entities created from this DomainParticipant

Note
This function is an extension, it must be called via this->extensions()
Calling this function explicitly is not necessary to close a DomainParticipant.

This operation closes all contained dds::pub::Publisher (including an implicit Publisher, if one exists), dds::sub::Subscriber (including implicit Subscriber), dds::topic::Topic, dds::topic::ContentFilteredTopic, and MultiTopic objects.

Prior to closing each contained entity, this operation will recursively call the corresponding close_contained_entities() operation on each contained entity (if applicable). This pattern is applied recursively. In this manner the operation close_contained_entities() on the dds::domain::DomainParticipant will end up recursively closing all the entities contained in the dds::domain::DomainParticipant, including the dds::pub::DataWriter, dds::sub::DataReader, as well as the dds::sub::cond::QueryCondition, dds::sub::cond::ReadCondition, and rti::sub::TopicQuery objects belonging to the contained dds::sub::DataReader.

The operation will fail with dds::core::PreconditionNotMetError if any of the contained entities is in a state where it cannot be closed .

MT Safety:
UNSAFE. It is not safe to delete an entity while another thread may be simultaneously calling an API that uses the entity.
Exceptions
Oneof the Standard Exceptions, or dds::core::PreconditionNotMetError.

◆ default_datawriter_qos() [1/2]

dds::pub::qos::DataWriterQos default_datawriter_qos ( ) const

<<extension>> Get the current default dds::pub::qos::DataWriterQos.

Note
This function is an extension, it must be called via this->extensions()

The retrieved qos will match the set of values specified on the last successful call to default_datawriter_qos(const ::dds::pub::qos::DataWriterQos& qos), or else, if the call was never made, the RTI Connext default values for the dds::pub::qos::DataWriterQos.

This method may potentially allocate memory depending on the sequences contained in some QoS policies.

If no DataWriterQos is specified when a dds::pub::DataWriter is constructed, the default value of the QoS set in the factory, equivalent to the value obtained by calling this method, will be used to create the DataWriter.

MT Safety:
UNSAFE. It is not safe to retrieve the default DataWriterQoS from a DomainPartipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_datawriter_qos.
Returns
The current default DataWriterQos

◆ default_datawriter_qos() [2/2]

void default_datawriter_qos ( const ::dds::pub::qos::DataWriterQos qos)

<<extension>> Set the default dds::pub::qos::DataWriterQos for this DomainParticipant.

Note
This function is an extension, it must be called via this->extensions()

This set of default values will be used for a newly created dds::pub::DataWriter if no dds::pub::qos::DataWriterQos is specified when constructing the DataWriter.

Precondition
The specified QoS policies must be consistent, or else the operation will have no effect and fail with dds::core::InconsistentPolicyError
MT Safety:
UNSAFE. It is not safe to set the default DataWriter QoS for a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_datawriter_qos or dds::domain::DomainParticipant::default_datawriter_qos() or creating a DataWriter with default QoS values.
Parameters
qosThe DataWriterQos to set.
Exceptions
Oneof the standard Exceptions, or dds::core::InconsistentPolicyError

◆ default_datareader_qos() [1/2]

dds::sub::qos::DataReaderQos default_datareader_qos ( ) const

<<extension>> Get the current default dds::sub::qos::DataReaderQos.

Note
This function is an extension, it must be called via this->extensions()

The retrieved qos will match the set of values specified on the last successful call to default_datareader_qos(const ::dds::sub::qos::DataReaderQos& qos), or else, if the call was never made, the RTI Connext default values for the dds::sub::qos::DataReaderQos.

This method may potentially allocate memory depending on the sequences contained in some QoS policies.

If no DataReaderQos is specified when a dds::sub::DataReader is constructed, the default value of the QoS set in the factory, equivalent to the value obtained by calling this method, will be used to create the DataReader.

MT Safety:
UNSAFE. It is not safe to retrieve the default DataReader QoS from a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_datareader_qos.
Returns
The current default DataReaderQos

◆ default_datareader_qos() [2/2]

void default_datareader_qos ( const ::dds::sub::qos::DataReaderQos qos)

<<extension>> Set the default dds::sub::qos::DataReaderQos for this DomainParticipant.

Note
This function is an extension, it must be called via this->extensions()

This set of default values will be used for a newly created dds::sub::DataReader if no dds::sub::qos::DataReaderQos is specified when constructing the DataReader.

Precondition
The specified QoS policies must be consistent, or else the operation will have no effect and fail with dds::core::InconsistentPolicyError
MT Safety:
UNSAFE. It is not safe to set the default DataReader QoS for a DomainParticipant while another thread may be simultaneously calling dds::domain::DomainParticipant::default_datareader_qos or dds::domain::DomainParticipant::default_datareader_qos(). or creating a DataReader with default QoS values.
Parameters
qosThe DataReaderQos to set.
Exceptions
Oneof the standard Exceptions, or dds::core::InconsistentPolicyError

◆ register_contentfilter()

void register_contentfilter ( const rti::topic::CustomFilter< rti::topic::ContentFilterBase > &  custom_filter,
const std::string &  filter_name 
)

<<extension>> Register a content filter which can be used to create a dds::topic::ContentFilteredTopic.

Note
This function is an extension, it must be called via this->extensions()

DDS specifies a SQL-like content filter for use by content filtered topics. If this filter does not meet your filtering requirements, you can register a custom filter.

To use a custom filter, it must be registered in the following places:

For example, suppose Application A on the subscription side creates a Topic named X and a ContentFilteredTopic named filteredX (and a corresponding DataReader), using a previously registered content filter, myFilter. With only that, you will have filtering at the subscription side. If you also want to perform filtering in any application that publishes Topic X, then you also need to register the same definition of the ContentFilter myFilter in that application.

Each filter_name can only be used to registered a content filter once with a dds::domain::DomainParticipant.

See also
dds::domain::DomainParticipant::unregister_contentfilter(const std::string & filter_name)
Parameters
custom_filterA custom filter
filter_nameName of the filter. The name must be unique within the DomainParticipant and must not exceed 255 characters.
Exceptions
Oneof the standard Exceptions
See also
Creating Custom Content Filters

◆ unregister_contentfilter()

void unregister_contentfilter ( const std::string &  filter_name)

<<extension>> Unregister a content filter previously registered with dds::domain::DomainParticipant::register_contentfilter( const rti::topic::CustomFilter<rti::topic::ContentFilterBase>& custom_filter, const std::string& filter_name).

Note
This function is an extension, it must be called via this->extensions()

A filter_name can be unregistered only if it has been previously registered to the dds::domain::DomainParticipant with dds::domain::DomainParticipant::register_contentfilter(const rti::topic::CustomFilter < rti::topic::ContentFilterBase > & custom_filter, const std::string & filter_name).

The unregistration of filter is not allowed if there are any existing dds::topic::ContentFilteredTopic objects that are using the filter. If the operation is called on a filter with existing dds::topic::ContentFilteredTopic objects attached to it, this operation will fail with dds::core::PreconditionNotMetError.

If there are still existing discovered dds::sub::DataReader s with the same filter_name and the filter's compile method of the filter have previously been called on the discovered dds::sub::DataReader s, finalize method of the filter will be called on those discovered dds::sub::DataReader s before the content filter is unregistered. This means filtering will now be performed on the application that is creating the dds::sub::DataReader.

Parameters
filter_nameName of the filter to unregister.
Exceptions
Oneof the standard Exceptions, or dds::core::PreconditionNotMetError

◆ unregister_type()

void unregister_type ( const std::string &  name)

<<extension>> Unregister a type that has previously been registered to this dds::domain::DomainParticipant.

Note
This function is an extension, it must be called via this->extensions()
Parameters
nameThe name of the type to unregister

◆ is_type_registered()

bool is_type_registered ( const std::string &  name) const

<<extension>> Check if a type has previously been registered to this dds::domain::DomainParticipant.

Parameters
nameThe name of the type to check
Returns
bool true if it is registered, false otherwise

◆ add_peer()

void add_peer ( const std::string &  peer_descr_string)

<<extension>> Attempt to contact one or more additional peer participants.

Note
This function is an extension, it must be called via this->extensions()

Add the given peer description to the list of peers with which this dds::domain::DomainParticipant will try to communicate.

This method may be called at any time after this dds::domain::DomainParticipant has been created (before or after it has been enabled).

If this method is called after dds::core::Entity::enable, an attempt will be made to contact the new peer(s) immediately.

If this method is called before the DomainParticipant is enabled, the peer description will simply be added to the list that was populated by rti::core::policy::Discovery::initial_peers(const dds::core::StringSeq & the_initial_peers); the first attempted contact will take place after this dds::domain::DomainParticipant is enabled.

Adding a peer description with this method does not guarantee that any peer(s) discovered as a result will exactly correspond to those described:

  • This dds::domain::DomainParticipant will attempt to discover peer participants at the given locations but may not succeed if no such participants are available. In this case, this method will not wait for contact attempt(s) to be made and it will not report an error.

To be informed of the exact remote participants that are discovered, regardless of which peers this dds::domain::DomainParticipant attempts to discover, use the built-in participant topic: dds::topic::participant_topic_name().

To remove specific peer locators, you may use dds::domain::DomainParticipant::remove_peer(const std::string & peer_descr_string). If a peer is removed, the add_peer operation will add it back to the list of peers.

To stop communicating with a peer dds::domain::DomainParticipant that has been discovered, use dds::domain::ignore.

Adding a peer description with this method has no effect on the rti::core::policy::Discovery::initial_peers(const dds::core::StringSeq & the_initial_peers) that may be subsequently retrieved with dds::domain::DomainParticipant::qos() const() (because rti::core::policy::Discovery is immutable).

Parameters
peer_descr_stringNew peer descriptor to be added. The format is specified in Peer Descriptor Format.
Exceptions
Oneof the standard Exceptions

◆ remove_peer()

void remove_peer ( const std::string &  peer_descr_string)

<<extension>> Remove one or more peer participants from the list of peers with which this dds::domain::DomainParticipant will try to communicate.

Note
This function is an extension, it must be called via this->extensions()

This method may be called any time after this dds::domain::DomainParticipant has been enabled

Calling this method has the following effects:

If remote participants located on a peer that was previously removed are discovered, they will be ignored untill the related peer is added back by using dds::domain::DomainParticipant::add_peer(const std::string & peer_descr_string).

Removing a peer description with this method has no effect on the rti::core::policy::Discovery::initial_peers(const dds::core::StringSeq & the_initial_peers) that may be subsequently retrieved with dds::domain::DomainParticipant::qos() const() (because rti::core::policy::Discovery is immutable).

Parameters
peer_descr_stringPeer descriptor to be removed. The format is specified in Peer Descriptor Format.
Exceptions
Oneof the standard Exceptions

◆ dns_tracker_polling_period() [1/2]

dds::core::Duration dns_tracker_polling_period ( ) const

Retrieves the frequency used by the DNS tracker thread to query the DNS service.

Note
This function is an extension, it must be called via this->extensions()

The DNS tracker queries the DNS for hostnames specified in the initial peers of a DomainParticipant. The frequency of these queries is defined by rti::core::policy::DiscoveryConfig::dns_tracker_polling_period. If the value returned is dds::core::Duration::infinite(), the DNS tracker is disabled.

Returns
The DNS polling period
Exceptions
Oneof the standard Exceptions
See also
rti::core::policy::DiscoveryConfig::dns_tracker_polling_period

◆ dns_tracker_polling_period() [2/2]

void dns_tracker_polling_period ( const dds::core::Duration polling_period)

Configures the frequency in which the DNS tracker queries the DNS service.

Note
This function is an extension, it must be called via this->extensions()

This API allows you to change the frequency of the polling period for the DNS tracker. The range of accepted values, in seconds, goes from 1 second to 1 year. dds::core::Duration::infinite() is also accepted as a valid value. If the duration is set to dds::core::Duration::infinite(), the DNS tracker is disabled.

Modifying the DNS tracker polling period through this has no effect on the rti::core::policy::DiscoveryConfig::dns_tracker_polling_period when it is retrieved with dds::domain::DomainParticipant::qos() const().

Parameters
polling_periodPolling period to be configured.
Exceptions
Oneof the standard Exceptions
See also
rti::core::policy::DiscoveryConfig::dns_tracker_polling_period
dds::domain::DomainParticipant::add_peer(const std::string & peer_descr_string)

◆ resume_endpoint_discovery()

void resume_endpoint_discovery ( const dds::core::InstanceHandle remote_participant_handle)

<<extension>> Initiates endpoint discovery with the remote dds::domain::DomainParticipant identified by its InstanceHandle.

Note
This function is an extension, it must be called via this->extensions()

If the operation completes successfully, the dds::domain::DomainParticipant will initiate endpoint discovery with the remote dds::domain::DomainParticipant provided as a parameter.

When rti::core::policy::Discovery::enable_endpoint_discovery is set to false, this operation allows the RTI Connext application to select for which remote DomainParticipants endpoint discovery is performed. By disabling endpoint discovery, the DomainParticipant will not store any state about remote endpoints and will not send local endpoint information to remote DomainParticipants.

If rti::core::policy::Discovery::enable_endpoint_discovery is set to true, endpoint discovery will automatically occur for every discovered dds::domain::DomainParticipant. In this case, invoking this operation will have no effect and will return successfully.

When rti::core::policy::Discovery::enable_endpoint_discovery is set to false, you have two options after a remote dds::domain::DomainParticipant is discovered:

Setting rti::core::policy::Discovery::enable_endpoint_discovery to false enables application-level authentication use cases, in which a dds::domain::DomainParticipant will initiate endpoint discovery with a remote dds::domain::DomainParticipant after successful authentication at the application level.

The remote_participant_handle paremeter is the one that appears in the dds::sub::SampleInfo retrieved when reading the data samples available for the built-in ParticipantBuiltinTopicDataDataReader.

If the specified remote dds::domain::DomainParticipant is not in the database of discovered DomainParticipants or has been previously ignored, this operation will fail with dds::core::Error.

This operation can be called multiple times on the same remote participant. If endpoint discovery has already been resumed, successive calls will have no effect and will return successfully.

Parameters
remote_participant_handle<<in>> Handle of a discovered dds::domain::DomainParticipant for which endpoint discovery is to be resumed.
Exceptions
Oneof the Standard Exceptions,or dds::core::NotEnabledError
See also
rti::core::policy::Discovery

◆ delete_durable_subscription()

void delete_durable_subscription ( const rti::core::EndpointGroup group)

<<extension>> Deletes an existing Durable Subscription on all Persistence Services.

Note
This function is an extension, it must be called via this->extensions()

The Persistence Service will delete the Durable Subscription and the quorum of the existing samples will be considered satisfied.

Parameters
group<<in>> rti::core::EndpointGroup specifying the Durable Subscription name. Quorum is not required for this operation.
Exceptions
Oneof the Standard Exceptions

◆ register_durable_subscription()

void register_durable_subscription ( const rti::core::EndpointGroup group,
const std::string &  topic_name 
)

<<extension>> Registers a Durable Subscription on the specified dds::topic::Topic on all Persistence Services.

Note
This function is an extension, it must be called via this->extensions()

If you need to receive all samples published on a dds::topic::Topic, including the ones published while a dds::sub::DataReader is inactive or before it may be created, create a Durable Subscription using this method.

In this way, the Persistence Service will ensure that all the samples on that dds::topic::Topic are retained until they are acknowledged by at least N DataReaders belonging to the Durable Subscription where N is the quorum count.

If the same Durable Subscription is created on a different dds::topic::Topic, the Persistence Service will implicitly delete the previous Durable Subscription and create a new one on the new dds::topic::Topic.

Parameters
group<<in>> rti::core::EndpointGroup The Durable Subscription name and quorum.
topic_name<<in>> The topic name for which the Durable Subscription is created.
Exceptions
Oneof the Standard Exceptions

◆ participant_protocol_status()

rti::core::status::DomainParticipantProtocolStatus participant_protocol_status ( )

<<extension>> Get the protocol status for this participant

Note
This function is an extension, it must be called via this->extensions()

This also resets the status so that it is no longer considered changed.

Exceptions
Oneof the Standard Exceptions or dds::core::NotEnabledError.

Friends And Related Function Documentation

◆ ignore() [1/2]

void ignore ( const dds::domain::DomainParticipant participant,
const dds::core::InstanceHandle handle 
)
related

Instructs RTI Connext to locally ignore a remote dds::domain::DomainParticipant.

#include <dds/domain/discovery.hpp>

Note
This is a standalone function in the namespace dds::domain

From the time of this call onwards, RTI Connext will locally behave as if the remote participant did not exist. This means it will ignore any topic, publication, or subscription that originates on that dds::domain::DomainParticipant.

There is no way to reverse this operation.

This operation can be used in conjunction with the discovery of remote participants offered by means of the dds::topic::ParticipantBuiltinTopicData to provide access control.

Application data can be associated with a dds::domain::DomainParticipant by means of the USER_DATA policy. This application data is propagated as a field in the built-in topic and can be used by an application to implement its own access control policy.

The dds::domain::DomainParticipant to ignore is identified by the handle argument. This handle is the one that appears in the dds::sub::SampleInfo retrieved when reading the data-samples available for the built-in dds::sub::DataReader to the dds::domain::DomainParticipant topic. The built-in dds::sub::DataReader is read with the same dds::sub::DataReader::read and dds::sub::DataReader::take operations used for any dds::sub::DataReader.

Parameters
participantThe DomainParticipant for which the remote entity will be ignored.
handleThe dds::core::InstanceHandle of the remote entity that will be ignored.

◆ ignore() [2/2]

template<typename FwdIterator >
void ignore ( const dds::domain::DomainParticipant participant,
FwdIterator  begin,
FwdIterator  end 
)
related

Instructs RTI Connext to locally ignore a group of remote dds::domain::DomainParticipant.

#include <dds/domain/discovery.hpp>

Note
This is a standalone function in the namespace dds::domain

The series of entities whose instance handles are made available via the provided iterators will be ignored.

Parameters
participantThe DomainParticipant for which the remote entity will be ignored
beginThe begin iterator for the series of InstanceHandles to ignore
endThe end iterator for the series of InstanceHandles to ignore
See also
ignore(const dds::domain::DomainParticipant& participant, const dds::core::InstanceHandle& handle)

◆ discovered_participants() [1/2]

dds::core::InstanceHandleSeq discovered_participants ( const dds::domain::DomainParticipant participant)
related

Retrieves the list of other participants discovered by this participant.

#include <dds/domain/discovery.hpp>

Note
This is a standalone function in the namespace dds::domain

This operation retrieves the list of dds::domain::DomainParticipant entities that have been discovered in the domain and that the application has not indicated should be "ignored" by means of the dds::domain::ignore operation.

Parameters
participantThe DomainParticipant where to look up the discovered participants
Returns
The list of InstanceHandles that can be passed to dds::domain::discovered_participant_data.
Exceptions
Oneof the Standard Exceptions or dds::core::NotEnabledError

◆ discovered_participants() [2/2]

template<typename FwdIterator >
FwdIterator discovered_participants ( const dds::domain::DomainParticipant participant,
FwdIterator  begin,
FwdIterator  end 
)
related

Retrieves the list of other participants discovered by this participant.

#include <dds/domain/discovery.hpp>

Note
This is a standalone function in the namespace dds::domain
Template Parameters
FwdIteratorA forward iterator whose value type is dds::core::InstanceHandleSeq

This overload copies the instance handles into an iterator range.

Parameters
participantThe participant whose discovered participants are looked up
beginThe begin iterator where to copy the instance handles
endOne past the last position where instance handles are copied

◆ discovered_participant_data()

dds::topic::ParticipantBuiltinTopicData discovered_participant_data ( const dds::domain::DomainParticipant participant,
const dds::core::InstanceHandle participant_handle 
)
related

Retrieves the information about one participant discovered by this participant.

#include <dds/domain/discovery.hpp>

Note
This is a standalone function in the namespace dds::domain

This operation retrieves information on a dds::domain::DomainParticipant that has been discovered on the network. The participant must be in the same domain as the participant on which this operation is invoked and must not have been "ignored" by means of the dds::domain::ignore operation.

The participant_handle must correspond to such a DomainParticipant. Otherwise, the operation will fail with dds::core::PreconditionNotMetError.

Use the operation dds::domain::discovered_participants to find the dds::domain::DomainParticipant entities that are currently discovered.

MT Safety:
Safe.
Parameters
participantThe DomainParticipant where to look up the information
participant_handle<<in>> dds::core::InstanceHandle of dds::domain::DomainParticipant.
Returns
The participant information about participant_handle
Exceptions
Oneof the Standard Exceptions, dds::core::PreconditionNotMetError or dds::core::NotEnabledError
See also
dds::topic::ParticipantBuiltinTopicData
dds::domain::discovered_participants

◆ find()

DomainParticipant find ( int32_t  domain_id)
related

Locates an existing dds::domain::DomainParticipant.

#include <dds/domain/find.hpp>

Note
This is a standalone function in the namespace dds::domain

If no such DomainParticipant exists, the operation will return dds::core::null.

If multiple DomainParticipants belonging to that domain id exist, then the operation will return one of them. It is not specified which one.

Parameters
domain_idThe domain id of the DomainParticipant to find

◆ banish_ignored_participants()

void banish_ignored_participants ( const dds::domain::DomainParticipant participant)
related

<<extension>> Prevents ignored remote DomainParticipants from receiving traffic from the local DomainParticipant.

#include <rti/domain/discovery.hpp>

Note
This is a standalone function in the namespace rti::domain

This method complements dds::domain::ignore: ignore_participant prevents the local dds::domain::DomainParticipant from processing traffic from the remote DomainParticipant, while this method prevents already ignored remote DomainParticipants from processing traffic from the local DomainParticipant.

Note: this method is currently only supported when enabling the RTI Security Plugins. Please refer to the RTI Security Plugins User's Manual for more information.

MT Safety:
Safe.
Exceptions
Oneof the Standard Exceptions, dds::core::PreconditionNotMetError, dds::core::NotEnabledError
See also
dds::domain::ignore

◆ discovered_participant_subject_name()

rti::core::optional_value< std::string > discovered_participant_subject_name ( const dds::domain::DomainParticipant participant,
const dds::core::InstanceHandle participant_handle 
)
related

<<extension>> Returns rti::core::policy::EntityName::name for the specified DomainParticipant.

#include <rti/domain/discovery.hpp>

Note
This is a standalone function in the namespace rti::domain

This operation retrieves the rti::core::policy::EntityName::name of a dds::domain::DomainParticipant that has been discovered on the network. The participant must be in the same domain as the participant on which this operation is invoked and must not have been "ignored" by means of the dds::domain::ignore operation.

The participant_handle must correspond to such a DomainParticipant. If the participant_handle is dds::core::InstanceHandle::nil() or is not a valid dds::core::InstanceHandle for a DomainParticipant, then the operation will fail with dds::core::InvalidArgumentError. If the participant_handle corresponds to a DomainParticipant that has not been discovered, then the operation will fail with dds::core::PreconditionNotMetError.

Use the operation dds::domain::discovered_participants to find the dds::domain::DomainParticipant entities that are currently discovered.

Note: this method has different functionality when enabling the RTI Security Plugins. Please refer to the RTI Security Plugins User's Manual for more information.

MT Safety:
Safe.
Parameters
participantThe DomainParticipant that has discovered the discovered participant.
participant_handle<<in>> dds::core::InstanceHandle of dds::domain::DomainParticipant.
Returns
The rti::core::policy::EntityName::name for the participant_handle
Exceptions
Oneof the Standard Exceptions, dds::core::PreconditionNotMetError or dds::core::NotEnabledError
See also
rti::core::policy::EntityName::name
dds::domain::discovered_participants

◆ discovered_participants_from_subject_name()

dds::core::InstanceHandleSeq discovered_participants_from_subject_name ( const dds::domain::DomainParticipant participant,
const rti::core::optional_value< std::string > &  subject_name 
)
related

<<extension>> Returns a list of discovered DomainParticipant entities that have the given rti::core::policy::EntityName::name.

#include <rti/domain/discovery.hpp>

Note
This is a standalone function in the namespace rti::domain

This operation retrieves the same list as dds::domain::discovered_participants, except this list contains only the participants that have the given rti::core::policy::EntityName::name.

Note: this method has different functionality when enabling the RTI Security Plugins. Please refer to the RTI Security Plugins User's Manual for more information.

MT Safety:
Safe.
Parameters
participantThe DomainParticipant whose discovered participants this operation will look up.
subject_name<<in>> The rti::core::policy::EntityName::name by which to filter the list.
Returns
The list of InstanceHandles corresponding to participants with the given rti::core::policy::EntityName::name.
Exceptions
Oneof the Standard Exceptions or dds::core::NotEnabledError

◆ find_participant_by_name()

dds::domain::DomainParticipant find_participant_by_name ( const std::string &  participant_name)
related

<<extension>> Locates an existing dds::domain::DomainParticipant by name.

Note
#include <rti/domain/find.hpp> This function is in the rti::domain namespace

If no such DomainParticipant exists, the operation will return dds::core::null.

◆ find_participants() [1/2]

template<typename ParticipantFwdIterator >
uint32_t find_participants ( ParticipantFwdIterator  begin,
uint32_t  max_size 
)
related

<<extension>> Retrieves all the participants created by the application up to a maximum number

Note
#include <rti/domain/find.hpp> This function is in the rti::domain namespace

If no such DomainParticipant exists, the operation will return dds::core::null.

Template Parameters
ParticipantFwdIteratorA forward iterator whose value type is dds::domain::DomainParticipant
Parameters
beginThe iterator where to begin adding DomainParticipants.
max_sizeThe maximum number of elements to add
Returns
The number of elements added

◆ find_participants() [2/2]

template<typename ParticipantFwdIterator >
uint32_t find_participants ( ParticipantFwdIterator  begin)
related

<<extension>> Retrieves all the participants created by the application

Note
#include <rti/domain/find.hpp> This function is in the rti::domain namespace

(Note: this function is in the rti::domain namespace)

Template Parameters
ParticipantFwdIteratorA forward iterator whose value type is dds::domain::DomainParticipant
Parameters
beginThe iterator where to begin adding DomainParticipants.
Returns
The number of elements added

◆ find_type()

const dds::core::xtypes::DynamicType & find_type ( const dds::domain::DomainParticipant participant,
const std::string &  type_name 
)
related

<<extension>> Retrieves a type registered with this participant

#include <rti/domain/find.hpp>

Note
This is a standalone function in the namespace rti::domain

Every data type used in a DomainParticipant has a registered type name, which in most cases is the same as the type's name (the name used to define the type), but it can be different.

Types are registered by the creation of a dds::topic::Topic, whose constructors optionally receive a registered type name different from the type's name.

Types can also be registered when parsing an XML configuration and calling dds::core::QosProvider::create_participant_from_config().

Parameters
participantThe DomainParticipant where the type is registered
type_nameThe name used to register the type in this participant
Returns
If type_name exists in this participant, this function returns the DynamicType describing the type. It can be cast down to dds::core::xtypes::StructType or dds::core::xtypes::UnionType, depending on whether the type is a struct or a union.
Exceptions
dds::core::ErrorIf the type doesn't exist or the operation fails for any other reason

Example:

dds::topic::Topic<Foo> topic1(participant, "Foo Topic"); // registered as "Foo"
dds::topic::Topic<Foo> topic2(participant, "MyFoo Topic", "MyFoo"); // registered as "MyFoo"
const auto& type1 = rti::domain::find_type(participant, "Foo");
const auto& type2 = rti::domain::find_type(participant, "MyFoo");
std::cout << type1 << std::endl;
std::cout << type2 << std::endl;
assert(type1 == type2); // Same type registered with different names
// Cast to StructType to access more information about the type
const auto& type1_struct =
static_cast<const dds::core::xtypes::StructType&>(type1);
std::cout << type1_struct.member(0).name() << std::endl;

◆ register_type() [1/2]

void register_type ( dds::domain::DomainParticipant participant,
const std::string &  name,
const dds::core::xtypes::DynamicType type,
const rti::core::xtypes::DynamicDataTypeSerializationProperty serialization_property = rti::core::xtypes::DynamicDataTypeSerializationProperty::DEFAULT 
)
related

<<extension>> Registers a DynamicType with specific serialization properties

Typically you don't need to call this function, since this topic constructor takes care of that automatically. You do need to call this function before creating the topic if you want to change the default data-serialization property.

Calling this function also allows to change the registered name of the type, which by default is type.name().

Parameters
participantThe participant where to register this type
nameThe name to use to register this type
typeThe type definition
serialization_propertyThe data-serialization property
See also
dds::core::xtypes::DynamicType
dds::core::xtypes::DynamicData

◆ register_type() [2/2]

template<typename T >
void register_type ( const std::string &  registered_type_name = dds::topic::topic_type_name<T>::value())
related

<<extension>> Registers a User-Generated Type with RTI Connext. This function is used along with XML Application Creation.

When using XML Application creation, you must use this function to register any user-generated types with RTI Connext before creating your system.

When you don't use XML Application creation, you don't typically need to call this function, since the topic constructor takes care of that automatically.

Template Parameters
TThe user-generated type that is being registered
Parameters
registered_type_nameThe name to use when registering the type. This is the name that will be used in your XML configuration file to refer to the type.
See also
dds::domain::DomainParticipant::create_participant_from_config
XML Application Creation