1.1 --- a/core/NativeOwner.h Fri Mar 29 12:28:02 2013 -0400
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,59 +0,0 @@
1.4 -#ifndef _INCLUDE_SOURCEMOD_NATIVE_OWNER_H_
1.5 -#define _INCLUDE_SOURCEMOD_NATIVE_OWNER_H_
1.6 -
1.7 -#include <sp_vm_types.h>
1.8 -#include <sh_list.h>
1.9 -
1.10 -class CPlugin;
1.11 -struct NativeEntry;
1.12 -
1.13 -struct WeakNative
1.14 -{
1.15 - WeakNative(CPlugin *plugin, uint32_t index) :
1.16 - pl(plugin), idx(index), entry(NULL)
1.17 - {
1.18 - pl = plugin;
1.19 - idx = index;
1.20 - }
1.21 - WeakNative(CPlugin *plugin, uint32_t index, NativeEntry *pEntry) :
1.22 - pl(plugin), idx(index), entry(pEntry)
1.23 - {
1.24 - pl = plugin;
1.25 - idx = index;
1.26 - }
1.27 - CPlugin *pl;
1.28 - uint32_t idx;
1.29 - NativeEntry *entry;
1.30 -};
1.31 -
1.32 -using namespace SourceHook;
1.33 -
1.34 -class CNativeOwner
1.35 -{
1.36 -public:
1.37 - CNativeOwner();
1.38 -public:
1.39 - virtual void DropEverything();
1.40 -public:
1.41 - void AddNatives(const sp_nativeinfo_t *info);
1.42 -public:
1.43 - void SetMarkSerial(unsigned int serial);
1.44 - unsigned int GetMarkSerial();
1.45 - void PropogateMarkSerial(unsigned int serial);
1.46 -public:
1.47 - void AddDependent(CPlugin *pPlugin);
1.48 - void AddWeakRef(const WeakNative & ref);
1.49 - void DropRefsTo(CPlugin *pPlugin);
1.50 - void AddReplacedNative(NativeEntry *pEntry);
1.51 -private:
1.52 - void DropWeakRefsTo(CPlugin *pPlugin);
1.53 - void UnbindWeakRef(const WeakNative & ref);
1.54 -protected:
1.55 - List<CPlugin *> m_Dependents;
1.56 - unsigned int m_nMarkSerial;
1.57 - List<WeakNative> m_WeakRefs;
1.58 - List<NativeEntry *> m_Natives;
1.59 - List<NativeEntry *> m_ReplacedNatives;
1.60 -};
1.61 -
1.62 -#endif //_INCLUDE_SOURCEMOD_NATIVE_OWNER_H_