3#include "Internals/DelegateInvokerI.hpp"
4#include "Internals/DelegateInvokerL.hpp"
5#include "Internals/DelegateInvokerS.hpp"
6#include "Internals/LambdaSignatureHelper.hpp"
17 template<
class t_Ret,
class... t_Args>
35 template<
class t_Class>
DelegateImpl(t_Class * p_Owner, t_Ret(t_Class::* p_Handler)(t_Args...))
42 template<
class t_Lambda>
DelegateImpl(t_Ret(*p_Null)(t_Args...),
const t_Lambda & p_Lambda)
50 m_Invoker = p_Other.m_Invoker;
56 m_Invoker = p_Other.m_Invoker;
57 p_Other.m_Invoker =
nullptr;
70 m_Invoker = p_Other.m_Invoker;
78 return m_Invoker ? m_Invoker->IsValid() :
false;
86 return m_Invoker && p_Other && m_Invoker->EqualTo(p_Other->m_Invoker.get());
92 return Invoke(std::forward<t_Args>(p_Args)...);
100 if constexpr (std::is_reference<t_Ret>::value)
102 static typename std::remove_reference<t_Ret>::type s_Defaultt_Ret;
103 return s_Defaultt_Ret;
109 return m_Invoker->Invoke(std::forward<t_Args>(p_Args)...);
121 template <
class t_FnType>
129 template<
class t_Lambda,
class t_Sig =
typename Internals::LambdaSignatureHelper<decltype(&t_Lambda::operator())>::Signature>
147 template <
class... t_Args>
150 template <
class... t_Args>
157 template <
class t_Ret,
class... t_Args>
161 template <
class t_Ret,
class... t_Args>
virtual ~Delegate()
Destructor.
Delegate(const t_Lambda &p_Lambda)
Make delegate.
t_Ret Invoke(t_Args... p_Args) const
Invoke this delegate.
DelegateImpl(const DelegateImpl< t_Ret(t_Args...)> &p_Other)
Copy constructor.
bool EqualTo(const DelegateImpl< t_Ret(t_Args...)> *p_Other) const
Is this delegate equal to an other delegate.
DelegateImpl()
Constructor.
bool IsValid() const
Is the delegate valid.
DelegateImpl(t_Ret(*p_Null)(t_Args...), const t_Lambda &p_Lambda)
Lambda function constructor.
DelegateImpl(DelegateImpl< t_Ret(t_Args...)> &&p_Other)
Move constructor.
DelegateImpl(t_Class *p_Owner, t_Ret(t_Class::*p_Handler)(t_Args...))
Instance function constructor.
t_Ret operator()(t_Args... p_Args) const
Invoke this delegate.
virtual ~DelegateImpl()
Destructor.
DelegateImpl & operator=(const DelegateImpl &p_Other)
Assign operator.
DelegateImpl(t_Ret(*p_Handler)(t_Args...))
Static function constructor.
Instance function invoker.
Delegate invoker interface.
Various platform utils like Delegate/Action/Function/Event system.