14#include "CoreMinimal.h"
28#define MCRO_DYNAMIC_EVENT_MULTIPLEX(functionName) \
29 Mcro::Delegates::TNativeMultiplex<F##functionName> functionName##Multiplex \
31 Mcro::Delegates::From(this, &MCRO_THIS_TYPE::functionName), \
32 Mcro::Delegates::From(functionName##Event) \
42#define MCRO_DYNAMIC_RETURN(delegate, type) \
43 template<> struct Mcro::Delegates::TReturnOverride_Struct<delegate> { using Type = type; }
51 template <
typename Return,
typename... Args>
57 using FDelegate = TDelegate<FunctionSignature, FDefaultDelegateUserPolicy>;
58 using FEventDelegate = TDelegate<EventSignature, FDefaultDelegateUserPolicy>;
60 template <CSameAs<FEventDelegate>... Delegates>
90 template <CNonVoid Return,
typename... Args>
94 template <CSameAs<FEventDelegate>... Delegates>
96 : Detail::TEventMultiplexBase<void, Args...>(function, delegates...)
99 Return operator() (Args... args)
101 Return result = Function.Execute(args...);
102 Multicast.Broadcast(args...);
106 template <
typename... OptionalObject>
requires (
sizeof...(OptionalObject) <= 1)
109 return From(
object..., &TEventMultiplex::operator());
113 template <
typename... Args>
117 template <CSameAs<FEventDelegate>... Delegates>
119 : Detail::TEventMultiplexBase<void, Args...>(function, delegates...)
122 void operator ()(Args... args)
124 Function.Execute(args...);
125 Multicast.Broadcast(args...);
128 template <
typename... OptionalObject>
requires (
sizeof...(OptionalObject) <= 1)
131 return From(
object..., &TEventMultiplex::operator());
135 template <CDynamicMulticastDelegate Dynamic>
141 template <
typename Dynamic>
void(Args...) EventSignature
Return(Args...) FunctionSignature
TEventMultiplexBase(FDelegate &&function, Delegates &&... delegates)
TDelegate< FunctionSignature, FDefaultDelegateUserPolicy > FDelegate
TEventDelegate< void(Args...)> Multicast
TDelegate< EventSignature, FDefaultDelegateUserPolicy > FEventDelegate
TEventDelegate< void(Args...)> * operator->() const
TEventMultiplex(FDelegate &&function, Delegates &&... delegates)
FDelegate Delegation(OptionalObject... object)
TEventMultiplex(FDelegate &&function, Delegates &&... delegates)
FDelegate Delegation(OptionalObject... object)
typename TReturnOverride_Struct< Dynamic >::Type TReturnOverride
TInferredDelegate< Function, Captures... > From(Function func, const Captures &... captures)
typename TNativeMultiplex_Struct< Dynamic, Return >::Type TNativeMultiplex
TFunctionFromTuple< Return, TFunction_Arguments< DstFunction > > TSetReturn