SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::Delegate< Args > Class Template Reference

#include <Delegate.hpp>

Inheritance diagram for Sleak::Delegate< Args >:

Public Types

using FunctionType = std::function<void(Args...)>

Public Member Functions

 Delegate (FunctionType func)
void Execute () override
std::string GetID () override
void SetArgs (Args... args)
Public Member Functions inherited from Sleak::IDelegate
virtual ~IDelegate ()=default

Detailed Description

template<typename... Args>
class Sleak::Delegate< Args >

Callable wrapper that stashes its arguments via SetArgs and invokes them later via Execute.

Definition at line 28 of file Delegate.hpp.

Member Typedef Documentation

◆ FunctionType

template<typename... Args>
using Sleak::Delegate< Args >::FunctionType = std::function<void(Args...)>

Definition at line 30 of file Delegate.hpp.

Constructor & Destructor Documentation

◆ Delegate()

template<typename... Args>
Sleak::Delegate< Args >::Delegate ( FunctionType func)
inline

Definition at line 32 of file Delegate.hpp.

Member Function Documentation

◆ Execute()

template<typename... Args>
void Sleak::Delegate< Args >::Execute ( )
inlineoverridevirtual

Implements Sleak::IDelegate.

Definition at line 39 of file Delegate.hpp.

◆ GetID()

template<typename... Args>
std::string Sleak::Delegate< Args >::GetID ( )
inlineoverridevirtual

Implements Sleak::IDelegate.

Definition at line 45 of file Delegate.hpp.

◆ SetArgs()

template<typename... Args>
void Sleak::Delegate< Args >::SetArgs ( Args... args)
inline

Definition at line 34 of file Delegate.hpp.