RTI Connext Modern C++ API  Version 7.0.0
rti::domain Namespace Reference

<<extension>> Extensions to dds::domain More...

Classes

class  DomainParticipantConfigParams
 <<extension>> <<value-type>> Input paramaters for creating a participant from xml configuration. It allows modification of some of the properties of the entities defined in the configuration. More...
 

Functions

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

<<extension>> Extensions to dds::domain

Function Documentation

◆ banish_ignored_participants()

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

<<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 > rti::domain::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.

#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 rti::domain::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.

#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 rti::domain::find_participant_by_name ( const std::string &  participant_name)

<<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 rti::domain::find_participants ( ParticipantFwdIterator  begin,
uint32_t  max_size 
)

<<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 rti::domain::find_participants ( ParticipantFwdIterator  begin)

<<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

References find_type().

◆ find_type()

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

<<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;

Referenced by find_participants().

◆ register_type() [1/2]

void rti::domain::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

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 rti::domain::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.

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