Built-in type consisting of a variable-length array of opaque bytes.
More...
#include <dds/core/BuiltinTopicTypes.hpp>
Public Member Functions |
| | BytesTopicType () |
| | Creates a sample with an empty array of bytes.
|
| |
| | BytesTopicType (const std::vector< uint8_t > &the_data) |
| | Creates a sample with a vector of bytes.
|
| |
| | operator std::vector< uint8_t > () const |
| | Automatic conversion to std::vector.
|
| |
| std::vector< uint8_t > | data () const |
| | Gets the bytes in a std::vector.
|
| |
| void | data (const std::vector< uint8_t > &value) |
| | Sets the bytes.
|
| |
| uint8_t & | operator[] (uint32_t index) |
| | Access the bytes by index.
|
| |
| uint8_t | operator[] (uint32_t index) const |
| | Access the bytes by index.
|
| |
| int32_t | length () const |
| | Get the number of bytes.
|
| |
Detailed Description
Built-in type consisting of a variable-length array of opaque bytes.
- See Also
- Built-in Types
Constructor & Destructor Documentation
| dds::core::BytesTopicType::BytesTopicType |
( |
| ) |
|
|
inline |
Creates a sample with an empty array of bytes.
| dds::core::BytesTopicType::BytesTopicType |
( |
const std::vector< uint8_t > & |
the_data | ) |
|
|
inline |
Creates a sample with a vector of bytes.
- Parameters
-
Note that this constructor is implicit so you can use a std::vector<uint8_t> wherever a BytesTopicType instance is expected
Member Function Documentation
| dds::core::BytesTopicType::operator std::vector< uint8_t > |
( |
| ) |
const |
|
inline |
Automatic conversion to std::vector.
- Returns
- A copy of the bytes
| std::vector<uint8_t> dds::core::BytesTopicType::data |
( |
| ) |
const |
|
inline |
Gets the bytes in a std::vector.
- Returns
- A copy of the bytes
| void dds::core::BytesTopicType::data |
( |
const std::vector< uint8_t > & |
value | ) |
|
|
inline |
Sets the bytes.
- Parameters
-
| uint8_t& dds::core::BytesTopicType::operator[] |
( |
uint32_t |
index | ) |
|
|
inline |
Access the bytes by index.
| uint8_t dds::core::BytesTopicType::operator[] |
( |
uint32_t |
index | ) |
const |
|
inline |
Access the bytes by index.
| int32_t dds::core::BytesTopicType::length |
( |
| ) |
const |
|
inline |