19.2.2 Getting and Setting Default QoS for DomainParticipants
To get the default QoS that will be used for creating DomainParticipants if create_participant() is called with DDS_PARTICIPANT_QOS_DEFAULT as the qos parameter, use this DomainParticipantFactory operation:
DDS_ReturnCode_t get_default_participant_qos (DDS_DomainParticipantQos & qos)
This operation gets the QoS settings that were specified on the last successful call to set_default_participant_qos() or set_default_participant_qos_with_profile(), or if the call was never made, the default values listed in DDS_DomainParticipantQos.
To set the default QoS that will be used for new DomainParticipants, use the following operations. Then these default QoS will be used if create_participant() is called with DDS_PARTICIPANT_QOS_DEFAULT as the ‘qos’ parameter.
DDS_ReturnCode_t set_default_participant_qos (
const DDS_DomainParticipantQos &qos)
or
DDS_ReturnCode_t set_default_participant_qos_with_profile (
const char *library_name, const char *profile_name)
Notes:
- These operations may potentially allocate memory, depending on the sequences contained in some QoS policies.
- It is not safe to set the default DomainParticipant QoS values while another thread may be simultaneously calling get_default_participant_qos(), set_default_participant_qos(), or create_participant() with DDS_PARTICIPANT_QOS_DEFAULT as the qos parameter. It is also not safe to get the default DomainParticipant QoS values while another thread may be simultaneously calling set_default_participant_qos().