An individual QoS or profile can inherit values from other QoSs or profiles described in the XML file by using the attribute, base_name.
Inheriting from other XML Files:
A QoS or QoS Profile may inherit values from other QoSs or QoS Profiles described in different XML files. A QoS or profile can only inherit from other QoS policies or profiles that have already been loaded. The order in which XML resources are loaded is described in How to Load XML-Specified QoS Settings.
The following examples show how to inherit from other profiles:
<qos_library name=”Library”> <qos_profile name="BaseProfile"> <datawriter_qos> ... </datawriter_qos> <datareader_qos> ... </datareader_qos> </qos_profile> <qos_profile name="DerivedProfile" base_name="BaseProfile"> <datawriter_qos> ... </datawriter_qos> <datareader_qos> ... </datareader_qos> </qos_profile> </qos_library>
The writer_qos and reader_qos in DerivedProfile inherit their values from the corresponding QoS in BaseProfile.
<qos_library name=”Library”> <datareader_qos name="BaseProfile"> ... </datareader_qos> <datareader_qos name="DerivedProfile" base_name="BaseProfile" ... </datareader_qos> </qos_library>
The datareader_qos in DerivedProfile inherits its values from the datareader_qos of BaseProfile. In this example, the datareader_qos definition is a shortcut for a profile definition with a single QoS.
<qos_library name=”Library”> <qos_profile name="Profile1"> <datawriter_qos name="BaseWriterQoS"> ... </datawriter_qos> <datareader_qos> ... </datareader_qos> </qos_profile> <qos_profile name="Profile2"> <datawriter_qos name="DerivedWriterQos" base_name="Profile1::BaseWriterQos"> ... </datawriter_qos> <datareader_qos> ... </datareader_qos> </qos_profile> </qos_library>
The datawriter_qos in Profile2 inherits its values from the datawriter_qos in Profile1. The datareader_qos in Profile2 will not inherit the values from the corresponding QoS in Profile1.
<qos_library name=”Library”> <qos_profile name="Profile1"> <datawriter_qos> ... </datawriter_qos> <datareader_qos> ... </datareader_qos> </qos_profile> <qos_profile name="Profile2"> <datawriter_qos name="BaseWriterQoS"> ... </datawriter_qos> <datareader_qos> ... </datareader_qos> </qos_profile> <qos_profile name="Profile3" base_name="Profile1"> <datawriter_qos name="DerivedWriterQos" base_name="Profile2::BaseWriterQos"> ... </datawriter_qos> <datareader_qos> ... </datareader_qos> </qos_profile> </qos_library></qos_library>
The datawriter_qos in Profile3 inherits its values from the datawriter_qos in Profile2. The datareader_qos in Profile3 inherits its values from the datareader_qos in Profile1.
<qos_library name=”Library”> <datareader_qos name="BaseProfile"> ... </datareader_qos> <profile name="DerivedProfile" base_name="BaseProfile"> <datareader_qos> ... </datareader_qos> </profile> </qos_library>
The datareader_qos in DerivedProfile inherits its values from the datareader_qos in BaseProfile.
© 2017 RTI