MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::Delegates::TEventDelegate< Function, DefaultPolicy > Class Template Reference

"Extension" of a common TMulticastDelegate. It allows to define optional "flags" when adding a binding, in order to: More...

#include <EventDelegate.h>

Detailed Description

template<typename Function, FEventPolicy DefaultPolicy = {}>
class Mcro::Delegates::TEventDelegate< Function, DefaultPolicy >

"Extension" of a common TMulticastDelegate. It allows to define optional "flags" when adding a binding, in order to:

  • Remove the binding after the next broadcast
  • Execute the associated event immediately if the delegate has already been broadcast
  • Allow comfortable chaining

The delegate can be defined with default settings that will be applied by default to all bindings (but the behavior can still be changed per-binding if needed (except thread safety and argument retention mode).

Example usage:

// The delegate will use default settings (i.e. the behavior will be the same as a TMulticastDelegate by default)
using FMyEventDelegate = TEventDelegate<void(int32 someParam)>;
// Fire a new binding immediately if the delegate has been already broadcasted
using FMyEventDelegate = TEventDelegate<void(int32 someParam), {.Belated = true}>;
// Fire a new binding immediately if the delegate has been already broadcasted,
// AND the binding will be removed after the next broadcast
using FMyEventDelegate = TEventDelegate<void(int32 someParam), {.Belated = true, .Once = true}>;
"Extension" of a common TMulticastDelegate. It allows to define optional "flags" when adding a bindin...

Definition at line 102 of file EventDelegate.h.


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