ZeroBuf  0.1.0
ZeroBuf is a replacement for FlatBuffers
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
zerobuf::NonMovingBaseAllocator Class Referenceabstract

Allocator base class which does not move existing fields. More...

#include <NonMovingBaseAllocator.h>

+ Inheritance diagram for zerobuf::NonMovingBaseAllocator:
+ Collaboration diagram for zerobuf::NonMovingBaseAllocator:

Public Member Functions

ZEROBUF_API NonMovingBaseAllocator (size_t staticSize, size_t numDynamic)
 
ZEROBUF_API NonMovingBaseAllocator (const NonMovingBaseAllocator &from)
 
ZEROBUF_API
NonMovingBaseAllocator
operator= (const NonMovingBaseAllocator &rhs)
 
ZEROBUF_API uint8_t * updateAllocation (size_t index, size_t size) override
 Update allocation of the dynamic elem. More...
 
- Public Member Functions inherited from zerobuf::Allocator
virtual uint8_t * getData ()=0
 
virtual const uint8_t * getData () const =0
 
virtual size_t getSize () const =0
 
virtual void copyBuffer (const void *data, size_t size)=0
 
template<class T >
T * getItemPtr (const size_t offset)
 
template<class T >
const T * getItemPtr (const size_t offset) const
 
template<class T >
T & getItem (const size_t offset)
 
template<class T >
getItem (const size_t offset) const
 
template<class T >
T * getDynamic (const size_t index)
 
template<class T >
const T * getDynamic (const size_t index) const
 
size_t getDynamicSize (const size_t index) const
 

Protected Member Functions

virtual void _resize (size_t newSize)=0
 
- Protected Member Functions inherited from zerobuf::Allocator
uint64_t & _getOffset (const size_t i)
 
uint64_t _getOffset (const size_t i) const
 
uint64_t & _getSize (const size_t i)
 
uint64_t _getSize (const size_t i) const
 

Detailed Description

Allocator base class which does not move existing fields.

Definition at line 16 of file NonMovingBaseAllocator.h.

Member Function Documentation

ZEROBUF_API uint8_t* zerobuf::NonMovingBaseAllocator::updateAllocation ( size_t  index,
size_t  newSize 
)
overridevirtual

Update allocation of the dynamic elem.

  • index to have newSize bytes. Updates the offset and size fields in the static section as needed. Does not copy the old data to the new location.
    Returns
    the pointer to the elem at the new place.

Implements zerobuf::Allocator.


The documentation for this class was generated from the following file: