CommonLibSSE (Parapets fork)
CCallback.h
Go to the documentation of this file.
1 #pragma once
2 
3 using SteamAPICall_t = std::uint64_t;
4 
5 namespace RE
6 {
8  {
9  public:
10  enum
11  {
14  };
15 
16  // add
17  virtual void Run(void* a_param); // 01
18  virtual void Run(void* a_param, bool a_IOFailure, SteamAPICall_t a_steamAPICall); // 00
19  virtual std::int32_t GetCallbackSizeBytes(); // 02
20 
21  // members
22  std::uint8_t callbackFlags; // 08
23  std::uint8_t pad09; // 09
24  std::uint16_t pad0A; // 0A
25  std::int32_t callback; // 0C
26  };
27  static_assert(sizeof(CCallbackBase) == 0x10);
28 
29  template <class T, class P>
30  class CCallResult : public CCallbackBase
31  {
32  public:
33  using func_t = void (T::*)(P*);
34 
35  // override (CCallbackBase)
36  void Run(void* a_param) override; // 01
37  void Run(void* a_param, bool a_IOFailure, SteamAPICall_t a_steamAPICall) override; // 00
38  std::int32_t GetCallbackSizeBytes() override; // 02
39 
40  // members
42  T* obj; // 18
43  func_t func; // 20
44  };
45  // size == 0x30
46 
47  template <class T, class P, bool bGameserver = false>
48  class CCallback : public CCallbackBase
49  {
50  public:
51  using func_t = void (T::*)(P*);
52 
53  // override (CCallbackBase)
54  void Run(void* a_param) override; // 01
55  void Run(void* a_param, bool a_IOFailure, SteamAPICall_t a_steamAPICall) override; // 00
56  std::int32_t GetCallbackSizeBytes() override; // 02
57 
58  // add
59  virtual ~CCallback(); // 03
60 
61  // members
62  T* obj; // 10
63  func_t func; // 18
64  };
65  // size == 0x28
66 }
std::uint64_t SteamAPICall_t
Definition: CCallback.h:3
Definition: CCallback.h:31
SteamAPICall_t apiCall
Definition: CCallback.h:41
std::int32_t GetCallbackSizeBytes() override
void(T::*)(P *) func_t
Definition: CCallback.h:33
void Run(void *a_param, bool a_IOFailure, SteamAPICall_t a_steamAPICall) override
func_t func
Definition: CCallback.h:43
T * obj
Definition: CCallback.h:42
void Run(void *a_param) override
Definition: CCallback.h:8
std::uint16_t pad0A
Definition: CCallback.h:24
std::int32_t callback
Definition: CCallback.h:25
std::uint8_t pad09
Definition: CCallback.h:23
@ k_ECallbackFlagsGameServer
Definition: CCallback.h:13
@ k_ECallbackFlagsRegistered
Definition: CCallback.h:12
std::uint8_t callbackFlags
Definition: CCallback.h:22
virtual void Run(void *a_param)
virtual std::int32_t GetCallbackSizeBytes()
virtual void Run(void *a_param, bool a_IOFailure, SteamAPICall_t a_steamAPICall)
Definition: CCallback.h:49
void(T::*)(P *) func_t
Definition: CCallback.h:51
T * obj
Definition: CCallback.h:62
virtual ~CCallback()
func_t func
Definition: CCallback.h:63
void Run(void *a_param) override
std::int32_t GetCallbackSizeBytes() override
void Run(void *a_param, bool a_IOFailure, SteamAPICall_t a_steamAPICall) override
Definition: AbsorbEffect.h:6