26 using CondyBuffer = void;
28 MutableBuffer() =
default;
34 void *
data() const noexcept {
return data_; }
39 size_t size() const noexcept {
return size_; }
42 void *data_ =
nullptr;
51 using CondyBuffer = void;
53 ConstBuffer() =
default;
66 const void *
data() const noexcept {
return data_; }
71 size_t size() const noexcept {
return size_; }
74 const void *data_ =
nullptr;
100template <
typename PodType,
size_t N>
102 return MutableBuffer(
static_cast<void *
>(arr),
sizeof(PodType) * N);
108template <
typename PodType,
size_t N>
110 return ConstBuffer(
static_cast<const void *
>(arr),
sizeof(PodType) * N);
116template <
typename PodType,
size_t N>
118 return MutableBuffer(
static_cast<void *
>(arr.data()),
sizeof(PodType) * N);
124template <
typename PodType,
size_t N>
126 return ConstBuffer(
static_cast<const void *
>(arr.data()),
127 sizeof(PodType) * N);
133template <
typename PodType>
136 sizeof(PodType) * vec.size());
142template <
typename PodType>
144 return ConstBuffer(
static_cast<const void *
>(vec.data()),
145 sizeof(PodType) * vec.size());
152 return MutableBuffer(
static_cast<void *
>(str.data()), str.size());
159 return ConstBuffer(
static_cast<const void *
>(str.data()), str.size());
166 return ConstBuffer(
static_cast<const void *
>(strv.data()), strv.size());
179template <
typename PodType,
size_t N>
181 return ConstBuffer(
static_cast<const void *
>(sp.data()),
182 sp.size() *
sizeof(PodType));
188template <
typename PodType,
size_t N>
191 sp.size() *
sizeof(PodType));
size_t size() const noexcept
Get the byte size of the buffer.
const void * data() const noexcept
Get the data of the buffer.
size_t size() const noexcept
Get the byte size of the buffer.
void * data() const noexcept
Get the data of the buffer.
The main namespace for the Condy library.
MutableBuffer buffer(void *data, size_t size) noexcept
Create a buffer object from various data sources.