3#include <Utility/IMoveOnly.h>
4#include <Common/memory.h>
5#include <Utility/TSpan.h>
19 void setBlockSource(std::byte* source, std::size_t blockSizeInBytes);
41 template<
typename T,
typename... Args>
42 T*
make(Args&&... args);
49 TSpan<T>
makeArray(std::size_t arraySize);
56 std::byte* allocRaw(std::size_t numBytes, std::size_t alignmentInBytes);
58 std::byte* m_blockSource;
59 std::size_t m_blockSizeInBytes;
60 std::byte* m_ptrInBlock;
61 std::size_t m_remainingBytesInBlock;
Definition GraphicsMemoryBlock.h:13
void setBlockSource(std::byte *source, std::size_t blockSizeInBytes)
Definition GraphicsMemoryBlock.cpp:34
std::size_t numAllocatedBytes() const
Definition GraphicsMemoryBlock.ipp:15
T * make(Args &&... args)
Make an object of type T as if by calling its constructor with Args.
Definition GraphicsMemoryBlock.ipp:38
GraphicsMemoryBlock()
Definition GraphicsMemoryBlock.cpp:12
bool hasBlockSource() const
Definition GraphicsMemoryBlock.cpp:47
TSpan< T > makeArray(std::size_t arraySize)
Make an array of default constructed objects of type T.
Definition GraphicsMemoryBlock.ipp:53
friend void swap(GraphicsMemoryBlock &first, GraphicsMemoryBlock &second) noexcept
Definition GraphicsMemoryBlock.cpp:52
GraphicsMemoryBlock & operator=(GraphicsMemoryBlock &&rhs) noexcept
Definition GraphicsMemoryBlock.cpp:25
std::size_t numUsedBytes() const
Definition GraphicsMemoryBlock.ipp:20
virtual ~GraphicsMemoryBlock()
void clear()
Reset the usage of the block. All memory handed out are effectively deallocated/deleted after this ca...
Definition GraphicsMemoryBlock.ipp:31
std::size_t numRemainingBytes() const
Definition GraphicsMemoryBlock.ipp:26
Definition PlatformDisplay.h:13