The different QoS classes are containers of QoS policies of a concrete dds::core::Entity. Each Entity has a qos() getter and setter.
Setting Qos Values
There are a few different ways to set the values of a QoS policy within an entity's QoS object
- Setting a QoS policy with operator <<
using namespace dds::core::policy;
reader_qos << reliability.
kind(ReliabilityKind::RELIABLE);
- Many of the QoS policies have appropriately named constructors that will construct a QoS policy object with values for some of the fields in the policy. The following code example is equivalent to the above example.
using namespace dds::core::policy;
- You can also set a QoS policy on a QoS object using the QoS object's policy() setter which is templatized on the QoS policy that it is being used to set. The following code example is equivalent to the above two examples.
using namespace dds::core::policy;
Getting Qos Values
There are a few different ways to get the values of a QoS policy from an entity's QoS object
- Getting a QoS policy with operator >>
using namespace dds::core::policy;
reader_qos >> reliability;
- You can also get a QoS policy from a QoS object using the QoS object's policy() getter which is templatized on the QoS policy that it is being used to get. The following code example is equivalent to the above example.
using namespace dds::core::policy;