RTI Connext Modern C++ API
Version 7.0.0
|
<<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>
Static Public Member Functions | |
static QosProvider | Default () |
Get the default QosProvider. More... | |
static void | reset_default () |
Reset the default settings of the default QosProvider. More... | |
Related Functions | |
(Note that these are not member functions.) | |
const char * | USE_DDS_DEFAULT_QOS_PROFILE |
Special value to select the default QoS profile. More... | |
dds::core::detail::QosProvider | create_qos_provider_ex (const rti::core::QosProviderParams ¶ms) |
<<extension>> Creates a QosProvider with parameters More... | |
QosProviderParams | default_qos_provider_params () |
<<extension>> Get the rti::core::QosProviderParams for the default QosProvider More... | |
void | default_qos_provider_params (const rti::core::QosProviderParams ¶ms) |
<<extension>> Set the rti::core::QosProviderParams for the default QosProvider More... | |
<<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 resource from where to load the definition of:
The URI can be:
str://"..."
The following example loads a file named "MyProfiles.xml"
in the current directory. Then it retrieves the DataReaderQos
from a <qos_profile>
named "MyProfile"
under a <qos_library>
named "MyLibrary"
to create a DataReader
:
To load type definitions, see QosProvider::type().
To create a DomainParticipant
and its contained entities, see QosProvider::create_participant_from_config().
The profile name argument is optional:
When omitted, the QosProvider looks for a profile as follows (in order of precedence):
<qos_profile>
identified as the default profile with the attribute is_default_qos=true
A QosProvider can be used in combination with functions such as dds::pub::Publisher::default_datawriter_qos() or dds::sub::Subscriber::default_datareader_qos() to set the profile that entities are created with by default:
More information about QoS Profiles can be found in the QoS Profiles section, in the User's Manual.
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 DataReaderQos
:
This section in the User's Manual explains which profiles are automatically loaded by the default QosProvider.
The profiles that QosProvider::Default() loads can be configured with rti::core::default_qos_provider_params().
QosProvider::Default() also determines the default values for <participant_factory_qos>
, which can be used to configure logging.
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 in the default profile.
See Selecting a QoS profile for information on how the default profile is chosen.
|
inline |
Get the DomainParticipantQos from a QoS profile.
profile | The profile from which to get the DomainParticipantQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::topic::qos::TopicQos in the default profile.
See Selecting a QoS profile for information on how the default profile is chosen.
|
inline |
Get the dds::topic::qos::TopicQos from a QoS profile.
profile | The profile from which to get the TopicQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::sub::qos::SubscriberQos in the default profile.
See Selecting a QoS profile for information on how the default profile is chosen.
|
inline |
Get the dds::sub::qos::SubscriberQos from a QoS profile.
profile | The profile from which to get the SubscriberQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::sub::qos::DataReaderQos in the default profile.
See Selecting a QoS profile for information on how the default profile is chosen.
topic_filter
used in the profile, if any. See datareader_qos_w_topic_name().
|
inline |
Get the dds::sub::qos::DataReaderQos from a QoS profile.
topic_filter
used in the profile, if any. See datareader_qos_w_topic_name().profile | The profile from which to get the DataReaderQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::pub::qos::PublisherQos in the default profile.
See Selecting a QoS profile for information on how the default profile is chosen.
|
inline |
Get the dds::pub::qos::PublisherQos from a QoS profile.
profile | The profile from which to get the PublisherQos, for example "MyLibrary::MyProfile" |
|
inline |
Get the dds::pub::qos::DataWriterQos from the default profile.
See Selecting a QoS profile for information on how the default profile is chosen.
topic_filter
used in the profile, if any. See datawriter_qos_w_topic_name().
|
inline |
Get the dds::pub::qos::DataWriterQos from a QoS profile.
topic_filter
used in the profile, if any. See datawriter_qos_w_topic_name().profile | The profile from which to get the DataWriterQos, for example "MyLibrary::MyProfile" |
|
inlinestatic |
Get the default QosProvider.
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>> (deprecated) Get the rti::core::QosProviderParams for the default QosProvider
[DEPRECATED] Use rti::core::default_qos_provider_params()
static void default_provider_params | ( | const rti::core::QosProviderParams & | params | ) |
<<extension>> (deprecated) Set the rti::core::QosProviderParams for the default QosProvider
[DEPRECATED] Use rti::core::default_qos_provider_params()
params | The QosProviderParams to set |
const dds::topic::qos::TopicQos topic_qos_w_topic_name | ( | const std::string & | profile, |
const std::string & | topic_name | ||
) | const |
<<extension>> Get the dds::topic::qos::TopicQos for a topic name in a given profile.
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 |
const dds::topic::qos::TopicQos topic_qos_w_topic_name | ( | const std::string & | topic_name | ) | const |
<<extension>> Get the dds::topic::qos::TopicQos for a topic name in the default profile.
The TopicQos will be found based on the given topic name and must be located in the default profile (see Selecting a QoS profile for information on how the default profile is determined).
topic_name | The topic name used to select a qos within the profile, if the topic_filter attribute is used |
const dds::sub::qos::DataReaderQos datareader_qos_w_topic_name | ( | const std::string & | profile, |
const std::string & | topic_name | ||
) | const |
<<extension>> Get the dds::sub::qos::DataReaderQos for a topic name in a given profile.
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 |
const dds::sub::qos::DataReaderQos datareader_qos_w_topic_name | ( | const std::string & | topic_name | ) | const |
<<extension>> Get the dds::sub::qos::DataReaderQos for a topic name in the default profile.
The DataReaderQos will be found based on the given topic name and must be located in the default profile (see Selecting a QoS profile for information on how the default profile can is determined).
topic_name | The topic name used to select a qos within the profile, if the topic_filter attribute is used |
const dds::pub::qos::DataWriterQos datawriter_qos_w_topic_name | ( | const std::string & | profile, |
const std::string & | topic_name | ||
) | const |
<<extension>> Get the dds::pub::qos::DataWriterQos for a topic name.
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 |
const dds::pub::qos::DataWriterQos datawriter_qos_w_topic_name | ( | const std::string & | topic_name | ) | const |
<<extension>> Get the dds::pub::qos::DataWriterQos for a topic name.
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.
When a default profile is set, the getters that don't receive a profile argument retrieve the QoS object from this profile (see Selecting a QoS profile).
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 in the form "MyLibrary::MyProfile" , or if the default_library() is also set, "MyProfile" . The special value rti::core::USE_DDS_DEFAULT_QOS_PROFILE unsets a previously set default profile. |
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_name | ) | const |
<<extension>> Load a type
type_name | The name of the type |
This function loads a type from its XML definition under the tags <dds><types>
.
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.
|
related |
<<extension>> Creates a QosProvider with parameters
A dds::core::QosProvider is usually created with one of its constructors, but this extension function allows configuring certain parameters. By default a QosProvider loads the profiles from certain standard locations; this function allows, for example, disabling that behavior.
|
related |
<<extension>> Get the rti::core::QosProviderParams for the default QosProvider
|
related |
<<extension>> Set the rti::core::QosProviderParams for the default QosProvider
Use this function to configure the profiles that dds::core::QosProvider::Default()
loads.
params | The QosProviderParams to set |