<?xml version="1.0"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://community.rti.com/schema/current/rti_dds_profiles.xsd">
<qos_library name="MyLibrary">
<qos_profile name="MyProfile" is_default_qos="true">
<domain_participant_qos>
<participant_name>
<name>ExampleParticipantName</name>
</participant_name>
</domain_participant_qos>
<datawriter_qos>
<publication_name>
<name>ExamplePublicationName</name>
</publication_name>
</datawriter_qos>
</qos_profile>
</qos_library>
<qos_library name="MySecondLibrary">
<qos_profile name="MySecondProfile">
<domain_participant_qos>
<participant_name>
<name>SecondExampleParticipantName</name>
</participant_name>
</domain_participant_qos>
<datawriter_qos>
<publication_name>
<name>SecondExamplePublicationName</name>
</publication_name>
</datawriter_qos>
</qos_profile>
</qos_library>
</dds>
The example code shows how to create a QosProvider, load QoS profiles from the provider, and create entities with those QoS values:
auto participant_qos = my_provider.participant_qos();
std::cout << participant.
qos().
policy<EntityName>().
name().value()
<< std::endl;
participant_qos =
my_provider.participant_qos("MySecondLibrary::MySecondProfile");
std::cout << participant_qos.
policy<EntityName>().
name().value()
<< std::endl;
my_provider.extensions().default_profile("MySecondLibrary::MySecondProfile");
participant_qos = my_provider.participant_qos();
std::cout << participant_qos.
policy<EntityName>().
name().value()
<< std::endl;
publisher,
topic,
my_provider.datawriter_qos());
std::cout << writer.qos().policy<EntityName>().
name().value()
<< std::endl;
my_provider.datawriter_qos("MyLibrary::MyProfile"));
std::cout << writer.qos().policy<EntityName>().
name().value() << std::endl;
const char * my_xml_str =
"str://\"<dds>"
"<qos_library name=\"MyThirdLibrary\">"
"<qos_profile name=\"MyThirdProfile\">"
"<domain_participant_qos>"
"<participant_name>"
"<name>ThirdExampleParticipantName</name>"
"</participant_name>"
"</domain_participant_qos>"
"</qos_profile>"
"</qos_library>"
"</dds>\"";
my_xml_str,
"MyThirdLibrary::MyThirdProfile");
participant_qos = my_provider2.participant_qos();
std::cout << participant_qos.
policy<EntityName>().
name().value()
<< std::endl;
auto libraries = my_provider.extensions().qos_profile_libraries();
std::cout << library << std::endl;
auto profiles = my_provider.extensions().qos_profiles(library);
std::cout << " -" << profile << std::endl;
}
}
<<reference-type>> The QosProvider class provides a way for a user to control and access the XML QoS ...
Definition: TQosProvider.hpp:162
<<reference-type>> Container for all dds::core::Entity objects.
Definition: TDomainParticipant.hpp:63
const dds::domain::qos::DomainParticipantQos qos() const
Gets the current QoS policies of this DomainParticipant.
Definition: TDomainParticipant.hpp:253
const POLICY & policy() const
Gets a QoS policy by const reference.
<<reference-type>> Allows an application to publish data for a dds::topic::Topic
Definition: TDataWriter.hpp:58
<<reference-type>> A publisher is the object responsible for the actual dissemination of publications...
Definition: TPublisher.hpp:52
Publisher & default_datawriter_qos(const dds::pub::qos::DataWriterQos &dwqos)
Sets the default DataWriterQos.
Definition: TPublisher.hpp:183
std::string name() const
<<extension>> Gets the filter name
Definition: FilterImpl.hpp:133
<<reference-type>> Topic is the most basic description of the data to be published and subscribed.
Definition: TTopic.hpp:55
basic_string< char, rti::core::memory::OsapiAllocator< char > > string
A string convertible to std::string and with similar functionality.
Definition: String.hpp:266
std::cout << participant1.qos().policy<EntityName>().
name().value()
<< std::endl;
default_provider.extensions().
default_profile(
"MySecondLibrary::MySecondProfile");
std::cout << participant2.qos().policy<EntityName>().
name().value()
<< std::endl;
std::cout << std::boolalpha
<< participant2.qos().policy<EntityName>().
name().has_value()
<< std::endl;
const dds::domain::qos::DomainParticipantQos participant_qos()
Get the dds::domain::qos::DomainParticipantQos in the default profile.
Definition: TQosProvider.hpp:231
static QosProvider Default()
Get the default QosProvider.
Definition: TQosProvider.hpp:409
void default_profile(const std::string &profile_name)
<<extension>> Set the default profile for this QosProvider.
static void reset_default()
Reset the default settings of the default QosProvider.
Definition: TQosProvider.hpp:421
<<extension>> <<value-type>> Configure options that control the way that XML documents containing QoS...
Definition: QosProviderParams.hpp:80
bool ignore_user_profile() const
Get the value that is currently set for ignore_user_profile.
const dds::core::StringSeq url_profile() const
Get the current list of URL groups stored by this QosProviderParams.
bool ignore_environment_profile() const
Get the value that is currently set for ignore_environment_profile.
QosProviderParams default_qos_provider_params()
<<extension>> Get the rti::core::QosProviderParams for the default QosProvider