26class MutableBuffer :
public BufferBase {
28 MutableBuffer() =
default;
34 void *
data()
const {
return data_; }
39 size_t size()
const {
return size_; }
42 void *data_ =
nullptr;
49class ConstBuffer :
public BufferBase {
51 ConstBuffer() =
default;
64 const void *
data()
const {
return data_; }
69 size_t size()
const {
return size_; }
72 const void *data_ =
nullptr;
98template <
typename PodType,
size_t N>
100 return MutableBuffer(
static_cast<void *
>(arr),
sizeof(PodType) * N);
106template <
typename PodType,
size_t N>
108 return ConstBuffer(
static_cast<const void *
>(arr),
sizeof(PodType) * N);
114template <
typename PodType,
size_t N>
116 return MutableBuffer(
static_cast<void *
>(arr.data()),
sizeof(PodType) * N);
122template <
typename PodType,
size_t N>
124 return ConstBuffer(
static_cast<const void *
>(arr.data()),
125 sizeof(PodType) * N);
131template <
typename PodType>
134 sizeof(PodType) * vec.size());
140template <
typename PodType>
142 return ConstBuffer(
static_cast<const void *
>(vec.data()),
143 sizeof(PodType) * vec.size());
150 return MutableBuffer(
static_cast<void *
>(str.data()), str.size());
157 return ConstBuffer(
static_cast<const void *
>(str.data()), str.size());
164 return ConstBuffer(
static_cast<const void *
>(strv.data()), strv.size());
Constant buffer.
Definition buffers.hpp:49
size_t size() const
Get the byte size of the buffer.
Definition buffers.hpp:69
const void * data() const
Get the data of the buffer.
Definition buffers.hpp:64
Mutable buffer.
Definition buffers.hpp:26
void * data() const
Get the data of the buffer.
Definition buffers.hpp:34
size_t size() const
Get the byte size of the buffer.
Definition buffers.hpp:39
The main namespace for the Condy library.
Definition condy.hpp:28
MutableBuffer buffer(void *data, size_t size)
Create a buffer object from various data sources.
Definition buffers.hpp:84