33#include "CoreMinimal.h"
43 template <CFunctionLike Function,
typename... Captures>
47 TTrimEnd<
sizeof...(Captures),
typename TFunction<Function>::Arguments>
49 FDefaultDelegateUserPolicy
54 template <CFunctionLike Function,
typename... Captures>
56 && (!CFunctorObject<Function>)
63 template <CFunctorObject Function>
64 TDelegate<TFunction_Signature<Function>>
From(Function&& func)
66 return TDelegate<TFunction_Signature<Function>>::CreateLambda(MoveTemp(func));
70 template <CSharedRef Object, CFunctorObject Function>
71 TDelegate<TFunction_Signature<Function>>
From(
const Object& self, Function&& func)
73 return TDelegate<TFunction_Signature<Function>>::CreateSPLambda(self, MoveTemp(func));
77 template <CSharedFromThis Object, CFunctorObject Function>
78 TDelegate<TFunction_Signature<Function>>
From(Object* self, Function&& func)
80 return TDelegate<TFunction_Signature<Function>>::CreateSPLambda(self, MoveTemp(func));
84 template <CSharedFromThis Object, CFunctorObject Function>
85 TDelegate<TFunction_Signature<Function>>
From(
const Object* self, Function&& func)
87 return TDelegate<TFunction_Signature<Function>>::CreateSPLambda(self, MoveTemp(func));
91 template <CPlainClass Object, CFunctorObject Function>
92 TDelegate<TFunction_Signature<Function>>
From(Object* self, Function&& func)
94 return TDelegate<TFunction_Signature<Function>>::CreateWeakLambda(self, MoveTemp(func));
98 template <CPlainClass Object, CFunctionLike Function,
typename... Captures>
106 template <CPlainClass Object, CFunctionLike Function,
typename... Captures>
114 template <CSharedRef Object, CFunctionLike Function,
typename... Captures>
122 template <CSharedFromThis Object, CFunctionLike Function,
typename... Captures>
126 return TInferredDelegate<Function, Captures...>::CreateSP(self, func, captures...);
130 template <CSharedFromThis Object, CFunctionLike Function,
typename... Captures>
134 return TInferredDelegate<Function, Captures...>::CreateSP(self, func, captures...);
138 template <CUObject Object, CFunctionLike Function,
typename... Captures>
140 && (!CFunctorObject<Function>)
143 return TInferredDelegate<Function, Captures...>::CreateUObject(self, func, captures...);
147 template <CUObject Object, CFunctionLike Function,
typename... Captures>
149 && (!CFunctorObject<Function>)
152 return TInferredDelegate<Function, Captures...>::CreateUObject(self, func, captures...);
161 template <
typename... Args>
162 TDelegate<void(Args...)>
From(TMulticastDelegate<
void(Args...)>& multicast)
164 return From([&](Args... args)
166 multicast.Broadcast(args...);
177 template <
typename Object,
typename... Args>
178 TDelegate<void(Args...)>
From(Object&& self, TMulticastDelegate<
void(Args...)>& multicast)
180 return From(Forward<Object>(self), [&](Args... args)
182 multicast.Broadcast(args...);
193 multicast.Broadcast(args...);
202 multicast.Broadcast(args...);
214 template <CDynamicMulticastDelegate Dynamic>
219 std::make_index_sequence<
234 template <
typename Object, CDynamicMulticastDelegate Dynamic>
238 Forward<Object>(self), multicast,
239 std::make_index_sequence<
TNative< typename Dynamic::FDelegate > FromDynamicMulticastDelegate(Dynamic &multicast, std::index_sequence< ArgIndices... > &&)
typename TNative_Struct< std::decay_t< Dynamic > >::Type TNative
TDelegate< TFunctionFromTuple< TFunction_Return< Function >, TTrimEnd< sizeof...(Captures), typename TFunction< Function >::Arguments > >, FDefaultDelegateUserPolicy > TInferredDelegate
TInferredDelegate< Function, Captures... > From(Function func, const Captures &... captures)
typename TDynamicMethodPtr_Struct< std::decay_t< Dynamic > >::Type TDynamicMethodPtr
typename TFunctionTraits< std::decay_t< T > >::template Arg< I > TFunction_Arg
typename TFunctionTraits< std::decay_t< T > >::Return TFunction_Return
constexpr size_t TFunction_ArgCount
typename TFunctionFromTuple_Struct< std::decay_t< Return >, std::decay_t< Tuple > >::Type TFunctionFromTuple
constexpr bool TFunction_IsMember
typename TTrimEnd_Struct< Count, Tuple >::Type TTrimEnd