CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBInterop.hpp
Go to the documentation of this file.
1 #pragma once
3 
4 namespace CYB {
5  namespace Engine {
8  private:
19  template <class AAllocatable> AAllocatable* DoAllocation(API::Interop::Constructor<void>& AConstructor);
21  void* InteropAllocation(const API::Interop::Allocatable::ID AID, API::Interop::Constructor<void>& AConstructor) final override;
22  public:
24  Allocator(API::Heap& AHeap) noexcept;
25 
37  template <class AObject, typename... AArgs> AObject* RawObject(AArgs&&... AArguments);
38  };
39 
41  class Context : public API::Interop::Context {
42  private:
44  public:
53  Context(API::Heap& AHeap, API::Logger& ALogger, const bool AMakeCurrent) noexcept;
54 
60  void MakeCurrent(void) noexcept;
61  };
62 
64  class PushContext {
65  private:
67  public:
74  PushContext(Context& ANewContext) noexcept;
76  ~PushContext();
77  };
78  };
79 };
80 
81 #include "CYBInterop.inl"
ID
Defines the IDs of allocatable engine objects.
Definition: Allocatable.hpp:10
void * InteropAllocation(const API::Interop::Allocatable::ID AID, API::Interop::Constructor< void > &AConstructor) finaloverride
Allocates the object specified by AID into FHeap.
Definition: CYBInterop.cpp:17
Used as a base class by all constructors.
Definition: Constructor.hpp:56
AAllocatable * DoAllocation(API::Interop::Constructor< void > &AConstructor)
Template allocator for Allocatables.
Definition: CYBInterop.cpp:5
Class which is used as an API for the engine.
Definition: Context.hpp:7
Implements InteropAllocation for the public allocator.
Definition: CYBInterop.hpp:7
Context switching RAII helper.
Definition: CYBInterop.hpp:64
Context & FOldContext
The context to pop upon destruction.
Definition: CYBInterop.hpp:66
Allocator FAllocatorObject
The Allocator for this Context.
Definition: CYBInterop.hpp:43
Used for allocating objects within and without the engine.
Definition: Allocator.hpp:7
Implements the engine level functions for API::Interop::Contexts.
Definition: CYBInterop.hpp:41
An interface which can allocate memory.
Definition: Heap.hpp:5
AObject * RawObject(AArgs &&...AArguments)
Allocates the Object specified by AAllocatable and returns a raw pointer which must be deleted using ...
The interface for writing safe logs.
Definition: Logger.hpp:7
Context(API::Heap &AHeap, API::Logger &ALogger, const bool AMakeCurrent) noexcept
Setup the Context, optionally making it the current one.
Definition: CYBInterop.cpp:39
Allocator(API::Heap &AHeap) noexcept
Construct an Allocator.
Definition: CYBInterop.cpp:30
void MakeCurrent(void) noexcept
Set the current thread's Context singleton to this Context.
Definition: CYBInterop.cpp:47