Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
inexor::util::Subsystem Class Reference

Subsystems are loosely coupled parts of inexor. More...

#include <Subsystem.hpp>

Inheritance diagram for inexor::util::Subsystem:
inexor::rpc::RpcSubsystem< MSG_TYPE, ASYNC_SERVICE_TYPE > inexor::ui::CefSubsystem inexor::util::Metasystem

Classes

class  Register
 

Public Types

typedef std::function
< std::unique_ptr< Subsystem >)> 
Starter
 A function that starts a subsystem and returns a pointer to the instance this exists for the register: we can not store classes at run time, so we instead store these functions as proxies to the Constructors. More...
 

Public Member Functions

 Subsystem ()
 Called to startup of the subsystem; usually when inexor is started. More...
 
virtual ~Subsystem ()
 Called to stop the subsystem; usually called when inexor is quit. More...
 
virtual void initialize (int argc, char **argv)
 Called once. More...
 
virtual void tick ()
 Called once per frame, or what ever our event loop is. More...
 

Public Attributes

bool is_initialized = false
 

Detailed Description

Subsystems are loosely coupled parts of inexor.

Instead of using subsystems, one could just call one function on program start, program end and once per frame in main(), but Subsystems are more flexible.

A Metasystem is used to manage a set of subsystems; Subsystems can be registered with the macro SUBSYSTEM_REGISTERto enable starting it by name (as a string, during runtime).

Member Typedef Documentation

typedef std::function<std::unique_ptr<Subsystem>)> inexor::util::Subsystem::Starter

A function that starts a subsystem and returns a pointer to the instance this exists for the register: we can not store classes at run time, so we instead store these functions as proxies to the Constructors.

We create these as lambdas in the SUBSYSTEM_REGISTER macro;

Constructor & Destructor Documentation

inexor::util::Subsystem::Subsystem ( )
inline

Called to startup of the subsystem; usually when inexor is started.

virtual inexor::util::Subsystem::~Subsystem ( )
inlinevirtual

Called to stop the subsystem; usually called when inexor is quit.

Member Function Documentation

virtual void inexor::util::Subsystem::initialize ( int  argc,
char **  argv 
)
inlinevirtual
virtual void inexor::util::Subsystem::tick ( )
inlinevirtual

Called once per frame, or what ever our event loop is.

Reimplemented in inexor::util::Metasystem, inexor::rpc::RpcSubsystem< MSG_TYPE, ASYNC_SERVICE_TYPE >, and inexor::ui::CefSubsystem.

Member Data Documentation

bool inexor::util::Subsystem::is_initialized = false

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