Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Engine::WrappedSystem< TSystem, TErrorCallback > Class Template Reference

Wrapper around a system that allows to add an error callback to it. More...

#include <WrappedSystem.hpp>

Inheritance diagram for Engine::WrappedSystem< TSystem, TErrorCallback >:
FunctionUtils::BaseFunction< void, Core & >

Public Member Functions

 WrappedSystem (TSystem system, TErrorCallback errorCallback)
 Constructor for WrappedSystem.
 ~WrappedSystem () override=default
 Destructor for WrappedSystem.
void operator() (Engine::Core &core) const override
 Calls the system.
FunctionUtils::FunctionID GetID () const override
 Returns the unique ID of the system.
std::string GetName () const override
 Get the name of the system.
Public Member Functions inherited from FunctionUtils::BaseFunction< void, Core & >
virtual ~BaseFunction ()=default
virtual void operator() (TArgs... args) const=0
 Pure virtual function call operator to be implemented by derived functions.
void Call (TArgs... args) const
 External Call function.

Static Public Member Functions

static FunctionUtils::FunctionID GetCallableID (const TSystem &callable)
 Get the ID of the system.
static std::string GetCallableName (const TSystem &callable)
 Get the name of the system.

Private Attributes

TSystem _system
 The wrapped system.
TErrorCallback _errorCallback
 The error callback to be called if the system throws an exception.
FunctionUtils::FunctionID _id = 0
 Unique ID for the system.
std::string _name
 Name of the system.

Detailed Description

template<typename TSystem, typename TErrorCallback>
class Engine::WrappedSystem< TSystem, TErrorCallback >

Wrapper around a system that allows to add an error callback to it.

Template Parameters
TSystemThe type of the system to wrap.
TErrorCallbackThe type of the error callback to wrap.

Constructor & Destructor Documentation

◆ WrappedSystem()

template<typename TSystem, typename TErrorCallback>
Engine::WrappedSystem< TSystem, TErrorCallback >::WrappedSystem ( TSystem system,
TErrorCallback errorCallback )
inlineexplicit

Constructor for WrappedSystem.

Parameters
systemThe system to be wrapped.
errorCallbackThe error callback to be called if the system throws an exception.
Todo
Put the implementation in the cpp file

◆ ~WrappedSystem()

template<typename TSystem, typename TErrorCallback>
Engine::WrappedSystem< TSystem, TErrorCallback >::~WrappedSystem ( )
overridedefault

Destructor for WrappedSystem.

Member Function Documentation

◆ GetCallableID()

template<typename TSystem, typename TErrorCallback>
FunctionUtils::FunctionID Engine::WrappedSystem< TSystem, TErrorCallback >::GetCallableID ( const TSystem & callable)
inlinestatic

Get the ID of the system.

Parameters
callableThe system.
Template Parameters
TSystemThe type of the system.
Returns
The ID of the system.
Todo
Put the implementation in the cpp file

◆ GetCallableName()

template<typename TSystem, typename TErrorCallback>
std::string Engine::WrappedSystem< TSystem, TErrorCallback >::GetCallableName ( const TSystem & callable)
inlinestatic

Get the name of the system.

Parameters
callableThe system.
Template Parameters
TSystemThe type of the system.
Returns
The name of the system.
Todo
Put the implementation in the cpp file

◆ GetID()

template<typename TSystem, typename TErrorCallback>
FunctionUtils::FunctionID Engine::WrappedSystem< TSystem, TErrorCallback >::GetID ( ) const
inlineoverridevirtual

Returns the unique ID of the system.

Returns
Unique ID of the system.
Todo
Put the implementation in the cpp file

Implements FunctionUtils::BaseFunction< void, Core & >.

◆ GetName()

template<typename TSystem, typename TErrorCallback>
std::string Engine::WrappedSystem< TSystem, TErrorCallback >::GetName ( ) const
inlineoverridevirtual

Get the name of the system.

Returns
Name of the system.
Todo
Put the implementation in the cpp file

Implements FunctionUtils::BaseFunction< void, Core & >.

◆ operator()()

template<typename TSystem, typename TErrorCallback>
void Engine::WrappedSystem< TSystem, TErrorCallback >::operator() ( Engine::Core & core) const
inlineoverride

Calls the system.

Parameters
coreThe core to pass to the system.
Todo
Put the implementation in the cpp file

Member Data Documentation

◆ _errorCallback

template<typename TSystem, typename TErrorCallback>
TErrorCallback Engine::WrappedSystem< TSystem, TErrorCallback >::_errorCallback
private

The error callback to be called if the system throws an exception.

◆ _id

template<typename TSystem, typename TErrorCallback>
FunctionUtils::FunctionID Engine::WrappedSystem< TSystem, TErrorCallback >::_id = 0
private

Unique ID for the system.

◆ _name

template<typename TSystem, typename TErrorCallback>
std::string Engine::WrappedSystem< TSystem, TErrorCallback >::_name
private

Name of the system.

◆ _system

template<typename TSystem, typename TErrorCallback>
TSystem Engine::WrappedSystem< TSystem, TErrorCallback >::_system
private

The wrapped system.


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