RTI Connext Modern C++ API  Version 5.3.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dds::core::QosProvider Class Reference

<<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 &id)
 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 &id)
 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 &id)
 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 &id)
 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 &id)
 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 &id)
 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 &params)
 <<extension>> Set the rti::core::QosProviderParams for the default QosProvider
 
dds::topic::qos::TopicQos topic_qos_w_topic_name (const std::string &id, 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 &id, 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 &id, 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.
 
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
 
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 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.
 
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 &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.
 

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.
 

Detailed Description

<<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 section 17.11 URL Groups in the RTI_CoreLibrariesAndUtilities_Users_Manual.pdf. More information about QoS Profiles can be found in section 17.9 QoS Profiles, also in the User's Manual.

For examples of how to use the QosProvider see Qos Provider Use Cases.

Specifying a Profile Name

Any of the methods that take a profile name can be passed either just the profile name or the library and profile name as a string in the form of "library_name::profile_name".

Passing rti::core::USE_DDS_DEFAULT_QOS_PROFILE for the profile or library name in dds::core::QosProvider::default_profile(const std::string&) or dds::core::QosProvider::default_library(const std::string&) will unset the current default profile or library.

See Also
Qos Provider Use Cases

Constructor & Destructor Documentation

dds::core::QosProvider::QosProvider ( const std::string &  uri,
const std::string &  profile 
)
inline

Create a QosProvider fetching QoS configuration from the specified URI.

For instance, the following code:

dds::core::QosProvider xml_file_provider(
"file:///somewhere/on/disk/qos-config.xml", "MyLibrary::MyProfile");

will create a QosProvider which loads all of the QoS profiles from qos-config.xml and uses "MyLibrary::MyProfile" as the default profile.

Parameters
uriThe URI describing the location of the QoS profiles to load.
profileThe QoS profile to set as the default, overriding any is_default_qos tag in the loaded XML file.
dds::core::QosProvider::QosProvider ( const std::string &  uri)
inlineexplicit

Create a QosProvider fetching QoS configuration from the specified URI.

For instance, the following code:

QosProvider xml_file_provider("file:///somewhere/on/disk/qos-config.xml");

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.

Parameters
uriThe 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.

Member Function Documentation

dds::domain::qos::DomainParticipantQos dds::core::QosProvider::participant_qos ( )
inline

Get the dds::domain::qos::DomainParticipantQos currently associated with this QosProvider.

Returns
The DomainParticipantQos
dds::domain::qos::DomainParticipantQos dds::core::QosProvider::participant_qos ( const std::string &  id)
inline

Set the dds::domain::qos::DomainParticipantQos that this QosProvider is currently associated with.

Parameters
idThe profile from which to get the DomainParticipantQos
Returns
The DomainParticipantQos that is located in the profile specified by id
dds::topic::qos::TopicQos dds::core::QosProvider::topic_qos ( )
inline

Get the dds::topic::qos::TopicQos currently associated with this QosProvider.

Returns
The TopicQos
dds::topic::qos::TopicQos dds::core::QosProvider::topic_qos ( const std::string &  id)
inline

Set the dds::topic::qos::TopicQos that this QosProvider is currently associated with.

Parameters
idThe profile from which to get the TopicQos
Returns
The TopicQos that is located in the profile specified by id
dds::sub::qos::SubscriberQos dds::core::QosProvider::subscriber_qos ( )
inline

Get the dds::sub::qos::SubscriberQos currently associated with this QosProvider.

Returns
The SubscriberQos
dds::sub::qos::SubscriberQos dds::core::QosProvider::subscriber_qos ( const std::string &  id)
inline

Set the dds::sub::qos::SubscriberQos that this QosProvider is currently associated with.

Parameters
idThe profile from which to get the SubscriberQos
Returns
The SubscriberQos that is located in the profile specified by id
dds::sub::qos::DataReaderQos dds::core::QosProvider::datareader_qos ( )
inline

Get the dds::sub::qos::DataReaderQos currently associated with this QosProvider.

Returns
The DataReaderQos
dds::sub::qos::DataReaderQos dds::core::QosProvider::datareader_qos ( const std::string &  id)
inline

Set the dds::sub::qos::DataReaderQos that this QosProvider is currently associated with.

Parameters
idThe profile from which to get the DataReaderQos
Returns
The DataReaderQos that is located in the profile specified by id
dds::pub::qos::PublisherQos dds::core::QosProvider::publisher_qos ( )
inline

Get the dds::pub::qos::PublisherQos currently associated with this QosProvider.

Returns
The PublisherQos
dds::pub::qos::PublisherQos dds::core::QosProvider::publisher_qos ( const std::string &  id)
inline

Set the dds::pub::qos::PublisherQos that this QosProvider is currently associated with.

Parameters
idThe profile from which to get the PublisherQos
Returns
The PublisherQos that is located in the profile specified by id
dds::pub::qos::DataWriterQos dds::core::QosProvider::datawriter_qos ( )
inline

Get the dds::pub::qos::DataWriterQos currently associated with this QosProvider.

Returns
The DataWriterQos
dds::pub::qos::DataWriterQos dds::core::QosProvider::datawriter_qos ( const std::string &  id)
inline

Set the dds::pub::qos::DataWriterQos that this QosProvider is currently associated with.

Parameters
idThe profile from which to get the DataWriterQos
Returns
The DataWriterQos that is located in the profile specified by id
static QosProvider dds::core::QosProvider::Default ( )
inlinestatic

Get the default QosProvider.

The default QosProvider represents the Qos profiles that the DDS entities will be created with if no Qos is provided. By modifying the default QosProvider you are altering the QoS settings that entities will be created with by default.

Returns
The Default QosProvider
See Also
Default QoS
Default QosProvider Use Cases
static void dds::core::QosProvider::reset_default ( )
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 ( )
static void default_provider_params ( const rti::core::QosProviderParams params)

<<extension>> Set the rti::core::QosProviderParams for the default QosProvider

Parameters
paramsThe QosProviderParams to set
dds::topic::qos::TopicQos topic_qos_w_topic_name ( const std::string &  id,
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.

Parameters
idThe profile to look for the TopicQos in
topic_nameThe topic name associated with profile to set
Returns
dds::topic::qos::TopicQos The TopicQos that is located in the profile specified by id
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.

Parameters
topic_nameThe topic name associated with profile to set
Returns
dds::topic::qos::TopicQos The TopicQos that is located in the profile specified by id
dds::sub::qos::DataReaderQos datareader_qos_w_topic_name ( const std::string &  id,
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.

Parameters
idThe profile to look for the DataReaderQos in
topic_nameThe topic name associated with profile to set
Returns
dds::sub::qos::DataReaderQos The DataReaderQos that is located in the profile specified by id
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.

Parameters
topic_nameThe topic name associated with profile to set
Returns
dds::sub::qos::DataReaderQos The DataReaderQos that is located in the profile specified by id
dds::pub::qos::DataWriterQos datawriter_qos_w_topic_name ( const std::string &  id,
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.

Parameters
idThe profile to look for the DataWriterQos in
topic_nameThe topic name associated with profile to set
Returns
dds::pub::qos::DataWriterQos The DataWriterQos that is located in the profile specified by id
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.

Parameters
topic_nameThe topic name associated with profile to set
Returns
dds::pub::qos::DataWriterQos The DataWriterQos that is located in the profile specified by id
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.

Returns
rti::core::optional_value<std::string> The default library.
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.

Returns
rti::core::optional_value<std::string> The default profile.
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.

Returns
rti::core::optional_value<std::string> The default profile library.
dds::core::StringSeq qos_profile_libraries ( ) const

<<extension>> Get a list of the QoS profile libraries loaded by this QosProvider.

Returns
dds::core::StringSeq A list of the currently loaded QoS profile libraries.
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.

Returns
dds::core::StringSeq A list of profiles.
bool profiles_loaded ( ) const

<<extension>> Check if the profiles are loaded by this QosProvider

Returns
bool false if the profiles are not loaded, true otherwise.
const dds::core::xtypes::DynamicType & type ( const std::string &  type_library_name,
const std::string &  type_name 
) const

<<extension>> Load a type

Parameters
type_library_nameThe name of the library that contains the type
type_nameThe name of the type

This function loads a type from its XML definition.

See Also
Example.
dds::core::StringSeq type_libraries ( ) const

<<extension>> Get a list of the type libraries loaded by this QosProvider.

Returns
A list of the currently loaded type libraries.
rti::core::QosProviderParams provider_params ( ) const

<<extension>> Get the QosProvider params for this QosProvider.

Returns
rti::core::QosProviderParams The QosProviderParams for this QosProvider.
void default_library ( const std::string &  library_name)

<<extension>> Set the default library for this QosProvider.

Parameters
library_nameThe 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.

Parameters
profile_nameThe profile to set as the default or rti::core::USE_DDS_DEFAULT_QOS_PROFILE to unset the default profile and use the system default.
void provider_params ( const rti::core::QosProviderParams provider_params)

<<extension>> Set the rti::core::QosProviderParams for this QosProvider.

Parameters
provider_paramsThe 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:

<participant_library name="MyParticipantLibrary">
<domain_participant name="PublicationParticipant" domain_ref="MyDomainLibrary::HelloWorldDomain">
<publisher name="MyPublisher">
<data_writer name="HelloWorldWriter" topic_ref="HelloWorldTopic"/>
</publisher>
</domain_participant>
</participant_library>

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.

See Also
rti::domain::find_participant_by_name
dds::topic::find()
rti::pub::find_publisher
rti::sub::find_subscriber
rti::sub::find_datareader_by_name
rti::pub::find_datawriter_by_name
dds::pub::Publisher::lookup_datawriter_by_name
rti::sub::find_datareader_by_name
Parameters
config_nameName of the participant configuration in the XML file.
paramsinput 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.
See Also
XML Application Creation

Friends And Related Function Documentation

const char* USE_DDS_DEFAULT_QOS_PROFILE
related

Special value to select the default QoS profile.


RTI Connext Modern C++ API Version 5.3.1 Copyright © Mon Feb 19 2018 Real-Time Innovations, Inc