10#include <boost/optional.hpp>
14namespace uhd {
namespace utils {
namespace chdr {
27 template <
typename payload_t>
31 boost::optional<uint64_t> timestamp = boost::none,
32 std::vector<uint64_t> metadata = {});
40 std::vector<uint8_t> payload_data,
41 boost::optional<uint64_t> timestamp = boost::none,
42 std::vector<uint64_t> mdata = {});
94 template <
typename OutputIterator>
95 void serialize(OutputIterator first,
107 template <
typename InputIterator>
136 template <
typename payload_t>
145 template <
typename payload_t>
153 template <
typename payload_t>
154 const std::string to_string_with_payload(
158 void serialize_ptr(
endianness_t endianness,
void* start,
void* end)
const;
163 inline void set_header_lengths()
166 _header.set_length(get_packet_len());
170 std::vector<uint8_t> _payload;
171 boost::optional<uint64_t> _timestamp;
172 std::vector<uint64_t> _mdata;
Definition: chdr_packet.hpp:21
uhd::rfnoc::chdr::chdr_header get_header() const
std::vector< uint8_t > serialize_to_byte_vector(endianness_t endianness=uhd::ENDIANNESS_LITTLE) const
size_t get_packet_len() const
const std::vector< uint64_t > & get_metadata() const
void set_metadata(std::vector< uint64_t > metadata)
void set_timestamp(boost::optional< uint64_t > timestamp)
const std::string to_string() const
Return a string representation of this object.
void set_header(uhd::rfnoc::chdr::chdr_header header)
void set_payload_bytes(std::vector< uint8_t > bytes)
const std::vector< uint8_t > & get_payload_bytes() const
chdr_packet(uhd::rfnoc::chdr_w_t chdr_w, uhd::rfnoc::chdr::chdr_header header, std::vector< uint8_t > payload_data, boost::optional< uint64_t > timestamp=boost::none, std::vector< uint64_t > mdata={})
boost::optional< uint64_t > get_timestamp() const
#define UHD_API
Definition: config.h:87
chdr_w_t
Type that indicates the CHDR Width in bits.
Definition: rfnoc_types.hpp:19
constexpr size_t chdr_w_to_bits(chdr_w_t chdr_w)
Conversion from chdr_w_t to a number of bits.
Definition: rfnoc_types.hpp:21
Definition: build_info.hpp:12
endianness_t
Definition: endianness.hpp:30
@ ENDIANNESS_LITTLE
Definition: endianness.hpp:30