Cyrus Mod Loader
Loading...
Searching...
No Matches
PropertyClass.h
1#pragma once
2#include <Cyrus/shared.h>
3#include <cstdint>
4
12template <class T> class SharedObjectDeleter {
13private:
14 int sharedRefCount; // 0x8
15 int weakRefCount; // 0x0C
16 T *object; // 0x10
17 size_t typeID; // 0x18
18
26 virtual SharedObjectDeleter<T *> ctor(bool free);
27
32 virtual void performDelete();
33
40 virtual SharedObjectDeleter<T *> dtor();
41
42public:
50 virtual size_t isSame(void *other) = 0;
51
57 int getSharedRefCount() { return sharedRefCount; }
58
64 int getWeakRefCount() { return weakRefCount; }
65
71 T *getObject() { return object; }
72
78 size_t getTypeID() { return typeID; }
79};
80
87private:
88 PropertyClass *self; // 0x0008
89 SharedObjectDeleter<PropertyClass *> *sharedDeleter; // 0x0010
90 char pad_0010[16]; // 0x0018
91 float N00000402; // 0x0028
92 float N00000E5C; // 0x002C
93 char pad_0030[24]; // 0x0030
94
99 virtual void initialize() = 0;
100
108 virtual void *destructor(bool freeThis) = 0;
109
110public:
116 virtual char *getClassName() = 0;
117
124 virtual void *getPropertyList() = 0;
125
132 virtual bool copy(uint32_t a1) = 0;
133
141 virtual void *serialize(void *a2, uint32_t a3) = 0;
142
148 virtual bool onCreated() = 0;
149
156 template <typename T> CYRUS T *as() { return static_cast<T *>(this); }
157
158private:
159 virtual void unknown_override() = 0;
160 virtual void unknown_override1() = 0;
161 virtual void unknown_override2() = 0;
162
163public:
168 virtual void onPostLoad() = 0;
169
170 virtual void onFinalizeLoad() = 0;
171
172public:
179 virtual bool shouldNotSerialize() = 0;
180
181private:
182 virtual bool noClue(void *a2, uint32_t a3) = 0;
183};
184STATIC_ASSERT(sizeof(PropertyClass) == 0x48,
185 "PropertyClass size is not correct");
Base class for all property classes, providing reflection and serialization functionality.
Definition PropertyClass.h:86
virtual void onFinalizeLoad()=0
virtual char * getClassName()=0
Gets the class name of the derived class in the format class T[*].
virtual bool shouldNotSerialize()=0
Determines if the PropertyClass should not be serialized.
virtual void * getPropertyList()=0
Constructs and caches the PropertyList for the derived class, adding all reflected members and member...
CYRUS T * as()
Casts this to a pointer of type T.
Definition PropertyClass.h:156
virtual void * serialize(void *a2, uint32_t a3)=0
Serializes the derived class's PropertyList as XML.
virtual void onPostLoad()=0
Called when the PropertyClass is loaded, i.e., initialize is called and onCreated has finished.
virtual bool copy(uint32_t a1)=0
Copies the property class data.
virtual bool onCreated()=0
Called when the PropertyClass is created.
Manages shared and weak references to an object and provides deletion management.
Definition PropertyClass.h:12
T * getObject()
Gets the managed object.
Definition PropertyClass.h:71
virtual size_t isSame(void *other)=0
Compares the typeID of other to the compile-time type ID of this.
int getWeakRefCount()
Gets the weak reference count.
Definition PropertyClass.h:64
size_t getTypeID()
Gets the type identifier of the managed object.
Definition PropertyClass.h:78
int getSharedRefCount()
Gets the shared reference count.
Definition PropertyClass.h:57