ezEngine  Milestone 7
ezSubSystem Class Referenceabstract

Base class for all subsystems. More...

#include <SubSystem.h>

Inheritance diagram for ezSubSystem:

Public Member Functions

virtual const char * GetSubSystemName () const =0
 Returns the name of the subsystem. Must be overridden.
 
virtual const char * GetGroupName () const =0
 Returns the name of the group to which this subsystem belongs. Must be overridden.
 
virtual const char * GetDependency (ezInt32 iDep)
 Returns a series of strings with the names of the subsystem, which this subsystem depends on. nullptr indicates the last entry. Must be overridden.
 
const char * GetPluginName () const
 Returns the plugin name to which this subsystem belongs.
 
bool IsStartupPhaseDone (ezStartupStage::Enum Stage) const
 Returns whether the given startup stage has been done on this subsystem.
 

Private Member Functions

 EZ_DECLARE_ENUMERABLE_CLASS (ezSubSystem)
 
 EZ_DISALLOW_COPY_AND_ASSIGN (ezSubSystem)
 
virtual void OnBaseStartup ()
 This will be called to initialize the subsystems base components. Can be overridden to handle this event.
 
virtual void OnCoreStartup ()
 This will be called to initialize the subsystems core components. Can be overridden to handle this event.
 
virtual void OnCoreShutdown ()
 This will be called to shut down the subsystems core components. Can be overridden to handle this event.
 
virtual void OnEngineStartup ()
 This will be called to initialize the subsystems engine / rendering components. Can be overridden to handle this event.
 
virtual void OnEngineShutdown ()
 This will be called to shut down the subsystems engine / rendering components. Can be overridden to handle this event.
 

Private Attributes

const char * m_szPluginName
 Set by ezStartup to store to which plugin this subsystem belongs.
 
bool m_bStartupDone [ezStartupStage::ENUM_COUNT]
 Stores which startup phase has been done already.
 

Friends

class ezStartup
 

Additional Inherited Members

- Static Public Member Functions inherited from ezNoBase
static const ezRTTIGetStaticRTTI ()
 
- Protected Attributes inherited from ezEnumerable< ezSubSystem >
ezEnumerablem_pNextInstance
 

Detailed Description

Base class for all subsystems.

ezStartup will initialize and shut down all instances of this class, according to their dependencies etc. If you have a subsystem that is a non-static class, just derive from this base class and override the virtual functions as required. If you have a subsystem that is implemented in a purely static way (there is no class instance), just use the macros EZ_BEGIN_SUBSYSTEM_DECLARATION, EZ_END_SUBSYSTEM_DECLARATION etc. Those macros will create a wrapper object (derived from ezSubSystem) to handle initialization.


The documentation for this class was generated from the following file: