2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _COBJECTREFERENCE
|
|
|
|
#define _COBJECTREFERENCE
|
2022-10-01 08:32:56 +00:00
|
|
|
|
|
|
|
#include <Kyoto/CVParamTransfer.hpp>
|
2022-10-06 09:23:45 +00:00
|
|
|
#include <Kyoto/SObjectTag.hpp>
|
2022-10-01 08:32:56 +00:00
|
|
|
#include <rstl/auto_ptr.hpp>
|
|
|
|
|
|
|
|
class IObj;
|
|
|
|
class IObjectStore;
|
|
|
|
class CObjectReference {
|
|
|
|
public:
|
|
|
|
CObjectReference(const rstl::auto_ptr< IObj >& obj);
|
|
|
|
// : x0_refCount(0)
|
|
|
|
// , x2_locked(false)
|
|
|
|
// , x2_lockCount(0)
|
|
|
|
// , xc_objectStore(nullptr)
|
|
|
|
// , x10_object(obj.release())
|
|
|
|
// , x14_params(CVParamTransfer::Null()) {}
|
2022-10-20 14:28:06 +00:00
|
|
|
~CObjectReference();
|
2022-10-01 08:32:56 +00:00
|
|
|
CObjectReference(IObjectStore* store, const rstl::auto_ptr< IObj >& obj, SObjectTag tag,
|
|
|
|
CVParamTransfer xfer);
|
|
|
|
|
|
|
|
bool IsLoaded() const { return x10_object != nullptr; }
|
2022-10-09 05:13:17 +00:00
|
|
|
|
2022-10-20 14:28:06 +00:00
|
|
|
void AddReference() { x0_refCount++; }
|
|
|
|
int RemoveReference();
|
|
|
|
void Lock();
|
|
|
|
void Unlock();
|
|
|
|
IObj* GetObject();
|
|
|
|
|
2022-10-01 08:32:56 +00:00
|
|
|
private:
|
2022-10-20 14:28:06 +00:00
|
|
|
short x0_refCount;
|
2022-10-01 08:32:56 +00:00
|
|
|
bool x2_locked : 1;
|
2022-10-09 05:37:23 +00:00
|
|
|
ushort x2_lockCount : 15;
|
2022-10-01 08:32:56 +00:00
|
|
|
SObjectTag x4_objTag;
|
|
|
|
IObjectStore* xc_objectStore;
|
|
|
|
IObj* x10_object;
|
|
|
|
CVParamTransfer x14_params;
|
|
|
|
};
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _COBJECTREFERENCE
|