OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org::opensplice::topic::qos Namespace Reference

Functions

dds::topic::qos::TopicQos TransientReliable (void)
 

Function Documentation

◆ TransientReliable()

dds::topic::qos::TopicQos org::opensplice::topic::qos::TransientReliable ( void  )

Creates a transient reliable topic QoS.

This convenience function will create a TopicQos with default values. Except the Durability and Reliability policies are set to dds::core::policy::Durability::Transient() dds::core::policy::Reliability::Reliable() Respectively.

With this TopicQos, transient reliable Topics can be created. This seems somewhat redundant because that can also be achieved by setting these policies manually. However, the TopicQos created by this convenience function has another effect.

Topics have to be supplied when creating DataReaders and DataWriters. Normally, these DataReaders and DataWriters will get the default QoS when no QoS is provided, or use the given QoS. When a Topic is used that was given the QoS returned by this convenience function, the Topic QoS is automatically merged into the DataReader or DataWriter QoS. This means that they will automatically be transient reliable as well.

In short, when using this function, you can easily create transient and reliable DataReaders and DataWriters without having to manage the different types of QoSses and policies.

// Data type dds::core::BytesTopicType is used for this example, but
// this is possible with other data types as well.
// Readers are created similarly.
// Create a transient reliable Topic
dds::core::null,
"TopicName",
// Create a transient reliable DataWriter
dds::core::null,
topic);
// Or directly
dds::core::null,
dds::core::null,
"TopicName",
Returns
Transient Reliable TopicQos, which DataReaders and DataWriters will inherit.