17#include "aeongames/BufferAccessor.hpp"
18#include "aeongames/Buffer.hpp"
19#include "aeongames/MemoryPoolBuffer.hpp"
24 mMemoryPoolBuffer{aMemoryPoolBuffer}, mOffset{aOffset}, mSize{aSize}
35 if ( mMemoryPoolBuffer !=
nullptr )
37 mMemoryPoolBuffer->GetBuffer().WriteMemory ( mOffset + aOffset, aSize, aData );
42 aSize = ( aSize != 0 ) ? aSize : mSize;
43 return ( mMemoryPoolBuffer !=
nullptr ) ? mMemoryPoolBuffer->GetBuffer().Map ( mOffset + aOffset, aSize ) :
nullptr;
47 if ( mMemoryPoolBuffer !=
nullptr )
49 mMemoryPoolBuffer->GetBuffer().Unmap();
62 return mMemoryPoolBuffer;
Provides access to a region within a memory pool buffer.
DLL const MemoryPoolBuffer * GetMemoryPoolBuffer() const
Get the underlying memory pool buffer.
DLL void WriteMemory(size_t aOffset, size_t aSize, const void *aData=nullptr) const
Write data into the buffer region.
DLL BufferAccessor & operator=(const BufferAccessor &)
Copy assignment operator.
DLL size_t GetOffset() const
Get the byte offset of this accessor within the memory pool buffer.
DLL void Unmap() const
Unmap a previously mapped buffer region.
DLL BufferAccessor()
Default constructor.
DLL size_t GetSize() const
Get the size of the accessible region.
DLL void * Map(size_t aOffset=0, size_t aSize=0) const
Map the buffer region into host-accessible memory.
Abstract interface for a pool-based buffer allocator.
<- This is here just for the literals