eckit::Buffer class

Simple class to implement memory buffers.

Derived classes

class CountedBuffer

Constructors, destructors, conversion operators

Buffer(size_t size = 0) explicit
Buffer(const std::string& s) explicit
Buffer(const void*, size_t len)
Allocate and copy memory of given length in bytes.
Buffer(Buffer&& rhs) noexcept
Move constructor. Note that rhs is not guaranteed to be valid!
~Buffer()
operator char*()
operator const char*() const
operator void*()
operator const void*() const

Public functions

auto operator=(Buffer&& rhs) -> Buffer& noexcept
Move assignment. Note that rhs is not guaranteed to be valid!
auto data() -> void*
auto data() const -> const void*
auto size() const -> size_t
void zero()
Zero content of buffer.
void resize(size_t, bool preserveData = false)
void copy(const void*, size_t size, size_t pos = 0)

Function documentation

size_t eckit::Buffer::size() const

Returns allocated size

void eckit::Buffer::resize(size_t, bool preserveData = false)

void eckit::Buffer::copy(const void*, size_t size, size_t pos = 0)

Copy data of given size (bytes) into buffer at given position