ezEngine  Milestone 9
StaticSubSystem.h File Reference

Go to the source code of this file.

Macros

#define EZ_BEGIN_SUBSYSTEM_DECLARATION(GroupName, SubsystemName)
 Put this in some cpp file of a subsystem to start its startup / shutdown sequence declaration. More...
 
#define EZ_END_SUBSYSTEM_DECLARATION
 Finishes a subsystem's startup / shutdown sequence declaration. More...
 
#define ON_BASESYSTEMS_STARTUP
 Defines what code is to be executed upon base startup. More...
 
#define ON_CORESYSTEMS_STARTUP
 Defines what code is to be executed upon core startup. More...
 
#define ON_CORESYSTEMS_SHUTDOWN
 Defines what code is to be executed upon core shutdown. More...
 
#define ON_HIGHLEVELSYSTEMS_STARTUP
 Defines what code is to be executed upon engine startup. More...
 
#define ON_HIGHLEVELSYSTEMS_SHUTDOWN
 Defines what code is to be executed upon engine shutdown. More...
 
#define BEGIN_SUBSYSTEM_DEPENDENCIES
 Begins the list of subsystems, on which the currently declared system depends on. More...
 
#define END_SUBSYSTEM_DEPENDENCIES
 Ends the list of subsystems, on which the currently declared system depends on. More...
 
#define EZ_MAKE_SUBSYSTEM_STARTUP_FRIEND(GroupName, SubsystemName)   friend class GroupName##SubsystemName##SubSystem;
 This inserts a friend declaration into a class, such that the given group/subsystem can access private functions which it might need.
 

Macro Definition Documentation

◆ BEGIN_SUBSYSTEM_DEPENDENCIES

#define BEGIN_SUBSYSTEM_DEPENDENCIES
Value:
public: \
virtual const char* GetDependency(ezInt32 iDep) \
{ \
const char* szDeps[] = {

Begins the list of subsystems, on which the currently declared system depends on.

Must be followed by a series of strings with the names of the dependencies.

◆ END_SUBSYSTEM_DEPENDENCIES

#define END_SUBSYSTEM_DEPENDENCIES
Value:
, nullptr \
} \
; \
return szDeps[iDep]; \
}

Ends the list of subsystems, on which the currently declared system depends on.

◆ EZ_BEGIN_SUBSYSTEM_DECLARATION

#define EZ_BEGIN_SUBSYSTEM_DECLARATION (   GroupName,
  SubsystemName 
)
Value:
class GroupName##SubsystemName##SubSystem; \
class GroupName##SubsystemName##SubSystem : public ezSubSystem \
{ \
public: \
virtual const char* GetGroupName() const { return #GroupName; } \
\
public: \
virtual const char* GetSubSystemName() const { return #SubsystemName; }
Base class for all subsystems.
Definition: SubSystem.h:28

Put this in some cpp file of a subsystem to start its startup / shutdown sequence declaration.

*** Example Subsystem declarations ***

EZ_BEGIN_SUBSYSTEM_DECLARATION(Foundation, ExampleSubSystem)

BEGIN_SUBSYSTEM_DEPENDENCIES "SomeOtherSubSystem", "SomeOtherSubSystem2" END_SUBSYSTEM_DEPENDENCIES

ON_CORESYSTEMS_STARTUP { ezExampleSubSystem::BasicStartup(); }

ON_CORESYSTEMS_SHUTDOWN { ezExampleSubSystem::BasicShutdown(); }

ON_HIGHLEVELSYSTEMS_STARTUP { ezExampleSubSystem::EngineStartup(); }

ON_HIGHLEVELSYSTEMS_SHUTDOWN { ezExampleSubSystem::EngineShutdown(); }

EZ_END_SUBSYSTEM_DECLARATION;The first parameter is the name of the group, in which the subsystem resides, the second is the name of the subsystem itself.

◆ EZ_END_SUBSYSTEM_DECLARATION

#define EZ_END_SUBSYSTEM_DECLARATION
Value:
} \
static EZ_CONCAT(s_SubSystem, EZ_SOURCE_LINE)
#define EZ_CONCAT(x, y)
Concatenates two strings, even when the strings are macros themselves.
Definition: PreprocessorUtils.h:7

Finishes a subsystem's startup / shutdown sequence declaration.

◆ ON_BASESYSTEMS_STARTUP

#define ON_BASESYSTEMS_STARTUP
Value:
private: \
virtual void OnBaseSystemsStartup() override

Defines what code is to be executed upon base startup.

Put this inside the subsystem declaration block.

◆ ON_CORESYSTEMS_SHUTDOWN

#define ON_CORESYSTEMS_SHUTDOWN
Value:
private: \
virtual void OnCoreSystemsShutdown() override

Defines what code is to be executed upon core shutdown.

Put this inside the subsystem declaration block.

◆ ON_CORESYSTEMS_STARTUP

#define ON_CORESYSTEMS_STARTUP
Value:
private: \
virtual void OnCoreSystemsStartup() override

Defines what code is to be executed upon core startup.

Put this inside the subsystem declaration block.

◆ ON_HIGHLEVELSYSTEMS_SHUTDOWN

#define ON_HIGHLEVELSYSTEMS_SHUTDOWN
Value:
private: \
virtual void OnHighLevelSystemsShutdown() override

Defines what code is to be executed upon engine shutdown.

Put this inside the subsystem declaration block.

◆ ON_HIGHLEVELSYSTEMS_STARTUP

#define ON_HIGHLEVELSYSTEMS_STARTUP
Value:
private: \
virtual void OnHighLevelSystemsStartup() override

Defines what code is to be executed upon engine startup.

Put this inside the subsystem declaration block.