prime/include/Kyoto/CObjectReference.hpp
Phillip Stephens c8d021edb4 Initial CVParamTransfer imps
Former-commit-id: ee48b34a8b9642a5436c6035272d02b484b11981
2023-01-14 01:26:24 -08:00

39 lines
959 B
C++

#ifndef _COBJECTREFERENCE
#define _COBJECTREFERENCE
#include <Kyoto/CVParamTransfer.hpp>
#include <Kyoto/SObjectTag.hpp>
#include <rstl/auto_ptr.hpp>
class IObj;
class IObjectStore;
class CObjectReference {
public:
CObjectReference(const rstl::auto_ptr< IObj >& obj);
~CObjectReference();
CObjectReference(IObjectStore& store, const rstl::auto_ptr< IObj >& obj, const SObjectTag& tag,
CVParamTransfer xfer);
bool IsLoaded() const { return x10_object != nullptr; }
void AddReference() { x0_refCount++; }
int RemoveReference();
void Lock();
void Unlock();
IObj* GetObject();
void Unload();
void CancelLoad();
bool IsLoading() const;
const SObjectTag& GetTag() const { return x4_objTag; }
private:
short x0_refCount : 16;
short x2_lockCount : 15;
short x3_loading : 1;
SObjectTag x4_objTag;
IObjectStore* xc_objectStore;
IObj* x10_object;
CVParamTransfer x14_params;
};
#endif // _COBJECTREFERENCE