RTI Connext Modern C++ API Version 7.3.0
rti::core::policy::DataWriterProtocol Class Reference

<<extension>> Configures aspects of an the RTPS protocol related to a dds::pub::DataWriter More...

#include <rti/core/policy/CorePolicy.hpp>

Public Member Functions

 DataWriterProtocol ()
 Creates the default policy. More...
 
DataWriterProtocolvirtual_guid (const rti::core::Guid &the_virtual_guid)
 The virtual GUID (Global Unique Identifier). More...
 
rti::core::Guid virtual_guid () const
 Getter (see setter with the same name) More...
 
DataWriterProtocolrtps_object_id (uint32_t the_rtps_object_id)
 The RTPS Object ID. More...
 
uint32_t rtps_object_id () const
 Getter (see setter with the same name) More...
 
DataWriterProtocolpush_on_write (bool the_push_on_write)
 Whether to push sample out when write is called. More...
 
bool push_on_write () const
 Getter (see setter with the same name) More...
 
DataWriterProtocoldisable_positive_acks (bool the_disable_positive_acks)
 Controls whether or not the writer expects positive acknowledgements from matching readers. More...
 
bool disable_positive_acks () const
 Getter (see setter with the same name) More...
 
DataWriterProtocoldisable_inline_keyhash (bool the_disable_inline_keyhash)
 Controls whether or not a keyhash is propagated on the wire with each sample. More...
 
bool disable_inline_keyhash () const
 Getter (see setter with the same name) More...
 
DataWriterProtocolserialize_key_with_dispose (bool the_serialize_key_with_dispose)
 Controls whether or not the serialized key is propagated on the wire with dispose samples. More...
 
bool serialize_key_with_dispose () const
 Getter (see setter with the same name) More...
 
DataWriterProtocolpropagate_app_ack_with_no_response (bool the_propagate_app_ack_with_no_response)
 Controls whether or not a dds::pub::DataWriter receives dds::pub::DataWriterListener::on_application_acknowledgment notifications with an empty or invalid response. More...
 
bool propagate_app_ack_with_no_response () const
 Getter (see setter with the same name) More...
 
DataWriterProtocolrtps_reliable_writer (const RtpsReliableWriterProtocol &the_rtps_reliable_writer)
 RTPS protocol-related configuration settings for the RTPS reliable writer associated with a dds::pub::DataWriter. This parameter only has effect if both the writer and the matching reader are configured with dds::core::policy::ReliabilityKind_def::RELIABLE dds::core::policy::ReliabilityKind_def. More...
 
const RtpsReliableWriterProtocolrtps_reliable_writer () const
 Gets the reliable settings by const-reference (see setter) More...
 
RtpsReliableWriterProtocolrtps_reliable_writer ()
 Gets the reliable settings by reference (see setter) More...
 
DataWriterProtocolinitial_virtual_sequence_number (const rti::core::SequenceNumber &the_initial_virtual_sequence_number)
 Determines, the initial virtual sequence number for this DataWriter. More...
 

Detailed Description

<<extension>> Configures aspects of an the RTPS protocol related to a dds::pub::DataWriter

DDS has a standard protocol for packet (user and meta data) exchange between applications using DDS for communications. This QoS policy and rti::core::policy::DataWriterProtocol give you control over configurable portions of the protocol, including the configuration of the reliable data delivery mechanism of the protocol on a per DataWriter or DataReader basis.

These configuration parameters control timing, timeouts, and give you the ability to tradeoff between speed of data loss detection and repair versus network and CPU bandwidth used to maintain reliability.

It is important to tune the reliability protocol (on a per dds::pub::DataWriter and dds::sub::DataReader basis) to meet the requirements of the end-user application so that data can be sent between DataWriters and DataReaders in an efficient and optimal manner in the presence of data loss.

You can also use this QoS policy to control how RTI Connext responds to "slow" reliable DataReaders or ones that disconnect or are otherwise lost. See dds::core::policy::Reliability for more information on the per-DataReader/DataWriter reliability configuration. dds::core::policy::History and dds::core::policy::ResourceLimits also play an important role in the DDS reliable protocol.

This QoS policy is an extension to the DDS standard.

Entity:
dds::pub::DataWriter
Properties:
RxO = N/A
Changeable = NO

Constructor & Destructor Documentation

◆ DataWriterProtocol()

rti::core::policy::DataWriterProtocol::DataWriterProtocol ( )
inline

Creates the default policy.

Member Function Documentation

◆ virtual_guid() [1/2]

DataWriterProtocol & rti::core::policy::DataWriterProtocol::virtual_guid ( const rti::core::Guid the_virtual_guid)

The virtual GUID (Global Unique Identifier).

The virtual GUID is used to uniquely identify different incarnations of the same dds::pub::DataWriter.

RTI Connext uses the virtual GUID to associate a persisted writer history to a specific dds::pub::DataWriter.

The RTI Connext Persistence Service uses the virtual GUID to send samples on behalf of the original dds::pub::DataWriter.

[default] rti::core::Guid::automatic()

◆ virtual_guid() [2/2]

rti::core::Guid rti::core::policy::DataWriterProtocol::virtual_guid ( ) const

Getter (see setter with the same name)

◆ rtps_object_id() [1/2]

DataWriterProtocol & rti::core::policy::DataWriterProtocol::rtps_object_id ( uint32_t  the_rtps_object_id)

The RTPS Object ID.

This value is used to determine the RTPS object ID of a data writer according to the DDS-RTPS Interoperability Wire Protocol.

Only the last 3 bytes are used; the most significant byte is ignored.

If the default value is specified, RTI Connext will automatically assign the object ID based on a counter value (per participant) starting at 0x00800000. That value is incremented for each new data writer.

A rtps_object_id value in the interval [0x00800000,0x00ffffff] may collide with the automatic values assigned by RTI Connext. In those cases, the recomendation is not to use automatic object ID assigment.

[default] rti::core::policy::WireProtocol::RTPS_AUTO_ID

[range] [0,0x00ffffff]

◆ rtps_object_id() [2/2]

uint32_t rti::core::policy::DataWriterProtocol::rtps_object_id ( ) const

Getter (see setter with the same name)

◆ push_on_write() [1/2]

DataWriterProtocol & rti::core::policy::DataWriterProtocol::push_on_write ( bool  the_push_on_write)

Whether to push sample out when write is called.

If set to true (the default), the writer will send a sample every time write is called. Otherwise, the sample is put into the queue waiting for a NACK from remote reader(s) to be sent out.

[default] true

◆ push_on_write() [2/2]

bool rti::core::policy::DataWriterProtocol::push_on_write ( ) const

Getter (see setter with the same name)

◆ disable_positive_acks() [1/2]

DataWriterProtocol & rti::core::policy::DataWriterProtocol::disable_positive_acks ( bool  the_disable_positive_acks)

Controls whether or not the writer expects positive acknowledgements from matching readers.

If set to true, the writer does not expect readers to send send positive acknowledgments to the writer. Consequently, instead of keeping a sample queued until all readers have positively acknowledged it, the writer will keep a sample for at least rti::core::RtpsReliableWriterProtocol::disable_positive_acks_min_sample_keep_duration, after which the sample is logically considered as positively acknowledged.

If set to false (the default), the writer expects to receive positive acknowledgements from its acknowledging readers (rti::core::policy::DataReaderProtocol::disable_positive_acks = false) and it applies the keep-duration to its non-acknowledging readers (rti::core::policy::DataReaderProtocol::disable_positive_acks = true).

A writer with both acknowledging and non-acknowledging readers keeps a sample queued until acknowledgements have been received from all acknowledging readers and the keep-duration has elapsed for non-acknowledging readers.

[default] false

◆ disable_positive_acks() [2/2]

bool rti::core::policy::DataWriterProtocol::disable_positive_acks ( ) const

Getter (see setter with the same name)

◆ disable_inline_keyhash() [1/2]

DataWriterProtocol & rti::core::policy::DataWriterProtocol::disable_inline_keyhash ( bool  the_disable_inline_keyhash)

Controls whether or not a keyhash is propagated on the wire with each sample.

This field only applies to keyed writers.

With each key, RTI Connext associates an internal 16-byte representation, called a keyhash.

When this field is false, the keyhash is sent on the wire with every data instance.

When this field is true, the keyhash is not sent on the wire and the readers must compute the value using the received data.

If the reader is CPU bound, sending the keyhash on the wire may increase performance, because the reader does not have to get the keyhash from the data.

If the writer is CPU bound, sending the keyhash on the wire may decrease performance, because it requires more bandwidth (16 more bytes per sample).

Note: Setting disable_inline_keyhash to true is not compatible with using RTI Real-Time Connect or RTI Recorder.

[default] false

◆ disable_inline_keyhash() [2/2]

bool rti::core::policy::DataWriterProtocol::disable_inline_keyhash ( ) const

Getter (see setter with the same name)

◆ serialize_key_with_dispose() [1/2]

DataWriterProtocol & rti::core::policy::DataWriterProtocol::serialize_key_with_dispose ( bool  the_serialize_key_with_dispose)

Controls whether or not the serialized key is propagated on the wire with dispose samples.

This field only applies to keyed writers.

We recommend setting this field to true if there are DataReaders where rti::core::policy::DataReaderProtocol::propagate_dispose_of_unregistered_instances is also true.

When setting serialize_key_with_dispose to FALSE, only a key hash is included in the dispose meta-sample sent by a DataWriter for a dispose action. If a dispose meta-sample only includes the key hash, then DataReaders must have previously received an actual data sample for the instance being disposed, in order for a DataReader to map a key hash/instance handle to actual key values.

If an actual data sample was never received for an instance and serialize_key_with_dispose is set to FALSE, then the DataReader application will not be able to determine the value of the key that was disposed, since dds::sub::DataReader::key_value will not be able to map an instance handle to actual key values.

By setting serialize_key_with_dispose to TRUE, the values of the key members of a data type will be sent in the dispose meta-sample for a dispose action by the DataWriter. This allows the DataReader to map an instance handle to the values of the key members even when receiving a dispose meta-sample without previously having received a data sample for the instance.

Important: When this field is true, batching will not be compatible with RTI Connext 4.3e, 4.4b, or 4.4c. The dds::sub::DataReader entities will receive incorrect data and/or encounter deserialization errors.

[default] false

◆ serialize_key_with_dispose() [2/2]

bool rti::core::policy::DataWriterProtocol::serialize_key_with_dispose ( ) const

Getter (see setter with the same name)

◆ propagate_app_ack_with_no_response() [1/2]

DataWriterProtocol & rti::core::policy::DataWriterProtocol::propagate_app_ack_with_no_response ( bool  the_propagate_app_ack_with_no_response)

Controls whether or not a dds::pub::DataWriter receives dds::pub::DataWriterListener::on_application_acknowledgment notifications with an empty or invalid response.

When this field is set to false, the callback dds::pub::DataWriterListener::on_application_acknowledgment will not be invoked if the sample being acknowledged has an empty or invalid response.

[default] true

◆ propagate_app_ack_with_no_response() [2/2]

bool rti::core::policy::DataWriterProtocol::propagate_app_ack_with_no_response ( ) const

Getter (see setter with the same name)

◆ rtps_reliable_writer() [1/3]

DataWriterProtocol & rti::core::policy::DataWriterProtocol::rtps_reliable_writer ( const RtpsReliableWriterProtocol the_rtps_reliable_writer)

RTPS protocol-related configuration settings for the RTPS reliable writer associated with a dds::pub::DataWriter. This parameter only has effect if both the writer and the matching reader are configured with dds::core::policy::ReliabilityKind_def::RELIABLE dds::core::policy::ReliabilityKind_def.

For details, refer to the rti::core::RtpsReliableWriterProtocol

[default] [default] See rti::core::RtpsReliableWriterProtocol

◆ rtps_reliable_writer() [2/3]

const RtpsReliableWriterProtocol & rti::core::policy::DataWriterProtocol::rtps_reliable_writer ( ) const

Gets the reliable settings by const-reference (see setter)

◆ rtps_reliable_writer() [3/3]

RtpsReliableWriterProtocol & rti::core::policy::DataWriterProtocol::rtps_reliable_writer ( )

Gets the reliable settings by reference (see setter)

◆ initial_virtual_sequence_number()

DataWriterProtocol & rti::core::policy::DataWriterProtocol::initial_virtual_sequence_number ( const rti::core::SequenceNumber the_initial_virtual_sequence_number)

Determines, the initial virtual sequence number for this DataWriter.

By default, the virtual sequence number of the first sample published by a DataWriter will be 1 for DataWriters that do not use durable writer history. For durable writers, the default virtual sequence number will be the last sequence number they published in a previous execution, plus one. So, when a non-durable DataWriter is restarted and must continue communicating with the same DataReaders, its samples start over with sequence number 1. Durable DataWriters start over where the last sequence number left off, plus one.

This QoS setting allows overwriting the default initial virtual sequence number.

Normally, this parameter is not expected to be modified; however, in some scenarios when continuing communication after restarting, applications may require the DataWriter's virtual sequence number to start at something other than the value described above. An example would be to enable non-durable DataWriters to start at the last sequence number published, plus one, similar to the durable DataWriter. This property enables you to make such a configuration, if desired.

The virtual sequence number can be overwritten as well on a per sample basis by updating rti::pub::WriteParams::identity in the dds::pub::DataWriter::write(const T&,rti::pub::WriteParams&).

[default] SequenceNumber_t::AUTO