CommonLibSSE (powerof3)
Object.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
4 #include "RE/B/BSTSmartPointer.h"
5 #include "RE/M/MemoryManager.h"
6 #include "RE/V/Variable.h"
7 
8 namespace RE
9 {
10  namespace BSScript
11  {
12  class ObjectTypeInfo;
13 
14  class Object
15  {
16  public:
18 
19  [[nodiscard]] VMHandle GetHandle() const;
21  [[nodiscard]] const ObjectTypeInfo* GetTypeInfo() const;
22  [[nodiscard]] constexpr bool IsConstructed() const noexcept { return static_cast<bool>(constructed); }
23  [[nodiscard]] constexpr bool IsInitialized() const noexcept { return static_cast<bool>(initialized); }
24  [[nodiscard]] constexpr bool IsValid() const noexcept { return static_cast<bool>(valid); }
25 
26  [[nodiscard]] void* Resolve(VMTypeID a_typeID) const;
27 
28  void IncRef();
29  std::uint32_t DecRef();
30 
32  [[nodiscard]] const Variable* GetProperty(const BSFixedString& a_name) const;
33 
35 
36  // members
37  std::uint32_t constructed: 1; // 00 - 0
38  std::uint32_t initialized: 1; // 00 - 1
39  std::uint32_t valid: 1; // 00 - 2
40  std::uint32_t remainingPropsToInit: 29; // 00 - 3
43  void* lockStructure; // 18 - first bit used as flag
44  volatile VMHandle handle; // 20
45  volatile std::int32_t refCountAndHandleLock; // 28
46  std::uint32_t pad2C; // 2C
47  Variable variables[0]; // 30 - size == classPtr->GetTotalNumVariables() + 3
48 
49  private:
50  void Dtor();
51  };
52  static_assert(sizeof(Object) == 0x30);
53  }
54 }
Definition: ObjectTypeInfo.h:17
Definition: Object.h:15
VMHandle GetHandle() const
std::uint32_t valid
Definition: Object.h:39
BSFixedString currentState
Definition: Object.h:42
constexpr bool IsConstructed() const noexcept
Definition: Object.h:22
const ObjectTypeInfo * GetTypeInfo() const
std::uint32_t initialized
Definition: Object.h:38
std::uint32_t remainingPropsToInit
Definition: Object.h:40
void * lockStructure
Definition: Object.h:43
const Variable * GetProperty(const BSFixedString &a_name) const
void * Resolve(VMTypeID a_typeID) const
ObjectTypeInfo * GetTypeInfo()
BSTSmartPointer< ObjectTypeInfo > type
Definition: Object.h:41
std::uint32_t pad2C
Definition: Object.h:46
volatile VMHandle handle
Definition: Object.h:44
constexpr bool IsInitialized() const noexcept
Definition: Object.h:23
constexpr bool IsValid() const noexcept
Definition: Object.h:24
std::uint32_t constructed
Definition: Object.h:37
std::uint32_t DecRef()
Variable * GetProperty(const BSFixedString &a_name)
volatile std::int32_t refCountAndHandleLock
Definition: Object.h:45
Variable variables[0]
Definition: Object.h:47
Definition: Variable.h:15
Definition: BSTSmartPointer.h:37
Definition: AbsorbEffect.h:6
std::uint32_t VMTypeID
Definition: BSCoreTypes.h:9
std::uint64_t VMHandle
Definition: BSCoreTypes.h:7