ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
Loading...
Searching...
No Matches
DelegateInvokerL.hpp
1#pragma once
2
3#include "IDelegateInvoker.hpp"
4
5#include <algorithm>
6
7namespace CP_SDK::Utils::Internals {
8
10 template<class t_Lambda, class t_Ret, class... t_Args>
11 class DelegateInvokerL : public IDelegateInvoker<t_Ret, t_Args...>
12 {
13 public:
16 DelegateInvokerL(const t_Lambda & p_Lambda)
17 : m_Lambda(p_Lambda)
18 {
19 this->m_Kind = 3;
20 }
21
22 public:
24 bool IsValid() const override
25 {
26 return true;
27 }
30 bool EqualTo(const IDelegateInvoker<t_Ret, t_Args...>* p_Other) const override
31 {
32 return false;
33 }
36 t_Ret Invoke(t_Args... p_Args) const override
37 {
38 return m_Lambda(std::forward<t_Args>(p_Args)...);
39 }
40
41 private:
42 t_Lambda m_Lambda;
43
44 };
45
46}
DelegateInvokerL(const t_Lambda &p_Lambda)
Constructor.
t_Ret Invoke(t_Args... p_Args) const override
Invoke this invoker.
bool IsValid() const override
Is the delegate valid.
bool EqualTo(const IDelegateInvoker< t_Ret, t_Args... > *p_Other) const override
Is this invoker equal to an other invoker.