6 if (!AConstructor.
Valid<AAllocatable>())
9 auto& TrueConstructor(static_cast<typename AAllocatable::Constructor&>(AConstructor));
12 TrueConstructor.template Construct<AAllocatable>(Location.get());
13 auto Result(static_cast<AAllocatable*>(Location.release()));
18 using namespace API::Interop;
20 case Allocatable::ID::File:
return DoAllocation<Platform::System::File>(AConstructor);
21 case Allocatable::ID::Mutex:
return DoAllocation<Platform::System::Mutex>(AConstructor);
22 case Allocatable::ID::Path:
return DoAllocation<Platform::System::Path>(AConstructor);
23 case Allocatable::ID::Semaphore:
return DoAllocation<Platform::System::Semaphore>(AConstructor);
24 case Allocatable::ID::NULL_ID:
41 FAllocatorObject(AHeap)
54 ANewContext.MakeCurrent();
58 FOldContext.MakeCurrent();
Context & CurrentContext(void) noexcept
Get the current Context.
bool Valid(void) const noexcept
A best effort validation for the integrity of a Constructor for a given Allocatable.
API::Interop::Context & Context(void) noexcept
Get the API's Context.
ID
Defines the IDs of allocatable engine objects.
Heap & FHeap
The Heap this allocator uses.
void * InteropAllocation(const API::Interop::Allocatable::ID AID, API::Interop::Constructor< void > &AConstructor) finaloverride
Allocates the object specified by AID into FHeap.
Used as a base class by all constructors.
AAllocatable * DoAllocation(API::Interop::Constructor< void > &AConstructor)
Template allocator for Allocatables.
Class which is used as an API for the engine.
void SetCurrentContext(Context &ANewContext) noexcept
Set the current Context.
Used for allocating objects within and without the engine.
A contructor passed to the engine was malformed.
virtual void * Alloc(const int ASize)=0
Allocate memory from the heap for use.
Implements the engine level functions for API::Interop::Contexts.
Precompiled header for inter-engine operations.
~PushContext()
Calls MakeCurrent on FOldContext.
Engine::Core & Core(void) noexcept
Retrieve the Core singleton.
An interface which can allocate memory.
UniquePointer that uses our Allocator.
static Core & GetCore(void) noexcept
Retrieve the Core singleton.
The interface for writing safe logs.
Exceptions indicating an API contract violation. Should not be anticipated.
Context(API::Heap &AHeap, API::Logger &ALogger, const bool AMakeCurrent) noexcept
Setup the Context, optionally making it the current one.
Allocator(API::Heap &AHeap) noexcept
Construct an Allocator.
void MakeCurrent(void) noexcept
Set the current thread's Context singleton to this Context.
static Context & GetContext(void) noexcept
Get the API's Context.
PushContext(Context &ANewContext) noexcept
Saves the current Context and calls MakeCurrent on ANewContext.
An operation was attempted with an invalid enum code.