Brenta Engine 1.2
Loading...
Searching...
No Matches
brenta::engine Class Reference

Engine class. More...

#include <engine.hpp>

Inheritance diagram for brenta::engine:
brenta::subsystem

Data Structures

class  builder
 Engine builder. More...
 
class  manager
 Automatically initialize and terminate engine with RAII. More...
 

Public Member Functions

std::expected< void, subsystem::error > initialize () override
 
std::expected< void, subsystem::error > terminate () override
 
std::string name () override
 Returns the name of the sybsystem.
 
bool is_initialized () override
 Returns true if the subsystem is initialized.
 
- Public Member Functions inherited from brenta::subsystem

Static Public Member Functions

static engineinstance ()
 Get a static object instance.
 
static engine::manager managed ()
 
static std::expected< void, std::string > with (subsystem::builder &&builder)
 Initialize a subsystem and add it to the managed subsystems (will be terminated with the others).
 

Static Public Attributes

static const std::string subsystem_name = "engine"
 

Additional Inherited Members

- Public Types inherited from brenta::subsystem
using error = std::string
 

Detailed Description

Engine class.

This class is used to initialize and terminate multiple subsystems. You can use the builder class to initialize the engine, as with any other subsystem.

Note: The subsystems will be initialized in the order as they are added and terminated in reverse, so make sure that they are ordered correctly if a subsystem depends on another one.

Definition at line 45 of file engine.hpp.

Member Function Documentation

◆ initialize()

std::expected< void, subsystem::error > engine::initialize ( )
overridevirtual

Implements brenta::subsystem.

Definition at line 24 of file engine.cpp.

◆ instance()

engine & engine::instance ( )
static

Get a static object instance.

Definition at line 75 of file engine.cpp.

◆ is_initialized()

bool engine::is_initialized ( )
overridevirtual

Returns true if the subsystem is initialized.

Implements brenta::subsystem.

Definition at line 66 of file engine.cpp.

◆ managed()

engine::manager engine::managed ( )
static

Definition at line 81 of file engine.cpp.

◆ name()

std::string engine::name ( )
overridevirtual

Returns the name of the sybsystem.

Implements brenta::subsystem.

Definition at line 61 of file engine.cpp.

◆ terminate()

std::expected< void, subsystem::error > engine::terminate ( )
overridevirtual

Implements brenta::subsystem.

Definition at line 41 of file engine.cpp.

◆ with()

std::expected< void, std::string > engine::with ( subsystem::builder && builder)
static

Initialize a subsystem and add it to the managed subsystems (will be terminated with the others).

Definition at line 87 of file engine.cpp.

Field Documentation

◆ subsystem_name

const std::string engine::subsystem_name = "engine"
static

Definition at line 52 of file engine.hpp.


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