RTI Connext Modern C++ API  Version 6.1.1
dds::core::policy::UserData Class Reference

Attaches a buffer of opaque data that is distributed by Built-in Topics during discovery. More...

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

Public Member Functions

 UserData ()
 Creates an instance with an empty sequence of bytes. More...
 
 UserData (const dds::core::ByteSeq &seq)
 Creates an instance with a sequence of bytes. More...
 
 UserData (const uint8_t *value_begin, const uint8_t *value_end)
 Creates an instance with a sequence of bytes. More...
 
template<typename OctetIter >
UserDatavalue (OctetIter the_begin, OctetIter the_end)
 Sets the byte sequence. More...
 
const dds::core::ByteSeq value () const
 Gets the user data. More...
 
dds::core::ByteSeqvalue (dds::core::ByteSeq &dest) const
 Gets the user data. More...
 
const uint8_t * begin () const
 Gets the beginning of the range of bytes in this UserData. More...
 
const uint8_t * end () const
 Gets the end of the range of bytes in this UserData. More...
 

Detailed Description

Attaches a buffer of opaque data that is distributed by Built-in Topics during discovery.

Entity:
dds::domain::DomainParticipant, dds::sub::DataReader, dds::pub::DataWriter
Properties:
RxO = NO;
Changeable = YES
See also
dds::sub::builtin_subscriber

Usage

The purpose of this QoS is to allow the application to attach additional information to the created dds::core::Entity objects, so that when a remote application discovers their existence, it can access that information and use it for its own purposes. This information is not used by RTI Connext.

One possible use of this QoS is to attach security credentials or some other information that can be used by the remote application to authenticate the source.

In combination with operations such as dds::domain::DomainParticipant::ignore(const dds::domain::DomainParticipant & participant, const dds::core::InstanceHandle & handle), dds::pub::ignore, dds::sub::ignore, and dds::topic::ignore(), this QoS policy can assist an application to define and enforce its own security policies.

The use of this QoS is not limited to security; it offers a simple, yet flexible extensibility mechanism.

Important: RTI Connext stores the data placed in this policy in pre-allocated pools. It is therefore necessary to configure RTI Connext with the maximum size of the data that will be stored in policies of this type. This size is configured with rti::core::policy::DomainParticipantResourceLimits::participant_user_data_max_length, rti::core::policy::DomainParticipantResourceLimits::writer_user_data_max_length, and rti::core::policy::DomainParticipantResourceLimits::reader_user_data_max_length.

Constructor & Destructor Documentation

◆ UserData() [1/3]

dds::core::policy::UserData::UserData ( )
inline

Creates an instance with an empty sequence of bytes.

◆ UserData() [2/3]

dds::core::policy::UserData::UserData ( const dds::core::ByteSeq seq)
inlineexplicit

Creates an instance with a sequence of bytes.

Parameters
seqA vector containing the bytes to create this UserData

◆ UserData() [3/3]

dds::core::policy::UserData::UserData ( const uint8_t *  value_begin,
const uint8_t *  value_end 
)
inline

Creates an instance with a sequence of bytes.

Parameters
value_beginBeginning of a range of bytes
value_endEnd of the reange

Member Function Documentation

◆ value() [1/3]

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

Sets the byte sequence.

Template Parameters
OctetIterAn input iterator of bytes (convertible to uint8_t).
Parameters
the_beginBeginning of the range
the_endEnd of the range

◆ value() [2/3]

const dds::core::ByteSeq dds::core::policy::UserData::value ( ) const
inline

Gets the user data.

Returns
the sequence of bytes representing the user data

◆ value() [3/3]

dds::core::ByteSeq& dds::core::policy::UserData::value ( dds::core::ByteSeq dest) const
inline

Gets the user data.

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

◆ begin()

const uint8_t* dds::core::policy::UserData::begin ( ) const
inline

Gets the beginning of the range of bytes in this UserData.

◆ end()

const uint8_t* dds::core::policy::UserData::end ( ) const
inline

Gets the end of the range of bytes in this UserData.