CommonLibSSE (powerof3)
ObjectTypeInfo.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
5 #include "RE/B/BSTSmartPointer.h"
7 #include "RE/T/TypeInfo.h"
8 #include "RE/V/Variable.h"
9 
10 namespace RE
11 {
12  namespace BSScript
13  {
14  class IFunction;
15 
17  {
18  public:
19  enum class LinkValidState : std::uint32_t
20  {
21  kNotLinked,
25  };
26 
28  {
29  public:
30  // members
33  };
34  static_assert(sizeof(UnlinkedNativeFunction) == 0x10);
35 
36  struct UserFlagInfo
37  {
38  public:
39  enum : std::uintptr_t
40  {
41  kSetOnObject = 1 << 0
42  };
43 
44  [[nodiscard]] BSFixedString GetUserFlag() const;
45 
46  // members
47  std::uintptr_t data; // 0
48  };
49  static_assert(sizeof(UserFlagInfo) == 0x8);
50 
51  struct VariableInfo
52  {
53  public:
54  // members
56  TypeInfo type; // 08
57  };
58  static_assert(sizeof(VariableInfo) == 0x10);
59 
61  {
62  public:
63  // members
64  std::uint32_t variableIndex; // 00
65  std::uint32_t pad04; // 04
67  };
68  static_assert(sizeof(InitialValueInfo) == 0x18);
69 
70  struct PropertyInfo
71  {
72  public:
73  // members
76  };
77  static_assert(sizeof(PropertyInfo) == 0x48);
78 
80  {
81  public:
82  // members
84  };
85  static_assert(sizeof(GlobalFuncInfo) == 0x8);
86 
88  {
89  public:
90  // members
92  };
93  static_assert(sizeof(MemberFuncInfo) == 0x8);
94 
96  {
97  public:
98  enum : std::uint32_t
99  {
100  kFuncCountMask = 0x1FF,
101  kFuncOffsetShift = 9
102  };
103 
104  struct Func
105  {
106  public:
107  // members
109  };
110  static_assert(sizeof(Func) == 0x8);
111 
112  [[nodiscard]] constexpr std::uint32_t GetNumFuncs() const noexcept { return memberFunctionCount; }
114  [[nodiscard]] const Func* GetFuncIter() const;
115 
116  // members
118  std::uint32_t memberFunctionCount: 9; // 08 - 0
119  std::uint32_t memberFunctionOffset: 9; // 09 - 1
120  std::uint32_t pad0C; // 0C
121  };
122  static_assert(sizeof(NamedStateInfo) == 0x10);
123 
125 
126  const char* GetName() const;
128  const ObjectTypeInfo* GetParent() const;
130 
131  [[nodiscard]] constexpr bool IsLinked() const noexcept
132  {
133  switch (linkedValid) {
136  return true;
137  default:
138  return false;
139  }
140  }
141 
144 
145  [[nodiscard]] constexpr std::uint32_t GetNumUserFlags() const noexcept { return userFlagCount; }
148 
149  [[nodiscard]] constexpr std::uint32_t GetNumVariables() const noexcept { return variableCount; }
150  std::uint32_t GetTotalNumVariables() const;
153 
154  [[nodiscard]] constexpr std::uint32_t GetNumInitalValues() const noexcept { return initialValueCount; }
157 
158  [[nodiscard]] constexpr std::uint32_t GetNumProperties() const noexcept { return propertyCount; }
161 
162  [[nodiscard]] constexpr std::uint32_t GetNumGlobalFuncs() const noexcept { return staticFunctionCount; }
165 
166  [[nodiscard]] constexpr std::uint32_t GetNumMemberFuncs() const noexcept { return emptyStateMemberFunctionCount; }
169 
170  [[nodiscard]] constexpr std::uint32_t GetNumNamedStates() const noexcept { return namedStateCount; }
173 
174  std::uint32_t GetPropertyIndex(const BSFixedString& a_name) const;
175 
176  // members
180  LinkValidState linkedValid: 2; // 20 - 00 - 0 or 1 -> data == UnlinkedNativeFunction*, 2 or 3 -> data == normal progression
181  std::uint32_t userFlagCount: 6; // 20 - 02
182  std::uint32_t variableCount: 10; // 20 - 08
183  std::uint32_t variableUserFlagCount: 6; // 20 - 18
184  std::uint32_t pad20_24: 8; // 20 - 24
185  std::uint32_t initialValueCount: 10; // 24 - 0
186  std::uint32_t propertyCount: 10; // 24 - 10
187  std::uint32_t staticFunctionCount: 9; // 24 - 20
188  std::uint32_t pad24_29: 3; // 24 - 29
189  std::uint32_t emptyStateMemberFunctionCount: 11; // 28 - 0
190  std::uint32_t namedStateCount: 7; // 28 - 11
191  std::uint32_t pad28_18: 14; // 28 - 18
192  void* data; // 30
193 
194  private:
195  void ReleaseData();
196  };
197  static_assert(sizeof(ObjectTypeInfo) == 0x38);
198  }
199 }
Definition: ObjectTypeInfo.h:17
const GlobalFuncInfo * GetGlobalFuncIter() const
UserFlagInfo * GetUserFlagIter()
const VariableInfo * GetVariableIter() const
constexpr std::uint32_t GetNumProperties() const noexcept
Definition: ObjectTypeInfo.h:158
constexpr std::uint32_t GetNumGlobalFuncs() const noexcept
Definition: ObjectTypeInfo.h:162
BSFixedString name
Definition: ObjectTypeInfo.h:177
const NamedStateInfo * GetNamedStateIter() const
UnlinkedNativeFunction * GetUnlinkedFunctionIter()
std::uint32_t userFlagCount
Definition: ObjectTypeInfo.h:181
std::uint32_t staticFunctionCount
Definition: ObjectTypeInfo.h:187
constexpr bool IsLinked() const noexcept
Definition: ObjectTypeInfo.h:131
NamedStateInfo * GetNamedStateIter()
LinkValidState linkedValid
Definition: ObjectTypeInfo.h:180
std::uint32_t initialValueCount
Definition: ObjectTypeInfo.h:185
InitialValueInfo * GetInitialValueIter()
const UserFlagInfo * GetUserFlagIter() const
const PropertyInfo * GetPropertyIter() const
void * data
Definition: ObjectTypeInfo.h:192
std::uint32_t propertyCount
Definition: ObjectTypeInfo.h:186
std::uint32_t GetPropertyIndex(const BSFixedString &a_name) const
std::uint32_t variableUserFlagCount
Definition: ObjectTypeInfo.h:183
std::uint32_t variableCount
Definition: ObjectTypeInfo.h:182
const MemberFuncInfo * GetMemberFuncIter() const
std::uint32_t namedStateCount
Definition: ObjectTypeInfo.h:190
MemberFuncInfo * GetMemberFuncIter()
constexpr std::uint32_t GetNumVariables() const noexcept
Definition: ObjectTypeInfo.h:149
const ObjectTypeInfo * GetParent() const
std::uint32_t pad24_29
Definition: ObjectTypeInfo.h:188
constexpr std::uint32_t GetNumInitalValues() const noexcept
Definition: ObjectTypeInfo.h:154
const InitialValueInfo * GetInitialValueIter() const
LinkValidState
Definition: ObjectTypeInfo.h:20
const UnlinkedNativeFunction * GetUnlinkedFunctionIter() const
BSFixedString docString
Definition: ObjectTypeInfo.h:179
std::uint32_t pad20_24
Definition: ObjectTypeInfo.h:184
std::uint32_t GetTotalNumVariables() const
VariableInfo * GetVariableIter()
constexpr std::uint32_t GetNumUserFlags() const noexcept
Definition: ObjectTypeInfo.h:145
constexpr std::uint32_t GetNumNamedStates() const noexcept
Definition: ObjectTypeInfo.h:170
ObjectTypeInfo * GetParent()
PropertyInfo * GetPropertyIter()
BSTSmartPointer< ObjectTypeInfo > parentTypeInfo
Definition: ObjectTypeInfo.h:178
const char * GetName() const
constexpr std::uint32_t GetNumMemberFuncs() const noexcept
Definition: ObjectTypeInfo.h:166
std::uint32_t emptyStateMemberFunctionCount
Definition: ObjectTypeInfo.h:189
std::uint32_t pad28_18
Definition: ObjectTypeInfo.h:191
GlobalFuncInfo * GetGlobalFuncIter()
TypeInfo::RawType GetRawType() const
Definition: TypeInfo.h:10
RawType
Definition: TypeInfo.h:13
Definition: Variable.h:15
Definition: BSTSmartPointer.h:37
Definition: AbsorbEffect.h:6
Definition: BSIntrusiveRefCounted.h:8
Definition: ObjectTypeInfo.h:80
BSTSmartPointer< IFunction > func
Definition: ObjectTypeInfo.h:83
Definition: ObjectTypeInfo.h:61
std::uint32_t pad04
Definition: ObjectTypeInfo.h:65
Variable initialValue
Definition: ObjectTypeInfo.h:66
std::uint32_t variableIndex
Definition: ObjectTypeInfo.h:64
Definition: ObjectTypeInfo.h:88
BSTSmartPointer< IFunction > func
Definition: ObjectTypeInfo.h:91
BSTSmartPointer< IFunction > func
Definition: ObjectTypeInfo.h:108
Definition: ObjectTypeInfo.h:96
std::uint32_t pad0C
Definition: ObjectTypeInfo.h:120
BSFixedString name
Definition: ObjectTypeInfo.h:117
std::uint32_t memberFunctionCount
Definition: ObjectTypeInfo.h:118
constexpr std::uint32_t GetNumFuncs() const noexcept
Definition: ObjectTypeInfo.h:112
@ kFuncCountMask
Definition: ObjectTypeInfo.h:100
@ kFuncOffsetShift
Definition: ObjectTypeInfo.h:101
std::uint32_t memberFunctionOffset
Definition: ObjectTypeInfo.h:119
Definition: ObjectTypeInfo.h:71
PropertyTypeInfo info
Definition: ObjectTypeInfo.h:75
BSFixedString name
Definition: ObjectTypeInfo.h:74
BSTSmartPointer< IFunction > func
Definition: ObjectTypeInfo.h:32
UnlinkedNativeFunction * next
Definition: ObjectTypeInfo.h:31
Definition: ObjectTypeInfo.h:37
@ kSetOnObject
Definition: ObjectTypeInfo.h:41
std::uintptr_t data
Definition: ObjectTypeInfo.h:47
Definition: ObjectTypeInfo.h:52
TypeInfo type
Definition: ObjectTypeInfo.h:56
BSFixedString name
Definition: ObjectTypeInfo.h:55
Definition: PropertyTypeInfo.h:14