Cyclone ISO C++ API Reference Guide
dds::sub::qos::DataReaderQos Class Reference

This class provides the basic mechanism for an application to specify Quality of Service attributes for a DataReader. More...

#include "DataReaderQos.hpp"

Inherits dds::core::EntityQos< org::eclipse::cyclonedds::sub::qos::DataReaderQosDelegate >.

Public Member Functions

 DataReaderQos ()
 
 DataReaderQos (const DataReaderQos &qos)
 
 DataReaderQos (const dds::topic::qos::TopicQos &qos)
 
EntityQosoperator<< (const POLICY &p)
 
DataReaderQosoperator= (const dds::topic::qos::TopicQos &other)
 
const EntityQosoperator>> (POLICY &p) const
 
POLICY & policy ()
 
const POLICY & policy () const
 
EntityQospolicy (const POLICY &p)
 

Detailed Description

This class provides the basic mechanism for an application to specify Quality of Service attributes for a DataReader.

Attributes
QosPolicy Desciption Default Value
dds::core::policy::Durability Data storage settings for late joiners (info) Durability::Volatile()
dds::core::policy::Deadline Period in which new sample is written (info) Deadline::Deadline(infinite)
dds::core::policy::LatencyBudget Used for optimization (info) LatencyBudget::LatencyBudget(zero)
dds::core::policy::Liveliness Liveliness assertion mechanism (info) Liveliness::Automatic()
dds::core::policy::Reliability Reliability settings (info) Reliability::BestEffort()
dds::core::policy::DestinationOrder DataReader data order settings (info) DestinationOrder::ReceptionTimestamp()
dds::core::policy::History Data storage settings (info) History::KeepLast(depth 1)
dds::core::policy::ResourceLimits Maximum resource settings (info) ResourceLimits::ResourceLimits(all unlimited)
dds::core::policy::UserData Additional information (info) UserData::UserData(empty)
dds::core::policy::Ownership Exclusive ownership or not (info) Ownership::Shared()
dds::core::policy::TimeBasedFilter Maximum data rate (info) TimeBasedFilter::TimeBasedFilter(0)
dds::core::policy::ReaderDataLifecycle Instance state changes and notifications (info) ReaderDataLifecycle::NoAutoPurgeDisposedSamples()

A QosPolicy can be set when the DataReader is created or modified with the set qos operation. Both operations take the DataReaderQos object as a parameter. There may be cases where several policies are in conflict. Consistency checking is performed each time the policies are modified when they are being created and, in case they are already enabled, via the set qos operation.

Some QosPolicy have "immutable" semantics meaning that they can only be specified either at DataReader creation time or prior to calling the enable operation on the DataReader.

See also
DCPS_QoS

Definition at line 66 of file DataReaderQos.hpp.

Constructor & Destructor Documentation

◆ DataReaderQos() [1/3]

dds::sub::qos::DataReaderQos::DataReaderQos ( )
inline

Create a default QoS.

Definition at line 72 of file DataReaderQos.hpp.

◆ DataReaderQos() [2/3]

dds::sub::qos::DataReaderQos::DataReaderQos ( const DataReaderQos qos)

Create copied QoS.

Parameters
qosthe QoS to copy policies from.

◆ DataReaderQos() [3/3]

dds::sub::qos::DataReaderQos::DataReaderQos ( const dds::topic::qos::TopicQos qos)

Create a DataReader QoS from a TopicQos.

This operation will copy the QosPolicy settings from the TopicQos to the corresponding QosPolicy settings in the DataReaderQos. The related value in DataReaderQos will be repliced, while the other policies will get the default QoS policies.

This is a "convenience" operation. It can be used to merge default DataReader QosPolicy settings with the corresponding ones on the Topic. The resulting DataReaderQos can then be used to create a new DataReader, or set its DataReaderQos.

dds::topic::qos::TopicQos topicQos = topic.qos();
dds::sub::qos::DataReaderQos readerQos(topicQos);
// Policies of the DataReaderQos that are not present in the TopicQos
// have the default value.

This operation does not check the resulting DataReaderQos for self consistency. This is because the "merged" DataReaderQos may not be the final one, as the application can still modify some QosPolicy settings prior to applying the DataReaderQos to the DataReader.

Parameters
qosthe QoS to copy policies from.

Member Function Documentation

◆ operator<<()

EntityQos& dds::core::EntityQos::operator<< ( const POLICY &  p)
inherited

Generic function for setting a policy applicable to this QoS object. Available policies depend on the actual instantiation of the template class, which might be DomainParticipantQos, TopicQos, PublisherQos, etc.

Parameters
pthe policy to be set for this QoS instance.

◆ operator=()

DataReaderQos& dds::sub::qos::DataReaderQos::operator= ( const dds::topic::qos::TopicQos other)

Assign dds::topic::qos::TopicQos policies to the DataReaderQos.

This operation will copy the QosPolicy settings from the TopicQos to the corresponding QosPolicy settings in the DataReaderQos (replacing the values, if present).

This is a "convenience" operation, useful in combination with the operations Subscriber::default_datareader_qos() and dds::topic::Topic::qos(). This operation can be used to merge the DataReader QosPolicy settings with the corresponding ones on the Topic. The resulting DataReaderQos can then be used to create a new DataReader, or set its DataReaderQos.

dds::topic::qos::TopicQos topicQos = topic.qos();
dds::sub::qos::DataReaderQos readerQos = subscriber.default_datareader_qos();
readerQos = topicQos;
// Policies of the DataReaderQos that are not present in the TopicQos are untouched.

This operation does not check the resulting DataReaderQos for self consistency. This is because the "merged" DataReaderQos may not be the final one, as the application can still modify some QosPolicy settings prior to applying the DataReaderQos to the DataReader.

Parameters
qosthe QoS to copy policies from.

◆ operator>>()

const EntityQos& dds::core::EntityQos::operator>> ( POLICY &  p) const
inherited

Generic function for obtaining the value of a specific policy belonging to this QoS instance.

Returns
policy

◆ policy() [1/3]

POLICY& dds::core::EntityQos::policy ( )
inherited

Generic function for obtaining the value of a specific policy belonging to this QoS instance.

Returns
policy

◆ policy() [2/3]

const POLICY& dds::core::EntityQos::policy ( ) const
inherited

Generic function for obtaining the value of a specific policy belonging to this QoS instance.

Returns
policy

◆ policy() [3/3]

EntityQos& dds::core::EntityQos::policy ( const POLICY &  p)
inherited

Generic function for setting a policy applicable to this QoS object. Available policies depend on the actual instantiation of the template class, which might be DomainParticipantQos, TopicQos, PublisherQos, etc.

Parameters
pthe policy to be set for this QoS instance.

The documentation for this class was generated from the following file:
dds::topic::qos::TopicQos
This struct provides the basic mechanism for an application to specify Quality of Service attributes ...
Definition: TopicQos.hpp:67
dds::sub::qos::DataReaderQos
This class provides the basic mechanism for an application to specify Quality of Service attributes f...
Definition: DataReaderQos.hpp:66