Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
BufferAccessor.hpp
1/*
2Copyright (C) 2019,2021,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#ifndef AEONGAMES_BUFFERACCESSOR_H
18#define AEONGAMES_BUFFERACCESSOR_H
20namespace AeonGames
21{
22 class MemoryPoolBuffer;
25 {
26 public:
33 DLL BufferAccessor ( MemoryPoolBuffer* aMemoryPoolBuffer, size_t aOffset, size_t aSize );
42
47 DLL void WriteMemory ( size_t aOffset, size_t aSize, const void *aData = nullptr ) const;
52 DLL void* Map ( size_t aOffset = 0, size_t aSize = 0 ) const;
54 DLL void Unmap() const;
57 DLL size_t GetOffset() const;
60 DLL size_t GetSize() const;
63 DLL const MemoryPoolBuffer* GetMemoryPoolBuffer() const;
64 private:
65 MemoryPoolBuffer* mMemoryPoolBuffer{nullptr};
66 size_t mOffset{0};
67 size_t mSize{0};
68 };
69}
70#endif
Platform-specific macros, includes, and DLL export/import definitions.
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(const BufferAccessor &)
Copy constructor.
DLL BufferAccessor()
Default constructor.
DLL BufferAccessor(BufferAccessor &&)
Move 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
Definition AABB.hpp:31