3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Reflection::CallbackEvent Class Reference

CallbackEvent bind one single function and is cheaper than Event. More...

#include <CallbackEvent.hpp>

Inheritance diagram for Engine3DRadSpace.Reflection::CallbackEvent:
Collaboration diagram for Engine3DRadSpace.Reflection::CallbackEvent:

Public Member Functions

 CallbackEvent ()=default
 Creates a CallbackEvent with no callback bound.
 CallbackEvent (std::function< Any(std::vector< Any >)> callback)
 Creates a CallbackEvent with the given callback function.
void Bind (std::function< Any(std::vector< Any >)> callback) override
 Bounds the given function to this instance.
Any operator() (std::vector< Any > &args) override
 Calls the bound function.
void Reset () noexcept override
 Unbinds the function from this instance.
Public Member Functions inherited from Engine3DRadSpace.Reflection::IEvent
virtual ~IEvent ()=default

Additional Inherited Members

Protected Member Functions inherited from Engine3DRadSpace.Reflection::IEvent
 IEvent ()=default

Detailed Description

CallbackEvent bind one single function and is cheaper than Event.

Constructor & Destructor Documentation

◆ CallbackEvent() [1/2]

Engine3DRadSpace.Reflection::CallbackEvent::CallbackEvent ( )
default

Creates a CallbackEvent with no callback bound.

◆ CallbackEvent() [2/2]

CallbackEvent::CallbackEvent ( std::function< Any(std::vector< Any >)> callback)
explicit

Creates a CallbackEvent with the given callback function.

Parameters
callbackThe callback function to bind to the event.

Member Function Documentation

◆ Bind()

void CallbackEvent::Bind ( std::function< Any(std::vector< Any >)> callback)
overridevirtual

Bounds the given function to this instance.

Parameters
callbackcallback function

Implements Engine3DRadSpace.Reflection::IEvent.

◆ operator()()

Any CallbackEvent::operator() ( std::vector< Any > & args)
overridevirtual

Calls the bound function.

Parameters
argsArguments pack
Returns
Return value wrapped in an Any type erased container.

Implements Engine3DRadSpace.Reflection::IEvent.

◆ Reset()

void CallbackEvent::Reset ( )
overridevirtualnoexcept

Unbinds the function from this instance.

Implements Engine3DRadSpace.Reflection::IEvent.


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