CommonLibSSE (Parapets fork)
BSTMessageQueue.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace RE
4 {
5  template <class T>
6  class BSTFreeList;
7 
8  template <class T>
9  struct BSTFreeListElem;
10 
11  class ScrapHeap;
12 
13  template <class T>
15  {
16  public:
17  virtual ~BSTMessageQueue(); // 00
18 
19  // add
20  virtual bool Push(T* a_obj) = 0; // 01 - Wait for lock, then push
21  virtual bool TryPush(T* a_obj) = 0; // 02 - Try for lock, return false if taken, else push
22  virtual bool Pop(T* a_obj) = 0; // 03 - Wait for lock, then remove
23  virtual bool TryPop(T* a_obj) = 0; // 04 - Try for lock, return false if taken, else remove
24  };
25  static_assert(sizeof(BSTMessageQueue<void*>) == 0x8);
26 
27  template <class T>
29  {
30  public:
31  ~BSTCommonMessageQueue() override; // 00
32 
33  // override (BSTMessageQueue<T>)
34  bool Push(T* a_obj) override; // 01
35  bool TryPush(T* a_obj) override; // 02
36  bool Pop(T* a_obj) override; // 03
37  bool TryPop(T* a_obj) override; // 04
38 
39  protected:
40  // add
41  virtual bool PushInternal(T* a_obj); // 05 - { return false; }
42  virtual bool PopInternal(T* a_obj); // 06 - { return false; }
43 
44  public:
45  volatile mutable std::uint32_t lock; // 08
46  volatile std::uint32_t pad0C; // 0C
47  };
48  static_assert(sizeof(BSTCommonMessageQueue<void*>) == 0x10);
49 
50  template <class T>
52  {
53  public:
54  // members
55  ScrapHeap* unk10; // 10
56  std::uint64_t unk18; // 18
57  std::uint64_t unk20; // 20
58  };
59  static_assert(sizeof(BSTCommonScrapHeapMessageQueue<void*>) == 0x28);
60 
61  template <class T>
63  {
64  public:
65  ~BSTCommonLLMessageQueue() override; // 00
66 
67  protected:
68  // override (BSTCommonMessageQueue<T>)
69  bool PushInternal(T* a_obj) override; // 05
70  bool PopInternal(T* a_obj) override; // 06
71 
72  public:
76  };
77  static_assert(sizeof(BSTCommonLLMessageQueue<void*>) == 0x28);
78 
79  template <class T, std::size_t SIZE>
81  {
82  public:
84 
85  protected:
86  // override (BSTCommonMessageQueue<T>)
87  bool PushInternal(T* a_obj) override; // 05
88  bool PopInternal(T* a_obj) override; // 06
89 
90  public:
91  char queueBuffer[sizeof(T) * SIZE]; // 10
92  std::uint32_t numEntries; // ??
93  std::uint32_t pushIdx; // ??
94  std::uint32_t popIdx; // ??
95  };
96 }
Definition: BSTMessageQueue.h:63
BSTFreeList< T > * freeList
Definition: BSTMessageQueue.h:73
bool PopInternal(T *a_obj) override
BSTFreeListElem< T > * head
Definition: BSTMessageQueue.h:74
BSTFreeListElem< T > ** tail
Definition: BSTMessageQueue.h:75
bool PushInternal(T *a_obj) override
Definition: BSTMessageQueue.h:29
volatile std::uint32_t lock
Definition: BSTMessageQueue.h:45
bool Push(T *a_obj) override
bool Pop(T *a_obj) override
bool TryPop(T *a_obj) override
~BSTCommonMessageQueue() override
volatile std::uint32_t pad0C
Definition: BSTMessageQueue.h:46
virtual bool PushInternal(T *a_obj)
virtual bool PopInternal(T *a_obj)
bool TryPush(T *a_obj) override
Definition: BSTMessageQueue.h:52
ScrapHeap * unk10
Definition: BSTMessageQueue.h:55
std::uint64_t unk18
Definition: BSTMessageQueue.h:56
std::uint64_t unk20
Definition: BSTMessageQueue.h:57
Definition: BSTMessageQueue.h:81
char queueBuffer[sizeof(T) *SIZE]
Definition: BSTMessageQueue.h:91
bool PushInternal(T *a_obj) override
std::uint32_t numEntries
Definition: BSTMessageQueue.h:92
bool PopInternal(T *a_obj) override
std::uint32_t pushIdx
Definition: BSTMessageQueue.h:93
std::uint32_t popIdx
Definition: BSTMessageQueue.h:94
Definition: BSTFreeList.h:15
Definition: BSTMessageQueue.h:15
virtual ~BSTMessageQueue()
virtual bool TryPop(T *a_obj)=0
virtual bool TryPush(T *a_obj)=0
virtual bool Pop(T *a_obj)=0
virtual bool Push(T *a_obj)=0
Definition: ScrapHeap.h:8
Definition: AbsorbEffect.h:6
Definition: BSTFreeList.h:7