RTI Connext Modern C++ API  Version 5.3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::core::policy::TypeSupport Class Reference

<<extension>> Allows attaching application-specific information to a dds::pub::DataWriter or dds::sub::DataReader that is passed to the serilization and deserialization routines. More...

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

Public Member Functions

 TypeSupport ()
 Creates the default policy.
 
TypeSupportplugin_data (void *the_plugin_data)
 Value to pass into the type plugin's de-/serialization function.
 
void * plugin_data ()
 Getter (see setter with the same name)
 
TypeSupportcdr_padding_kind (CdrPaddingKind the_cdr_padding_kind)
 Determines whether or not the padding bytes will be set to zero during CDR serialization.
 
CdrPaddingKind cdr_padding_kind () const
 Getter (see setter with the same name)
 

Detailed Description

<<extension>> Allows attaching application-specific information to a dds::pub::DataWriter or dds::sub::DataReader that is passed to the serilization and deserialization routines.

The purpose of this QoS is to allow a user application to pass data to a type plugin's support functions and choose whether or not to set the padding bytes to zero when serializing a sample using CDR encapsulation.

Entity:
dds::domain::DomainParticipant, dds::sub::DataReader, dds::pub::DataWriter
Properties:
RxO = NO

Changeable = UNTIL ENABLE

Usage

The rti::core::policy::TypeSupport::plugin_data allows you to associate a pointer to an object with a dds::pub::DataWriter or dds::sub::DataReader. This object pointer is passed to the serialization routine of the data type associated with the dds::pub::DataWriter or the deserialization routine of the data type associated with the dds::sub::DataReader.

You can modify the rtiddsgen-generated code so that the de/serialization routines act differently depending on the information passed in via the object pointer. (The generated serialization and deserialization code does not use the pointer.)

This functionality can be used to change how data sent by a dds::pub::DataWriter or received by a dds::sub::DataReader is serialized or deserialized on a per DataWriter and DataReader basis.

It can also be used to dynamically change how serialization (or for a less common case, deserialization) occurs. For example, a data type could represent a table, including the names of the rows and columns. However, since the row/column names of an instance of the table (a Topic) don't change, they only need to be sent once. The information passed in through the TypeSupport QoS policy could be used to signal the serialization routine to send the row/column names the first time a dds::pub::DataWriter calls dds::pub::DataWriter::write(), and then never again.

The rti::core::policy::TypeSupport::cdr_padding_kind allows you to choose whether or not the padding bytes are set to zero during CDR serialization.

Constructor & Destructor Documentation

rti::core::policy::TypeSupport::TypeSupport ( )
inline

Creates the default policy.

Member Function Documentation

TypeSupport& rti::core::policy::TypeSupport::plugin_data ( void *  the_plugin_data)

Value to pass into the type plugin's de-/serialization function.

[default] NULL

void* rti::core::policy::TypeSupport::plugin_data ( )

Getter (see setter with the same name)

TypeSupport& rti::core::policy::TypeSupport::cdr_padding_kind ( CdrPaddingKind  the_cdr_padding_kind)

Determines whether or not the padding bytes will be set to zero during CDR serialization.

In a DomainParticipant, this value configures how the padding bytes are set when serializing data for the Built-In Topic DataWriters and DataReaders. A value of CdrPaddingKind::AUTO_CDR_PADDING defaults to CdrPaddingKind::NOT_SET_CDR_PADDING.

For DataWriters and DataReaders, this value configures how padding bytes are set when serializing data for that entity. A value of CdrPaddingKind::AUTO_CDR_PADDING means that the entity will inherit whatever value is set on the DomainParticipant.

[default] CdrPaddingKind::AUTO_CDR_PADDING

CdrPaddingKind rti::core::policy::TypeSupport::cdr_padding_kind ( ) const

Getter (see setter with the same name)


RTI Connext Modern C++ API Version 5.3.0 Copyright © Sun Jun 25 2017 Real-Time Innovations, Inc