RTI Connext Modern C++ API  Version 6.1.1
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

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

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

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.

Typically you don't 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