RTI Connext Modern C++ API  Version 6.1.0
dds::core::policy::DataRepresentation Class Reference

Contains the data representations supported by entities. More...

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

Public Member Functions

 DataRepresentation ()
 Creates an instance with one element, auto_id(). More...
 
 DataRepresentation (const DataRepresentationIdSeq &seq)
 Creates an instance with a sequence of DataRepresentationId. More...
 
 DataRepresentation (const DataRepresentationId *value_begin, const DataRepresentationId *value_end)
 Creates an instance with a sequence of DataRepresentationId. More...
 
template<typename ShortIter >
DataRepresentationvalue (ShortIter the_begin, ShortIter the_end)
 Sets the DataRepresentationId sequence. More...
 
DataRepresentationIdSeq value () const
 Gets the DataRepresentation. More...
 
DataRepresentationIdSeqvalue (DataRepresentationIdSeq &dest) const
 Gets the data representation. More...
 
const rti::core::CompressionSettingscompression_settings () const
 <<extension>> Gets the compression settings by const reference (see setter). More...
 
rti::core::CompressionSettingscompression_settings ()
 <<extension>> Gets the compression settings by non-const reference (see setter) More...
 
dds::core::policy::DataRepresentationcompression_settings (const rti::core::CompressionSettings &compression_settings)
 <<extension>> Sets the compression settings. More...
 

Static Public Member Functions

static DataRepresentationId xcdr ()
 Extended Common Data Representation encoding version 1. More...
 
static DataRepresentationId xml ()
 XML Data Representation (unsupported) More...
 
static DataRepresentationId xcdr2 ()
 Extended Common Data Representation encoding version 2. More...
 
static DataRepresentationId auto_id ()
 Representation automatically chosen based on the type. More...
 

Detailed Description

Contains the data representations supported by entities.

Entity:
dds::topic::Topic, dds::sub::DataReader, dds::pub::DataWriter
Status:
dds::core::status::StatusMask::offered_incompatible_qos(), dds::core::status::StatusMask::requested_incompatible_qos()
Properties:
RxO = YES
Changeable = UNTIL ENABLE
See also
DATA_REPRESENTATION

This policy has request-offer semantics for both representation and compression. For representation, a dds::pub::DataWriter may only offer a single representation. Attempting to put multiple representations in a dds::pub::DataWriter will result in dds::core::InconsistentPolicyError. A dds::pub::DataWriter will use its offered policy to communicate with its matched dds::sub::DataReader entities. A dds::sub::DataReader requests one or more representations. If a dds::pub::DataWriter offers a representation that is contained within the sequence of the dds::sub::DataReader, the offer satisfies the request and the policies are compatible. Otherwise, they are incompatible.

When representations are specified in the dds::topic::qos::TopicQos, dds::pub::qos::DataWriterQos::operator=(const dds::topic::qos::TopicQos&) copies the first element of the sequence, and dds::sub::qos::DataReaderQos::operator=(const dds::topic::qos::TopicQos&) copies the whole sequence.

For Compression, only the rti::core::CompressionSettings::compression_ids is propagated and a dds::pub::DataWriter may only offer a single compression id. Attempting to put multiple compression_ids in a dds::pub::DataWriter will result in dds::core::InconsistentPolicyError.

A dds::pub::DataWriter will use its offered compression algorithm to compress data that it sends to its matched dds::sub::DataReader entities. A dds::sub::DataReader requests zero or more compression algorithms. If a dds::pub::DataWriter offers a representation that is contained within the algorithms requested by the dds::sub::DataReader, the offer satisfies the request and the policies are compatible. Otherwise, they are incompatible.

When compression IDs are specified in the dds::topic::qos::TopicQos, dds::pub::qos::DataWriterQos::operator=(const dds::topic::qos::TopicQos&) copies a single compression ID (see rti::core::CompressionSettings::compression_ids), and dds::sub::qos::DataReaderQos::operator=(const dds::topic::qos::TopicQos&) copies all of the compression_ids.

Constructor & Destructor Documentation

◆ DataRepresentation() [1/3]

dds::core::policy::DataRepresentation::DataRepresentation ( )
inline

Creates an instance with one element, auto_id().

◆ DataRepresentation() [2/3]

dds::core::policy::DataRepresentation::DataRepresentation ( const DataRepresentationIdSeq seq)
inlineexplicit

Creates an instance with a sequence of DataRepresentationId.

Parameters
seqA vector containing the DataRepresentationIds to create this DataRepresentation

◆ DataRepresentation() [3/3]

dds::core::policy::DataRepresentation::DataRepresentation ( const DataRepresentationId value_begin,
const DataRepresentationId value_end 
)
inline

Creates an instance with a sequence of DataRepresentationId.

Parameters
value_beginBeginning of a range of DataRepresentationId
value_endEnd of the range

Member Function Documentation

◆ value() [1/3]

template<typename ShortIter >
DataRepresentation& dds::core::policy::DataRepresentation::value ( ShortIter  the_begin,
ShortIter  the_end 
)
inline

Sets the DataRepresentationId sequence.

Template Parameters
ShortIterAn input iterator of DataRepresentationId.
Parameters
the_beginBeginning of the range
the_endEnd of the range

◆ value() [2/3]

DataRepresentationIdSeq dds::core::policy::DataRepresentation::value ( ) const
inline

Gets the DataRepresentation.

Returns
the sequence of DataRepresentationId representing the data representations

◆ value() [3/3]

DataRepresentationIdSeq& dds::core::policy::DataRepresentation::value ( DataRepresentationIdSeq dest) const
inline

Gets the data representation.

Parameters
destThe vector where the DataRepresentationId will be copied
Returns
A reference to dest

◆ compression_settings() [1/3]

const rti::core::CompressionSettings & compression_settings ( ) const

<<extension>> Gets the compression settings by const reference (see setter).

Note
This function is an extension, it must be called via this->extensions()

◆ compression_settings() [2/3]

rti::core::CompressionSettings & compression_settings ( )

<<extension>> Gets the compression settings by non-const reference (see setter)

Note
This function is an extension, it must be called via this->extensions()

◆ compression_settings() [3/3]

dds::core::policy::DataRepresentation & compression_settings ( const rti::core::CompressionSettings compression_settings)

<<extension>> Sets the compression settings.

Note
This function is an extension, it must be called via this->extensions()

compression_ids:
[default] The value depends on the entity
dds::pub::DataWriter and dds::topic::Topic are set to rti::core::CompressionIdMask::none()
dds::sub::DataReader rti::core::CompressionIdMask::all()

writer_compression_level:
[default] The value depends on the entity
dds::pub::DataWriter and dds::topic::Topic are set to rti::core::CompressionSettings::compression_level_default()
dds::sub::DataReader NOT SUPPORTED

writer_compression_threshold:
[default] The value depends on the entity
dds::pub::DataWriter and dds::topic::Topic are set to rti::core::CompressionSettings::compression_threshold_default()
dds::sub::DataReader NOT SUPPORTED

See also
rti::core::CompressionSettings