47 static void call(
void*,
void* ptr)
noexcept;
73 std::unique_ptr<byte_slice_data, release_byte_slice>
storage_;
109 explicit byte_slice(std::vector<std::uint8_t>&& buffer);
160 std::unique_ptr<byte_slice_data, release_byte_slice>
take_buffer() noexcept;
Definition byte_slice.h:69
std::uint8_t value_type
Definition byte_slice.h:85
byte_slice(std::nullptr_t) noexcept
Construct empty slice.
Definition byte_slice.h:101
std::uint8_t reference
Definition byte_slice.h:90
byte_slice(byte_slice_data *storage, span< const std::uint8_t > portion) noexcept
Internal use only; use to increase storage reference count.
Definition byte_slice.cpp:132
std::unique_ptr< byte_slice_data, release_byte_slice > storage_
Definition byte_slice.h:73
std::size_t size_type
Definition byte_slice.h:86
const std::uint8_t * data() const noexcept
Definition byte_slice.h:133
std::ptrdiff_t difference_type
Definition byte_slice.h:87
byte_slice clone() const noexcept
Definition byte_slice.h:124
~byte_slice() noexcept=default
std::unique_ptr< byte_slice_data, release_byte_slice > take_buffer() noexcept
Definition byte_slice.cpp:260
pointer iterator
Definition byte_slice.h:92
iterator end() const noexcept
Definition byte_slice.h:129
std::size_t size() const noexcept
Definition byte_slice.h:134
byte_slice take_slice(std::size_t max_bytes) noexcept
Definition byte_slice.cpp:233
std::size_t remove_prefix(std::size_t max_bytes) noexcept
Definition byte_slice.cpp:225
const std::uint8_t * const_pointer
Definition byte_slice.h:89
const_iterator cbegin() const noexcept
Definition byte_slice.h:127
span< const std::uint8_t > portion_
Definition byte_slice.h:74
iterator begin() const noexcept
Definition byte_slice.h:126
byte_slice() noexcept
Construct empty slice.
Definition byte_slice.h:96
std::uint8_t const_reference
Definition byte_slice.h:91
byte_slice get_slice(std::size_t begin, std::size_t end) const
Definition byte_slice.cpp:250
const_pointer const_iterator
Definition byte_slice.h:93
const_iterator cend() const noexcept
Definition byte_slice.h:130
const std::uint8_t * pointer
Definition byte_slice.h:88
bool empty() const noexcept
Definition byte_slice.h:132
A partial drop-in replacement for std::ostream.
Definition byte_stream.h:58
Non-owning sequence of data. Does not deep copy.
Definition span.h:55
#define const
Definition ipfrdr.c:80
TODO: (mj-xmr) This will be reduced in an another PR.
Definition byte_slice.h:40
std::unique_ptr< std::uint8_t, release_byte_buffer > byte_buffer
Alias for a buffer that has space for a byte_slice ref count.
Definition byte_slice.h:164
byte_buffer byte_buffer_increase(byte_buffer buf, std::size_t current, std::size_t more)
Definition byte_slice.cpp:285
byte_buffer byte_buffer_resize(byte_buffer buf, std::size_t length) noexcept
Definition byte_slice.cpp:267
const CharType(& source)[N]
Definition pointer.h:1147
const char * buf
Definition slow_memmem.cpp:73
unsigned char uint8_t
Definition stdint.h:124
Definition byte_slice.h:79
Definition byte_slice.cpp:47
Frees ref count + buffer allocated internally by byte_buffer.
Definition byte_slice.h:56
void operator()(std::uint8_t *buf) const noexcept
Definition byte_slice.cpp:126
Definition byte_slice.h:45
void operator()(byte_slice_data *ptr) const noexcept
Definition byte_slice.h:48
static void call(void *, void *ptr) noexcept
For use with zmq_message_init_data, use second arg for buffer pointer.
Definition byte_slice.cpp:58