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 <<
reader_qos << reliability.
kind(ReliabilityKind::RELIABLE);
Indicates the level of reliability in sample delivered that a dds::pub::DataWriter offers or a dds::s...
Definition: TCorePolicy.hpp:1298
Reliability & kind(dds::core::policy::ReliabilityKind the_kind)
Sets the reliability kind.
Definition: TCorePolicy.hpp:1328
<<value-type>> Container of the QoS policies that a dds::sub::DataReader supports
Definition: DataReaderQosImpl.hpp:85
Contains the standard Qos policy classes.
Definition: ddscore.hpp:202
- 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.
reader_qos << Reliability::Reliable();
- 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.
reader_qos.
policy<Reliability>(Reliability::Reliable());
reader_qos.
policy<Reliability>().kind(ReliabilityKind::RELIABLE);
const POLICY & policy() const
Gets a QoS policy by const reference.
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 >>
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.
reliability = reader_qos.
policy<Reliability>();