Implements InteropAllocation for the public allocator.
More...
#include <CYBInterop.hpp>
|
| | Allocator (API::Heap &AHeap) noexcept |
| | Construct an Allocator. More...
|
| |
| template<class AObject , typename... AArgs> |
| AObject * | RawObject (AArgs &&...AArguments) |
| | Allocates the Object specified by AAllocatable and returns a raw pointer which must be deleted using the Delete method of this object. More...
|
| |
| template<class AObject , class AConstructor , typename... AArgs> |
| Object< AObject > | ConstructObject (AArgs &&...AArguments) |
| | Allocates the Object specified by AObject using a specified Constructor. More...
|
| |
| template<class AObject , typename... AArgs> |
| Object< AObject > | NewObject (AArgs &&...AArguments) |
| | Allocates the Object specified by AObject using the default constructor. More...
|
| |
| template<class AObject > |
| Object< AObject > | NewObject (void) |
| | Allocates the Object specified by AObject using the empty constructor. More...
|
| |
| template<class AObject > |
| Object< AObject > | CopyObject (const AObject &ACopy) |
| | Copys an Object of type AObject. More...
|
| |
| template<class AObject > |
| void | DeleteObject (AObject *const AAllocated) noexcept |
| | Deletes an object allocated with the Allocator. More...
|
| |
|
| template<typename AType , typename... AArgs> |
| static AType * | InPlaceAllocation (void *const ALocation, AArgs &&...AArguments) |
| | Wrapper for placement new. More...
|
| |
|
Heap & | FHeap |
| | The Heap this allocator uses.
|
| |
| | Allocator (Heap &AHeap) noexcept |
| | Construct an Allocator. More...
|
| |
| template<class AObject , typename AConstructor , typename... AArgs> |
| AObject * | AllocateObject (const std::true_type AIgnored, AArgs &&...AArguments) |
| | Allocate an Allocatable object through interop. More...
|
| |
| template<class AObject , typename AIgnoredConstructor , typename... AArgs> |
| AObject * | AllocateObject (const std::false_type AIgnored, AArgs &&...AArguments) |
| | Allocate a concrete object. More...
|
| |
Implements InteropAllocation for the public allocator.
Definition at line 7 of file CYBInterop.hpp.
| CYB::Engine::Allocator::Allocator |
( |
API::Heap & |
AHeap | ) |
|
|
noexcept |
Construct an Allocator.
- Parameters
-
| AHeap | The Heap the allocator will use |
- Thread Safety
- This function requires no thread safety
Definition at line 30 of file CYBInterop.cpp.
31 API::Interop::Allocator(AHeap)
template<class AAllocatable >
Template allocator for Allocatables.
- Template Parameters
-
| AAllocatable | The Allocatable that inherits from an API Allocatable |
- Parameters
-
| AConstructor | The Constructor for AAllocatable |
- Returns
- A pointer to a context heap allocated AAllocatable
- Thread Safety
- Dependant on called constructors
- Attention
- Throws dependant on called constructor
- Exceptions
-
Definition at line 5 of file CYBInterop.cpp.
6 if (!AConstructor.Valid<AAllocatable>())
9 auto& TrueConstructor(static_cast<typename AAllocatable::Constructor&>(AConstructor));
11 API::UniquePointer<void> Location(
FHeap.
Alloc(
sizeof(AAllocatable)));
12 TrueConstructor.template Construct<AAllocatable>(Location.get());
13 auto Result(static_cast<AAllocatable*>(Location.release()));
Heap & FHeap
The Heap this allocator uses.
A contructor passed to the engine was malformed.
virtual void * Alloc(const int ASize)=0
Allocate memory from the heap for use.
|
|
finaloverrideprivatevirtual |
Allocates the object specified by AID into FHeap.
- Parameters
-
| AID | The ID of the Allocatable to allocate |
| AConstructor | A reference to the constructor required by the object |
- Returns
- An Allocatable pointer which is the base class of the class indicated by AID
- Thread Safety
- Dependant on called constructor
- Attention
- Throws dependant on called constructor
- Exceptions
-
Implements CYB::API::Interop::Allocator.
Definition at line 17 of file CYBInterop.cpp.
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:
An operation was attempted with an invalid enum code.
template<class AObject , typename... AArgs>
| AObject* CYB::Engine::Allocator::RawObject |
( |
AArgs &&... |
AArguments | ) |
|
Allocates the Object specified by AAllocatable and returns a raw pointer which must be deleted using the Delete method of this object.
- Template Parameters
-
| AObject | The type of object to allocate |
| AArgs | The arguments types of AObject's constructor |
- Parameters
-
| AArguments | The arguments of AObject's constructor |
- Returns
- A pointer to an AObject allocated on this allocator's Heap
- Thread Safety
- This function requires no thread safety
- Attention
- Throws dependant on called constructor
- Exceptions
-
The documentation for this class was generated from the following files: