|
pjson 2.0.0
A small, owning JSON value for C++11
|
Runtime allocator for persistent DOM storage. More...
#include <pjson.h>
Public Types | |
| enum | AllocationKind { NodeAllocation = 0 , StringAllocation = 1 , ArrayAllocation = 2 , ObjectAllocation = 3 , ImplementationAllocation = 4 } |
| Identifies the purpose and matching deallocation contract of storage. More... | |
Public Member Functions | |
| virtual | ~Allocator () |
| Enables destruction through an Allocator base pointer. | |
| virtual void * | allocate (size_t aSize, size_t aAlignment, AllocationKind aKind)=0 |
| Returns non-null aligned storage or throws; returning null is unsupported. | |
| virtual void | deallocate (void *aPtr, size_t aSize, size_t aAlignment, AllocationKind aKind) noexcept=0 |
| Releases a non-null allocation using its original size, alignment, and kind. | |
Runtime allocator for persistent DOM storage.
Runtime allocation interface for persistent pjson DOM storage.
The allocator is non-owning and must outlive every pjson value that refers to it. Allocation covers pjson child/root nodes, non-null private implementations, and the std::string, array, and object wrapper objects. Storage used internally by those standard-library objects and transient parser/algorithm scratch space continues to use the standard allocator.
The allocator is borrowed and must outlive every bound value. allocate() must return non-null storage honoring the requested size and alignment or throw; deallocate() receives matching metadata and must not throw. The interface covers pjson nodes, non-null opaque implementation objects, and string/array/object wrapper objects, not their internal standard-library allocations or transient algorithm scratch space.
Identifies the purpose and matching deallocation contract of storage.
|
virtual |
Enables destruction through an Allocator base pointer.
|
pure virtual |
Returns non-null aligned storage or throws; returning null is unsupported.
|
pure virtualnoexcept |
Releases a non-null allocation using its original size, alignment, and kind.