|
pjson 1.0.0
A small, owning JSON value for C++11
|
Runtime allocator for persistent DOM storage. The allocator is non-owning and must outlive every pjson value that refers to it. Allocation covers pjson child/root nodes plus 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. More...
#include <pjson.h>
Public Types | |
| enum | AllocationKind { NodeAllocation , StringAllocation , ArrayAllocation , ObjectAllocation } |
| Selects one of the public JSON policies. More... | |
Public Member Functions | |
| virtual | ~Allocator () |
Public API member ~Allocator; see the API overview for its contract. / Returns non-null aligned storage or throws; returning null is unsupported. | |
| virtual void * | allocate (size_t aSize, size_t aAlignment, AllocationKind aKind)=0 |
Public API member allocate; see the API overview for its contract. / Releases a non-null allocation using its original size, alignment, and kind. | |
| virtual void | deallocate (void *aPtr, size_t aSize, size_t aAlignment, AllocationKind aKind) noexcept=0 |
Public API member member; see the API overview for its contract. | |
Runtime allocator for persistent DOM storage. The allocator is non-owning and must outlive every pjson value that refers to it. Allocation covers pjson child/root nodes plus 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.
Runtime allocation interface for persistent pjson DOM storage.
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 and string/array/object wrapper objects, not their internal standard-library allocations or transient algorithm scratch space.
|
virtual |
Public API member ~Allocator; see the API overview for its contract. / Returns non-null aligned storage or throws; returning null is unsupported.
|
pure virtual |
Public API member allocate; see the API overview for its contract. / Releases a non-null allocation using its original size, alignment, and kind.
|
pure virtualnoexcept |
Public API member member; see the API overview for its contract.