6 #ifndef ZEROBUF_CONSTALLOCATOR_H 7 #define ZEROBUF_CONSTALLOCATOR_H 9 #include <zerobuf/Allocator.h> 20 ZEROBUF_API ~ConstAllocator();
22 const uint8_t* getData()
const final {
return _data; }
23 size_t getSize()
const final {
return _size; }
24 bool isMutable()
const final {
return false; }
26 ConstAllocator(
const ConstAllocator&) =
delete;
27 ConstAllocator& operator=(
const ConstAllocator&) =
delete;
29 uint8_t* getData()
final 31 throw std::runtime_error(
"No mutable getData() for ConstAllocator");
33 void copyBuffer(
const void*,
size_t)
final 35 throw std::runtime_error(
"No copyBuffer for ConstAllocator");
37 uint8_t* updateAllocation(
size_t,
bool,
size_t)
final 39 throw std::runtime_error(
"No updateAllocation for ConstAllocator");
41 void compact(
float)
final 43 throw std::runtime_error(
"No compact for ConstAllocator");
Defines export visibility macros for library ZeroBuf.
Zero-copy, zero-serialize, zero-hassle protocol buffers.
Allocator base class and interface.
A zerobuf root allocator which gives read-only access to its data.