ezEngine  Milestone 9
Startup.h
1 #pragma once
2 
4 #include <Foundation/Configuration/SubSystem.h>
5 #include <Foundation/Containers/Deque.h>
6 
7 #define EZ_GLOBALEVENT_STARTUP_CORESYSTEMS_BEGIN "ezStartup_StartupCoreSystems_Begin"
8 #define EZ_GLOBALEVENT_STARTUP_CORESYSTEMS_END "ezStartup_StartupCoreSystems_End"
9 #define EZ_GLOBALEVENT_SHUTDOWN_CORESYSTEMS_BEGIN "ezStartup_ShutdownCoreSystems_Begin"
10 #define EZ_GLOBALEVENT_SHUTDOWN_CORESYSTEMS_END "ezStartup_ShutdownCoreSystems_End"
11 
12 #define EZ_GLOBALEVENT_STARTUP_HIGHLEVELSYSTEMS_BEGIN "ezStartup_StartupHighLevelSystems_Begin"
13 #define EZ_GLOBALEVENT_STARTUP_HIGHLEVELSYSTEMS_END "ezStartup_StartupHighLevelSystems_End"
14 #define EZ_GLOBALEVENT_SHUTDOWN_HIGHLEVELSYSTEMS_BEGIN "ezStartup_ShutdownHighLevelSystems_Begin"
15 #define EZ_GLOBALEVENT_SHUTDOWN_HIGHLEVELSYSTEMS_END "ezStartup_ShutdownHighLevelSystems_End"
16 
17 #define EZ_GLOBALEVENT_UNLOAD_PLUGIN_BEGIN "ezStartup_UnloadPlugin_Begin"
18 #define EZ_GLOBALEVENT_UNLOAD_PLUGIN_END "ezStartup_UnloadPlugin_End"
19 
74 class EZ_FOUNDATION_DLL ezStartup
75 {
76 public:
77  // 'Base Startup' happens even before 'Core Startup', but only really low level stuff should be done there
78  // and those subsystems should not have any dependencies on each other.
79  // 'Base Startup' is automatically done right before 'Core Startup'
80  // There is actually no 'Base Shutdown', everything that is initialized in 'Base Startup' should not require
81  // any explicit shutdown.
82 
93  static void AddApplicationTag(const char* szTag);
94 
96  static bool HasApplicationTag(const char* szTag);
97 
104 
110 
117 
125 
132 
134  static void PrintAllSubsystems();
135 
139  static void ReinitToCurrentState();
140 
141 private:
146  static void UnloadPluginSubSystems(const char* szPluginName);
147 
148  static void PluginEventHandler(const ezPlugin::PluginEvent& EventData);
149  static void AssignSubSystemPlugin(const char* szPluginName);
150 
151  static void ComputeOrder(ezDeque<ezSubSystem*>& Order);
152  static bool HasDependencyOnPlugin(ezSubSystem* pSubSystem, const char* szModule);
153 
154  static void Startup(ezStartupStage::Enum stage);
155  static void Shutdown(ezStartupStage::Enum stage);
156 
157  static bool s_bPrintAllSubSystems;
158  static ezStartupStage::Enum s_CurrentState;
159  static ezDynamicArray<const char*> s_ApplicationTags;
160 };
161 
In this stage the higher level functionality, which depends on a rendering context, is being started / shut down.
Definition: SubSystem.h:14
static void ShutdownHighLevelSystems()
Runs the &#39;high level&#39; shutdown sequence of all subsystems in the proper order (reversed startup order...
Definition: Startup.h:131
The startup system makes sure to initialize and shut down all known subsystems in the proper order...
Definition: Startup.h:74
static void StartupCoreSystems()
Runs the &#39;core&#39; startup sequence of all subsystems in the proper order.
Definition: Startup.h:109
The data that is broadcast whenever a plugin is (un-) loaded.
Definition: Plugin.h:87
static void StartupHighLevelSystems()
Runs the &#39;high level&#39; startup sequence of all subsystems in the proper order.
Definition: Startup.h:124
In this stage the core functionality is being started / shut down.
Definition: SubSystem.h:13
static void StartupBaseSystems()
Runs the &#39;base&#39; startup sequence of all subsystems in the proper order.
Definition: Startup.h:103
static void ShutdownCoreSystems()
Runs the &#39;core&#39; shutdown sequence of all subsystems in the proper order (reversed startup order)...
Definition: Startup.h:116
Definition: DynamicArray.h:70
Enum
Definition: SubSystem.h:9
Definition: Deque.h:262
Base class for all subsystems.
Definition: SubSystem.h:28
In this stage the absolute base functionality is started. This should only be used by the Foundation ...
Definition: SubSystem.h:12