CIRCT
20.0.0git
|
A logical chunk of data representing serialized data. More...
#include <Common.h>
Public Member Functions | |
MessageData ()=default | |
Adopts the data vector buffer. More... | |
MessageData (std::vector< uint8_t > &data) | |
MessageData (const uint8_t *data, size_t size) | |
~MessageData ()=default | |
const uint8_t * | getBytes () const |
size_t | getSize () const |
Get the size of the data in bytes. More... | |
template<typename T > | |
const T * | as () const |
Cast to a type. More... | |
std::string | toHex () const |
Convert the data to a hex string. More... | |
Static Public Member Functions | |
template<typename T > | |
static MessageData | from (T &t) |
Cast from a type to its raw bytes. More... | |
Private Attributes | |
std::vector< uint8_t > | data |
A logical chunk of data representing serialized data.
Currently, just a wrapper for a vector of bytes, which is not efficient in terms of memory copying. This will change in the future as will the API.
|
default |
Adopts the data vector buffer.
Referenced by from().
|
inline |
|
inline |
|
default |
|
inline |
|
inlinestatic |
Cast from a type to its raw bytes.
Definition at line 129 of file Common.h.
References MessageData().
|
inline |
Definition at line 111 of file Common.h.
References data.
Referenced by log(), and sv2cCosimserverEpTryGet().
|
inline |
Get the size of the data in bytes.
Definition at line 113 of file Common.h.
References data.
Referenced by log(), and sv2cCosimserverEpTryGet().
std::string MessageData::toHex | ( | ) | const |
|
private |