RTI Connext Modern C++ API
Version 6.0.1
|
<<reference-type>> The QosProvider class provides a way for a user to control and access the XML QoS profiles that are loaded by RTI Connext More...
#include <dds/core/QosProvider.hpp>
Public Member Functions | |
QosProvider (const std::string &uri, const std::string &profile) | |
Create a QosProvider fetching QoS configuration from the specified URI. | |
QosProvider (const std::string &uri) | |
Create a QosProvider fetching QoS configuration from the specified URI. | |
dds::domain::qos::DomainParticipantQos | participant_qos () |
Get the dds::domain::qos::DomainParticipantQos currently associated with this QosProvider. | |
dds::domain::qos::DomainParticipantQos | participant_qos (const std::string &profile) |
Set the dds::domain::qos::DomainParticipantQos that this QosProvider is currently associated with. | |
dds::topic::qos::TopicQos | topic_qos () |
Get the dds::topic::qos::TopicQos currently associated with this QosProvider. | |
dds::topic::qos::TopicQos | topic_qos (const std::string &profile) |
Set the dds::topic::qos::TopicQos that this QosProvider is currently associated with. | |
dds::sub::qos::SubscriberQos | subscriber_qos () |
Get the dds::sub::qos::SubscriberQos currently associated with this QosProvider. | |
dds::sub::qos::SubscriberQos | subscriber_qos (const std::string &profile) |
Set the dds::sub::qos::SubscriberQos that this QosProvider is currently associated with. | |
dds::sub::qos::DataReaderQos | datareader_qos () |
Get the dds::sub::qos::DataReaderQos currently associated with this QosProvider. | |
dds::sub::qos::DataReaderQos | datareader_qos (const std::string &profile) |
Set the dds::sub::qos::DataReaderQos that this QosProvider is currently associated with. | |
dds::pub::qos::PublisherQos | publisher_qos () |
Get the dds::pub::qos::PublisherQos currently associated with this QosProvider. | |
dds::pub::qos::PublisherQos | publisher_qos (const std::string &profile) |
Set the dds::pub::qos::PublisherQos that this QosProvider is currently associated with. | |
dds::pub::qos::DataWriterQos | datawriter_qos () |
Get the dds::pub::qos::DataWriterQos currently associated with this QosProvider. | |
dds::pub::qos::DataWriterQos | datawriter_qos (const std::string &profile) |
Set the dds::pub::qos::DataWriterQos that this QosProvider is currently associated with. | |
static rti::core::QosProviderParams | default_provider_params () |
<<extension>> Get the rti::core::QosProviderParams for the default QosProvider | |
static void | default_provider_params (const rti::core::QosProviderParams ¶ms) |
<<extension>> Set the rti::core::QosProviderParams for the default QosProvider | |
dds::topic::qos::TopicQos | topic_qos_w_topic_name (const std::string &profile, const std::string &topic_name) const |
<<extension>> Set the dds::topic::qos::TopicQos that this QosProvider is currently associated with. | |
dds::topic::qos::TopicQos | topic_qos_w_topic_name (const std::string &topic_name) const |
<<extension>> Set the dds::topic::qos::TopicQos that this QosProvider is currently associated with. | |
dds::sub::qos::DataReaderQos | datareader_qos_w_topic_name (const std::string &profile, const std::string &topic_name) const |
<<extension>> Set the dds::sub::qos::DataReaderQos that this QosProvider is currently associated with. | |
dds::sub::qos::DataReaderQos | datareader_qos_w_topic_name (const std::string &topic_name) const |
<<extension>> Set the dds::sub::qos::DataReaderQos that this QosProvider is currently associated with. | |
dds::pub::qos::DataWriterQos | datawriter_qos_w_topic_name (const std::string &profile, const std::string &topic_name) const |
<<extension>> Set the dds::pub::qos::DataWriterQos that this QosProvider is currently associated with. | |
dds::pub::qos::DataWriterQos | datawriter_qos_w_topic_name (const std::string &topic_name) const |
<<extension>> Set the dds::pub::qos::DataWriterQos that this QosProvider is currently associated with. | |
void | default_library (const std::string &library_name) |
<<extension>> Set the default library for this QosProvider. | |
void | default_profile (const std::string &profile_name) |
<<extension>> Set the default profile for this QosProvider. | |
rti::core::optional_value < std::string > | default_library () const |
<<extension>> Get the default library associated with this QosProvider. | |
rti::core::optional_value < std::string > | default_profile () const |
<<extension>> Get the default profile associated with this QosProvider. | |
rti::core::optional_value < std::string > | default_profile_library () const |
<<extension>> Get the default profile library associated with this QosProvider. | |
dds::core::StringSeq | qos_profile_libraries () const |
<<extension>> Get a list of the QoS profile libraries loaded by this QosProvider. | |
dds::core::StringSeq | qos_profiles (const std::string &library_name) const |
<<extension>> Get a list of the QoS profiles located in the default library of this QosProvider. | |
bool | profiles_loaded () const |
<<extension>> Check if the profiles are loaded by this QosProvider | |
const dds::core::xtypes::DynamicType & | type (const std::string &type_library_name, const std::string &type_name) const |
<<extension>> Load a type | |
const dds::core::xtypes::DynamicType & | type (const std::string &type_name) const |
<<extension>> Load a type | |
dds::core::StringSeq | type_libraries () const |
<<extension>> Get a list of the type libraries loaded by this QosProvider. | |
rti::core::QosProviderParams | provider_params () const |
<<extension>> Get the QosProvider params for this QosProvider. | |
void | provider_params (const rti::core::QosProviderParams &provider_params) |
<<extension>> Set the rti::core::QosProviderParams for this QosProvider. | |
void | load_profiles () |
<<extension>> Load the XML QoS profiles. | |
void | reload_profiles () |
<<extension>> Reload the XML QoS profiles. | |
void | unload_profiles () |
<<extension>> Unload the XML QoS profiles. | |
dds::domain::DomainParticipant | create_participant_from_config (const std::string &config_name, const rti::domain::DomainParticipantConfigParams ¶ms=rti::domain::DomainParticipantConfigParams()) |
<<extension>> Creates a dds::domain::DomainParticipant given its configuration name from a description provided in an XML configuration file that has been loaded by this QosProvider. | |
Static Public Member Functions | |
static QosProvider | Default () |
Get the default QosProvider. | |
static void | reset_default () |
Reset the default settings of the default QosProvider. | |
Related Functions | |
(Note that these are not member functions.) | |
const char * | USE_DDS_DEFAULT_QOS_PROFILE |
Special value to select the default QoS profile. | |
<<reference-type>> The QosProvider class provides a way for a user to control and access the XML QoS profiles that are loaded by RTI Connext
A QosProvider is created with a URI that identifies a file location containing QoS profiles, a string representation of the QoS profiles that you want the QosProvider to load, or a URL group that has a combination of files and strings from which to load profiles. For more information on the correct format of these URIs and URL groups, please see the URL Groups section in the User's Manual.
A number of QosProvider member functions receive a profile name with the format "library_name::profile_name"
to retrieve the Qos definitions.
The following example loads the Qos profiles from a file called "MyProfiles.xml"
. Then it retrives the DataReaderQos
from a profile library called "MyLibrary"
and a profile called "MyProfile"
to create a DataReader
.
The profile name argument is optional. When omitted, the QosProvider looks for a profile with the attribute is_default_qos=true
. Alternatively, the functions default_library() and default_profile() can set the default profile.
More information about QoS Profiles can be found in the QoS Profiles section, in the User's Manual.
A QosProvider also allows loading dds::core::xtypes::DynamicType definitions from XML. See the QosProvider::type() extension function.
A special QosProvider, QosProvider::Default() is always available to obtain the Qos profiles from the default locations, such as the file USER_QOS_PROFILES.xml in the current directory. For example, the following code obtains the default DataReader qos:
This section in the User's Manual explains which profiles are automatically loaded by the default QosProvider.
Any QosProvider, including the default QosProvider, has access to the Builtin Qos Profiles. For example, to obtain the DataWriterQos
from the "strict reliable" built-in profile:
XML Qos definitions can specify a topic_filter
attribute. Several functions (such as datareader_qos_w_topic_name()) receive a topic_name
argument. When these functions look for the Qos, they will try to match the topic_name
against the topic_filter
s, if they are used. See the Topic Filters section in the User's Manual.
|
inline |
Create a QosProvider fetching QoS configuration from the specified URI.
For instance, the following code:
will create a QosProvider which loads all of the QoS profiles from qos-config.xml and uses "MyLibrary::MyProfile" as the default profile.
uri | The URI describing the location of the QoS profiles to load. |
profile | The QoS profile to set as the default, overriding any is_default_qos tag in the loaded XML file. |
|
inlineexplicit |
Create a QosProvider fetching QoS configuration from the specified URI.
For instance, the following code:
will create a QosProvider which loads all of the QoS profiles from qos-config.xml and will only have a default profile if one of the profiles in qos-config.xml is marked with the is_default_qos set to true.
uri | The URI describing the location of the QoS profiles to load. If no is_default_qos tag is found in the QoS profiles, then no profile will be set as default. Instead, the QosProvider will be associated with the DDS default QoS values until a default profile is set using the default_library and default_profile methods. |
|
inline |
Get the dds::domain::qos::DomainParticipantQos currently associated with this QosProvider.
|
inline |
Set the dds::domain::qos::DomainParticipantQos that this QosProvider is currently associated with.
profile | The profile from which to get the DomainParticipantQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::topic::qos::TopicQos currently associated with this QosProvider.
|
inline |
Set the dds::topic::qos::TopicQos that this QosProvider is currently associated with.
profile | The profile from which to get the TopicQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::sub::qos::SubscriberQos currently associated with this QosProvider.
|
inline |
Set the dds::sub::qos::SubscriberQos that this QosProvider is currently associated with.
profile | The profile from which to get the SubscriberQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::sub::qos::DataReaderQos currently associated with this QosProvider.
|
inline |
Set the dds::sub::qos::DataReaderQos that this QosProvider is currently associated with.
profile | The profile from which to get the DataReaderQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::pub::qos::PublisherQos currently associated with this QosProvider.
|
inline |
Set the dds::pub::qos::PublisherQos that this QosProvider is currently associated with.
profile | The profile from which to get the PublisherQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::pub::qos::DataWriterQos currently associated with this QosProvider.
|
inline |
Set the dds::pub::qos::DataWriterQos that this QosProvider is currently associated with.
profile | The profile from which to get the DataWriterQos, for example "MyLibrary::MyProfile" |
|
inlinestatic |
Get the default QosProvider.
The default QosProvider is a singleton that represents the Qos profiles that the DDS entities will be implicitly created with if the Qos parameter is omitted in their constructors. By modifying the default QosProvider you are altering the QoS settings that entities will be created with by default.
The default QosProvider automatically loads XML Qos, types and application profiles from several predetermined locations, such as the file USER_QOS_PROFILES.xml in the current working directory.
|
inlinestatic |
Reset the default settings of the default QosProvider.
If you change the default library or profile associated with the default QosProvider, calling reset_default will set the library and profile back to the default values.
static rti::core::QosProviderParams default_provider_params | ( | ) |
<<extension>> Get the rti::core::QosProviderParams for the default QosProvider
static void default_provider_params | ( | const rti::core::QosProviderParams & | params | ) |
<<extension>> Set the rti::core::QosProviderParams for the default QosProvider
params | The QosProviderParams to set |
dds::topic::qos::TopicQos topic_qos_w_topic_name | ( | const std::string & | profile, |
const std::string & | topic_name | ||
) | const |
<<extension>> Set the dds::topic::qos::TopicQos that this QosProvider is currently associated with.
The TopicQos will be found based on the given profile name and topic name.
profile | The profile where the QosProvider should look for the TopicQos |
topic_name | The topic name used to select a qos within the profile, if the topic_filter attribute is used |
dds::topic::qos::TopicQos topic_qos_w_topic_name | ( | const std::string & | topic_name | ) | const |
<<extension>> Set the dds::topic::qos::TopicQos that this QosProvider is currently associated with.
The TopicQos will be found based on the given topic name and must be located in the current default profile associated with the QosProvider.
topic_name | The topic name used to select a qos within the profile, if the topic_filter attribute is used |
dds::sub::qos::DataReaderQos datareader_qos_w_topic_name | ( | const std::string & | profile, |
const std::string & | topic_name | ||
) | const |
<<extension>> Set the dds::sub::qos::DataReaderQos that this QosProvider is currently associated with.
The DataReaderQos will be found based on the given profile name and topic name
profile | The profile where the QosProvider should look for the DataReaderQos |
topic_name | The topic name used to select a qos within the profile, if the topic_filter attribute is used |
dds::sub::qos::DataReaderQos datareader_qos_w_topic_name | ( | const std::string & | topic_name | ) | const |
<<extension>> Set the dds::sub::qos::DataReaderQos that this QosProvider is currently associated with.
The DataReaderQos will be found based on the given topic name and must be located in the current default profile associated with the QosProvider.
topic_name | The topic name used to select a qos within the profile, if the topic_filter attribute is used |
dds::pub::qos::DataWriterQos datawriter_qos_w_topic_name | ( | const std::string & | profile, |
const std::string & | topic_name | ||
) | const |
<<extension>> Set the dds::pub::qos::DataWriterQos that this QosProvider is currently associated with.
The DataWriterQos will be found based on the given profile name and topic name.
profile | The profile where the QosProvider should look for the DataWriterQos |
topic_name | The topic name used to select a qos within the profile, if the topic_filter attribute is used |
dds::pub::qos::DataWriterQos datawriter_qos_w_topic_name | ( | const std::string & | topic_name | ) | const |
<<extension>> Set the dds::pub::qos::DataWriterQos that this QosProvider is currently associated with.
The DataWriterQos will be found based on the given topic name and must be located in the current default profile associated with the QosProvider.
topic_name | The topic name used to select a qos within the profile, if the topic_filter attribute is used |
void default_library | ( | const std::string & | library_name | ) |
<<extension>> Set the default library for this QosProvider.
After a default library is set, the functions that expect a profile
argument don't need the library name prefix. For example:
library_name | The library to set as the default, or rti::core::USE_DDS_DEFAULT_QOS_PROFILE to unset the default library and use the system default. |
void default_profile | ( | const std::string & | profile_name | ) |
<<extension>> Set the default profile for this QosProvider.
The profile must be located in the current default library unless the library is also specified in the name.
profile_name | The profile to set as the default, or rti::core::USE_DDS_DEFAULT_QOS_PROFILE to unset the default profile and use the system default. |
rti::core::optional_value< std::string > default_library | ( | ) | const |
<<extension>> Get the default library associated with this QosProvider.
There may not be a default library set. The default library is the library that is checked in when setting the default profile if no library name is explicitly given. The default library is configurable.
rti::core::optional_value< std::string > default_profile | ( | ) | const |
<<extension>> Get the default profile associated with this QosProvider.
There may not be a default profile set.
rti::core::optional_value< std::string > default_profile_library | ( | ) | const |
<<extension>> Get the default profile library associated with this QosProvider.
There may not be a default profile library set. The default profile library is the library in which the default profile resides and is not necessarily the same library as the one returned from default_library(). The default profile library is not configurable.
dds::core::StringSeq qos_profile_libraries | ( | ) | const |
<<extension>> Get a list of the QoS profile libraries loaded by this QosProvider.
dds::core::StringSeq qos_profiles | ( | const std::string & | library_name | ) | const |
<<extension>> Get a list of the QoS profiles located in the default library of this QosProvider.
bool profiles_loaded | ( | ) | const |
<<extension>> Check if the profiles are loaded by this QosProvider
const dds::core::xtypes::DynamicType & type | ( | const std::string & | type_library_name, |
const std::string & | type_name | ||
) | const |
<<extension>> Load a type
type_library_name | The name of the library that contains the type |
type_name | The name of the type |
This function loads a type from its XML definition.
const dds::core::xtypes::DynamicType & type | ( | const std::string & | type_name | ) | const |
<<extension>> Load a type
type_name | The name of the type |
This function loads a type from its XML definition. Use this function when the XML file has a single type library or a <types>
tag with no <type_library>
dds::core::StringSeq type_libraries | ( | ) | const |
<<extension>> Get a list of the type libraries loaded by this QosProvider.
rti::core::QosProviderParams provider_params | ( | ) | const |
<<extension>> Get the QosProvider params for this QosProvider.
void provider_params | ( | const rti::core::QosProviderParams & | provider_params | ) |
<<extension>> Set the rti::core::QosProviderParams for this QosProvider.
provider_params | The QosProviderParams to set. |
void load_profiles | ( | ) |
<<extension>> Load the XML QoS profiles.
The XML QoS profiles are loaded implicitly after the first dds::domain::DomainParticipant is created or explicitly, after a call to this function. This method has the same effect as reload_profiles().
void reload_profiles | ( | ) |
<<extension>> Reload the XML QoS profiles.
The XML QoS profiles are loaded implicitly after the first DomainParticipant is created or explicitly, after a call to this function. This method has the same effect as load_profiles().
void unload_profiles | ( | ) |
<<extension>> Unload the XML QoS profiles.
The resources associated with the XML QoS profiles are freed. Any reference to the profiles after calling this function will fail with an Exception.
dds::domain::DomainParticipant create_participant_from_config | ( | const std::string & | config_name, |
const rti::domain::DomainParticipantConfigParams & | params = rti::domain::DomainParticipantConfigParams() |
||
) |
<<extension>> Creates a dds::domain::DomainParticipant given its configuration name from a description provided in an XML configuration file that has been loaded by this QosProvider.
This operation creates a dds::domain::DomainParticipant registering all the necessary data types and creating all the contained entities (dds::topic::Topic, dds::pub::Publisher, dds::sub::Subscriber, dds::pub::DataWriter, dds::sub::DataReader) from a description given in an XML configuration file.
The configuration name is the fully qualified name of the XML participant object, consisting of the name of the participant library plus the name of participant configuration.
For example the name "MyParticipantLibrary::PublicationParticipant" can be used to create the domain participant from the description in an XML file with contents shown in the snippet below:
The entities belonging to the newly created dds::domain::DomainParticipant can be retrieved with the help of lookup operations such as: rti::sub::find_datareader_by_name.
config_name | Name of the participant configuration in the XML file. |
params | input parameters that allow changing some properties of the configuration referred to by config_name . Specifically, params allows overriding the domain ID, participant name, and entities QoS specified in the XML configuration. |
|
related |
Special value to select the default QoS profile.