CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBCore.hpp
Go to the documentation of this file.
1 #pragma once
3 
5 #include "CYBInterop.hpp"
6 #include "CYBLogger.hpp"
7 
8 namespace CYB {
9  namespace Engine {
11  class Core : public API::Singleton<Core> {
12  ENABLE_TEST_HOOKS
13  private:
14  static thread_local Context* FCurrentContext;
15  static thread_local unsigned long long FThreadID;
16 
17  public:
19 
21  private:
23 
24  std::atomic_uint_fast64_t FThreadCounter;
25 
27 
30  public:
32 
33  //ThreadPool
34  //Steam
35  //Command Line
36  //API
37  //
38  //Unit
39  //Load basics
40  //Lock mutex
41  //Heap
42  private:
52  Core(const unsigned int ANumArguments, const oschar_t* const* const AArguments);
54  ~Core();
55 
62  bool LaunchUnit(void) noexcept;
63  public:
70  static Core& GetCore(void) noexcept;
71 
79  static void Run(const unsigned int ANumArguments, const oschar_t* const* const AArguments) noexcept;
80 
81 
88  Context& CurrentContext(void) noexcept;
95  void SetCurrentContext(Context& ANewContext) noexcept;
101  void DefaultContext(void) noexcept;
102 
109  unsigned long long ThreadID(void) noexcept;
110  };
111  };
112 
114  Engine::Core& Core(void) noexcept;
115 };
Core(const unsigned int ANumArguments, const oschar_t *const *const AArguments)
Constructs the engine components.
Definition: CYBCore.cpp:27
Infomation about the running engine version.
bool LaunchUnit(void) noexcept
Run the main unit.
Context & CurrentContext(void) noexcept
Get the current Context.
Definition: CYBCore.cpp:57
An instance of this object is the entirety of the engine.
Definition: CYBCore.hpp:11
A memory pool manager and allocator.
Definition: CYBHeap.hpp:7
Engine compilation configuration variables.
Logger FLogger
The engine's primary Logger.
Definition: CYBCore.hpp:26
CYB::Engine::Helpers::CommandLine FCommandLine
The parsed command line handler.
Definition: CYBCore.hpp:31
Platform::Modules::Manager FModuleManager
Loads and contains required modules.
Definition: CYBCore.hpp:20
Defines CYB::Engine::Logger.
void DefaultContext(void) noexcept
Set the current Context to FEngineContext.
Definition: CYBCore.cpp:65
void SetCurrentContext(Context &ANewContext) noexcept
Set the current Context.
Definition: CYBCore.cpp:61
Memory::Heap FHeap
The engine's primary Heap.
Definition: CYBCore.hpp:28
static thread_local unsigned long long FThreadID
ID of the checking thread.
Definition: CYBCore.hpp:15
~Core()
Cleans up the engine and terminates the process.
Definition: CYBCore.cpp:41
Implements the engine level functions for API::Interop::Contexts.
Definition: CYBInterop.hpp:41
Platform::System::Console FConsole
The console.
Definition: CYBCore.hpp:22
The threaded, queued engine logger.
Definition: CYBLogger.hpp:7
Context FEngineContext
The engine Context.
Definition: CYBCore.hpp:29
Encapsulates the engine's loaded modules.
A class for creating static singletons.
Definition: Singleton.hpp:10
Contains the basic File interface. Does not perform locking of any kind, be aware of possible race co...
Definition: CYBConsole.hpp:6
unsigned long long ThreadID(void) noexcept
Possibly assign and return the current thread's serial ID for this execution.
Definition: CYBCore.cpp:73
Defines the implementations of virtual functions defined in CYB::API::Interop.
static void Run(const unsigned int ANumArguments, const oschar_t *const *const AArguments) noexcept
Runs the engine and self terminates.
Definition: CYBCore.cpp:49
std::atomic_uint_fast64_t FThreadCounter
The number of threads created.
Definition: CYBCore.hpp:24
static Core & GetCore(void) noexcept
Retrieve the Core singleton.
Definition: CYBCore.cpp:45
API::EngineInformation FEngineInformation
Information describing the engine.
Definition: CYBCore.hpp:18
static thread_local Context * FCurrentContext
The current Context in use.
Definition: CYBCore.hpp:14
Command line string parser and manager.