RTI Connext Modern C++ API  Version 6.0.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dds::pub::qos::DataWriterQos Class Reference

<<value-type>> Container of the QoS policies that a dds::pub::DataWriter supports More...

#include <dds/pub/qos/DataWriterQos.hpp>

Public Member Functions

 DataWriterQos ()
 Creates a DataWriterQos with the default value for each policy.
 
DataWriterQosoperator= (const dds::topic::qos::TopicQos &topic_qos)
 Copies into this DataWriterQos those policies that are also in TopicQos.
 
template<typename Policy >
const Policy & policy () const
 Gets a QoS policy by const reference.
 
template<typename Policy >
Policy & policy ()
 Gets a QoS policy by reference.
 
template<typename Policy >
DataWriterQospolicy (const Policy &p)
 Sets a policy.
 
template<typename Policy >
DataWriterQosoperator<< (const Policy &p)
 Sets a policy.
 
template<typename Policy >
const DataWriterQosoperator>> (Policy &p) const
 Copies the values of a policy.
 

Detailed Description

<<value-type>> Container of the QoS policies that a dds::pub::DataWriter supports

DataWriterQos policies

A DataWriterQos contains the following policies:

To get or set policies use the policy() getters and setters or operator << (see examples).

You must set certain members in a consistent manner:

- dds::core::policy::History .depth <= dds::core::policy::ResourceLimits .max_samples_per_instance

- dds::core::policy::ResourceLimits .max_samples_per_instance <= dds::core::policy::ResourceLimits .max_samples

- dds::core::policy::ResourceLimits .initial_samples <= dds::core::policy::ResourceLimits .max_samples

- dds::core::policy::ResourceLimits .initial_instances <= dds::core::policy::ResourceLimits .max_instances

- length of dds::core::policy::UserData .value <= dds::domain::qos::DomainParticipantQos::resource_limits .writer_user_data_max_length

If any of the above are not true, dds::pub::DataWriter::qos(const dds::pub::qos::DataWriterQos&) and dds::pub::Publisher::default_datawriter_qos(const dds::pub::qos::DataWriterQos&) will fail with dds::core::InconsistentPolicyError and the dds::pub::DataWriter constructors will fail with dds::core::Error

Entity:
dds::pub::DataWriter
See Also
QoS Policies allowed ranges within each Qos.
Qos Use Cases

Constructor & Destructor Documentation

dds::pub::qos::DataWriterQos::DataWriterQos ( )

Creates a DataWriterQos with the default value for each policy.

Note
If you configure Qos in XML, obtain the default value from the default QosProvider, since it can be overriden by configuration:

Member Function Documentation

DataWriterQos& dds::pub::qos::DataWriterQos::operator= ( const dds::topic::qos::TopicQos topic_qos)
inline

Copies into this DataWriterQos those policies that are also in TopicQos.

A dds::topic::qos::TopicQos contains a subset of the policies of a DataWriterQos. This assignment operator copies those common policies into this instance while leaving the policies that are only defined in DataWriterQos unaltered.

Parameters
topic_qosThe TopicQos to copy the common policies from.

For example:

// Load a TopicQos from a Qos profile
TopicQos topic_qos = dds::core::QosProvider::Default().topic_qos("MyLibrary::MyProfile");
// Create a DataWriterQos with the default policies
// Overwrite the policies that are also defined in topic_qos
writer_qos = topic_qos;
template<typename Policy >
const Policy& dds::pub::qos::DataWriterQos::policy ( ) const

Gets a QoS policy by const reference.

Template Parameters
PolicyOne of the DataWriterQos policies
See Also
Setting Qos Values
template<typename Policy >
Policy& dds::pub::qos::DataWriterQos::policy ( )

Gets a QoS policy by reference.

Template Parameters
PolicyOne of the DataWriterQos policies
See Also
Setting Qos Values
template<typename Policy >
DataWriterQos& dds::pub::qos::DataWriterQos::policy ( const Policy &  p)
inline

Sets a policy.

See Also
policy()
Setting Qos Values
template<typename Policy >
DataWriterQos& dds::pub::qos::DataWriterQos::operator<< ( const Policy &  p)
inline

Sets a policy.

See Also
policy()
Setting Qos Values
template<typename Policy >
const DataWriterQos& dds::pub::qos::DataWriterQos::operator>> ( Policy &  p) const
inline

Copies the values of a policy.

Parameters
pThe destination where to copy the current value of the Policy
See Also
policy()
Setting Qos Values

RTI Connext Modern C++ API Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc