CommonLibSSE (Parapets fork)
Stack.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BSTArray.h"
5 #include "RE/B/BSTSmartPointer.h"
6 #include "RE/M/MemoryPage.h"
7 #include "RE/V/Variable.h"
8 
9 namespace RE
10 {
11  namespace BSScript
12  {
13  namespace Internal
14  {
15  class CodeTasklet;
16  }
17 
18  class IProfilePolicy;
19  class IStackCallbackFunctor;
20  class StackFrame;
21  class Variable;
22  struct IMemoryPagePolicy;
23 
25  {
26  public:
27  enum class State
28  {
29  kRunning = 0,
30  kFinished = 1,
31  kWaitingOnMemory = 2,
37  kRetryCall = 8
38  };
39 
40  enum class FreezeState
41  {
42  kUnfrozen = 0,
43  kFreezing = 1,
44  kFrozen = 2
45  };
46 
47  enum class StackType
48  {
49  };
50 
52  {
53  public:
54  // members
56  std::uint32_t availableMemoryInBytes; // 08 - e.g. a function with 1 arg will have 3 unused args, so this will be 0x30, a function with 6 args will have 0 unused args, so this will be 0x0
57  std::uint32_t pad0C; // 0C
58  };
59  static_assert(sizeof(MemoryPageData) == 0x10);
60 
61  ~Stack();
62 
63  std::uint32_t GetPageForFrame(const StackFrame* a_frame) const;
64  Variable& GetStackFrameVariable(const StackFrame* a_frame, std::uint32_t a_index, std::uint32_t a_pageHint);
65 
66  // members
67  std::uint32_t pad04; // 04
71  std::uint32_t frames; // 58
72  std::uint32_t pad5C; // 5C
73  StackFrame* top; // 60
82 
83  private:
84  void Dtor();
85  };
86  static_assert(sizeof(Stack) == 0xA0);
87  }
88 }
Definition: IProfilePolicy.h:18
Definition: StackFrame.h:15
Definition: Stack.h:25
std::uint32_t pad5C
Definition: Stack.h:72
StackFrame * top
Definition: Stack.h:73
stl::enumeration< State, std::uint32_t > state
Definition: Stack.h:74
VMStackID stackID
Definition: Stack.h:77
StackType
Definition: Stack.h:48
BSTSmartPointer< IStackCallbackFunctor > callback
Definition: Stack.h:80
Variable returnValue
Definition: Stack.h:76
std::uint32_t pad04
Definition: Stack.h:67
std::uint32_t frames
Definition: Stack.h:71
BSTSmartPointer< Stack > nextStack
Definition: Stack.h:81
State
Definition: Stack.h:28
Variable & GetStackFrameVariable(const StackFrame *a_frame, std::uint32_t a_index, std::uint32_t a_pageHint)
std::uint32_t GetPageForFrame(const StackFrame *a_frame) const
stl::enumeration< FreezeState, std::uint32_t > freezeState
Definition: Stack.h:75
FreezeState
Definition: Stack.h:41
IMemoryPagePolicy * policy
Definition: Stack.h:68
IProfilePolicy * profilePolicy
Definition: Stack.h:69
BSTSmartPointer< Internal::CodeTasklet > owningTasklet
Definition: Stack.h:79
BSTSmallArray< MemoryPageData, 3 > pages
Definition: Stack.h:70
stl::enumeration< StackType, std::uint32_t > stackType
Definition: Stack.h:78
Definition: Variable.h:15
Definition: BSTArray.h:377
Definition: BSTSmartPointer.h:37
Definition: AbsorbEffect.h:6
std::uint32_t VMStackID
Definition: BSCoreTypes.h:8
Definition: BSIntrusiveRefCounted.h:8
Definition: IMemoryPagePolicy.h:8
std::uint32_t pad0C
Definition: Stack.h:57
BSTAutoPointer< MemoryPage > page
Definition: Stack.h:55
std::uint32_t availableMemoryInBytes
Definition: Stack.h:56