RTI Connext Modern C++ API Version 7.2.0
dds::core::KeyedBytesTopicType Class Reference

Built-in type consisting of a variable-length array of opaque bytes and a string that is the key. More...

#include <dds/core/BuiltinTopicTypes.hpp>

Public Member Functions

 KeyedBytesTopicType ()
 Creates a sample with an empty array of bytes and an empty string. More...
 
 KeyedBytesTopicType (const std::string &the_key, const std::vector< uint8_t > &the_value)
 Creates a sample with the given key and bytes. More...
 
const dds::core::stringkey () const
 Gets the key. More...
 
dds::core::stringkey ()
 Gets the key. More...
 
void key (const dds::core::string &the_value)
 Sets the key. More...
 
 operator std::vector< uint8_t > () const
 Conversion to std::vector by obtaining the bytes. More...
 
std::vector< uint8_t > value () const
 Gets the bytes. More...
 
void value (const std::vector< uint8_t > &the_value)
 Sets the bytes. More...
 
uint8_t & operator[] (uint32_t index)
 Accesses the bytes by index. More...
 
uint8_t operator[] (uint32_t index) const
 Accesses the bytes by index. More...
 
int32_t length () const
 Get the number of bytes. More...
 

Detailed Description

Built-in type consisting of a variable-length array of opaque bytes and a string that is the key.

Constructor & Destructor Documentation

◆ KeyedBytesTopicType() [1/2]

dds::core::KeyedBytesTopicType::KeyedBytesTopicType ( )
inline

Creates a sample with an empty array of bytes and an empty string.

◆ KeyedBytesTopicType() [2/2]

dds::core::KeyedBytesTopicType::KeyedBytesTopicType ( const std::string &  the_key,
const std::vector< uint8_t > &  the_value 
)
inline

Creates a sample with the given key and bytes.

Member Function Documentation

◆ key() [1/3]

const dds::core::string & dds::core::KeyedBytesTopicType::key ( ) const
inline

Gets the key.

◆ key() [2/3]

dds::core::string & dds::core::KeyedBytesTopicType::key ( )
inline

Gets the key.

◆ key() [3/3]

void dds::core::KeyedBytesTopicType::key ( const dds::core::string the_value)
inline

Sets the key.

References dds::core::Value< D >::delegate().

◆ operator std::vector< uint8_t >()

dds::core::KeyedBytesTopicType::operator std::vector< uint8_t > ( ) const
inline

Conversion to std::vector by obtaining the bytes.

References dds::core::Value< D >::delegate().

◆ value() [1/2]

std::vector< uint8_t > dds::core::KeyedBytesTopicType::value ( ) const
inline

Gets the bytes.

References dds::core::Value< D >::delegate().

◆ value() [2/2]

void dds::core::KeyedBytesTopicType::value ( const std::vector< uint8_t > &  the_value)
inline

Sets the bytes.

References dds::core::Value< D >::delegate().

◆ operator[]() [1/2]

uint8_t & dds::core::KeyedBytesTopicType::operator[] ( uint32_t  index)
inline

Accesses the bytes by index.

References dds::core::Value< D >::delegate().

◆ operator[]() [2/2]

uint8_t dds::core::KeyedBytesTopicType::operator[] ( uint32_t  index) const
inline

Accesses the bytes by index.

References dds::core::Value< D >::delegate().

◆ length()

int32_t dds::core::KeyedBytesTopicType::length ( ) const
inline

Get the number of bytes.

References dds::core::Value< D >::delegate().