Update to the latest AMTL - Rename Ref to RefPtr.
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
|
||||
LibrarySystem g_LibSys;
|
||||
|
||||
CLibrary::CLibrary(ke::Ref<ke::SharedLib> lib)
|
||||
CLibrary::CLibrary(ke::RefPtr<ke::SharedLib> lib)
|
||||
: lib_(lib)
|
||||
{
|
||||
}
|
||||
@@ -241,7 +241,7 @@ void LibrarySystem::CloseDirectory(IDirectory *dir)
|
||||
|
||||
ILibrary *LibrarySystem::OpenLibrary(const char *path, char *error, size_t maxlength)
|
||||
{
|
||||
ke::Ref<ke::SharedLib> lib = ke::SharedLib::Open(path, error, maxlength);
|
||||
ke::RefPtr<ke::SharedLib> lib = ke::SharedLib::Open(path, error, maxlength);
|
||||
if (!lib)
|
||||
return nullptr;
|
||||
return new CLibrary(lib);
|
||||
|
||||
@@ -66,12 +66,12 @@ private:
|
||||
class CLibrary : public ILibrary
|
||||
{
|
||||
public:
|
||||
CLibrary(ke::Ref<ke::SharedLib> lib);
|
||||
CLibrary(ke::RefPtr<ke::SharedLib> lib);
|
||||
public:
|
||||
void CloseLibrary() override;
|
||||
void *GetSymbolAddress(const char *symname) override;
|
||||
private:
|
||||
ke::Ref<ke::SharedLib> lib_;
|
||||
ke::RefPtr<ke::SharedLib> lib_;
|
||||
};
|
||||
|
||||
class LibrarySystem : public ILibrarySys
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ struct Native : public ke::Refcounted<Native>
|
||||
return fake->name.chars();
|
||||
}
|
||||
|
||||
static inline bool matches(const char *name, const ke::Ref<Native> &entry)
|
||||
static inline bool matches(const char *name, const ke::RefPtr<Native> &entry)
|
||||
{
|
||||
return strcmp(name, entry->name()) == 0;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ protected:
|
||||
unsigned int m_nMarkSerial;
|
||||
List<WeakNative> m_WeakRefs;
|
||||
ke::Vector<const sp_nativeinfo_t *> m_natives;
|
||||
ke::Vector<ke::Ref<Native> > m_fakes;
|
||||
ke::Vector<ke::RefPtr<Native> > m_fakes;
|
||||
};
|
||||
|
||||
extern CNativeOwner g_CoreNatives;
|
||||
|
||||
@@ -676,7 +676,7 @@ void CPlugin::DependencyDropped(CPlugin *pOwner)
|
||||
unsigned int unbound = 0;
|
||||
for (size_t i = 0; i < pOwner->m_fakes.length(); i++)
|
||||
{
|
||||
ke::Ref<Native> entry(pOwner->m_fakes[i]);
|
||||
ke::RefPtr<Native> entry(pOwner->m_fakes[i]);
|
||||
|
||||
uint32_t idx;
|
||||
if (m_pRuntime->FindNativeByName(entry->name(), &idx) != SP_ERROR_NONE)
|
||||
@@ -769,7 +769,7 @@ void CPlugin::DropEverything()
|
||||
|
||||
bool CPlugin::AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func)
|
||||
{
|
||||
ke::Ref<Native> entry = g_ShareSys.AddFakeNative(pFunc, name, func);
|
||||
ke::RefPtr<Native> entry = g_ShareSys.AddFakeNative(pFunc, name, func);
|
||||
if (!entry)
|
||||
return false;
|
||||
|
||||
@@ -2319,7 +2319,7 @@ public:
|
||||
|
||||
void AddPluginsListener_V1(IPluginsListener_V1 *listener) override
|
||||
{
|
||||
ke::Ref<PluginsListenerV1Wrapper> wrapper = new PluginsListenerV1Wrapper(listener);
|
||||
ke::RefPtr<PluginsListenerV1Wrapper> wrapper = new PluginsListenerV1Wrapper(listener);
|
||||
|
||||
v1_wrappers_.append(wrapper);
|
||||
g_PluginSys.AddPluginsListener(wrapper);
|
||||
@@ -2327,7 +2327,7 @@ public:
|
||||
|
||||
void RemovePluginsListener_V1(IPluginsListener_V1 *listener) override
|
||||
{
|
||||
ke::Ref<PluginsListenerV1Wrapper> wrapper;
|
||||
ke::RefPtr<PluginsListenerV1Wrapper> wrapper;
|
||||
|
||||
// Find which wrapper has this listener.
|
||||
for (decltype(v1_wrappers_)::iterator iter(v1_wrappers_); !iter.done(); iter.next()) {
|
||||
@@ -2356,7 +2356,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
ReentrantList<ke::Ref<PluginsListenerV1Wrapper>> v1_wrappers_;
|
||||
ReentrantList<ke::RefPtr<PluginsListenerV1Wrapper>> v1_wrappers_;
|
||||
};
|
||||
|
||||
static OldPluginAPI sOldPluginAPI;
|
||||
|
||||
@@ -292,7 +292,7 @@ void ShareSystem::BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly)
|
||||
continue;
|
||||
|
||||
/* Otherwise, the native must be in our cache. */
|
||||
Ref<Native> pEntry = FindNative(native->name);
|
||||
RefPtr<Native> pEntry = FindNative(native->name);
|
||||
if (!pEntry)
|
||||
continue;
|
||||
|
||||
@@ -303,7 +303,7 @@ void ShareSystem::BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly)
|
||||
}
|
||||
}
|
||||
|
||||
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, const Ref<Native> &entry)
|
||||
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, const RefPtr<Native> &entry)
|
||||
{
|
||||
if (!entry->owner)
|
||||
return;
|
||||
@@ -325,7 +325,7 @@ void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, const Ref<Native> &entry)
|
||||
}
|
||||
|
||||
void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, const sp_native_t *native, uint32_t index,
|
||||
const Ref<Native> &pEntry)
|
||||
const RefPtr<Native> &pEntry)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
if (pEntry->fake)
|
||||
@@ -374,7 +374,7 @@ PassRef<Native> ShareSystem::AddNativeToCache(CNativeOwner *pOwner, const sp_nat
|
||||
if (i.found())
|
||||
return NULL;
|
||||
|
||||
Ref<Native> entry = new Native(pOwner, ntv);
|
||||
RefPtr<Native> entry = new Native(pOwner, ntv);
|
||||
m_NtvCache.insert(ntv->name, entry);
|
||||
return entry;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ void ShareSystem::ClearNativeFromCache(CNativeOwner *pOwner, const char *name)
|
||||
if (!r.found())
|
||||
return;
|
||||
|
||||
Ref<Native> entry(*r);
|
||||
RefPtr<Native> entry(*r);
|
||||
if (entry->owner != pOwner)
|
||||
return;
|
||||
|
||||
@@ -402,7 +402,7 @@ void ShareSystem::ClearNativeFromCache(CNativeOwner *pOwner, const char *name)
|
||||
|
||||
PassRef<Native> ShareSystem::AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func)
|
||||
{
|
||||
Ref<Native> entry(FindNative(name));
|
||||
RefPtr<Native> entry(FindNative(name));
|
||||
if (entry)
|
||||
return NULL;
|
||||
|
||||
@@ -475,7 +475,7 @@ FeatureStatus ShareSystem::TestNative(IPluginRuntime *pRuntime, const char *name
|
||||
}
|
||||
}
|
||||
|
||||
Ref<Native> entry = FindNative(name);
|
||||
RefPtr<Native> entry = FindNative(name);
|
||||
if (!entry)
|
||||
return FeatureStatus_Unknown;
|
||||
|
||||
|
||||
@@ -121,15 +121,15 @@ public:
|
||||
public:
|
||||
void BeginBindingFor(CPlugin *pPlugin);
|
||||
void BindNativesToPlugin(CPlugin *pPlugin, bool bCoreOnly);
|
||||
void BindNativeToPlugin(CPlugin *pPlugin, const ke::Ref<Native> &pEntry);
|
||||
void BindNativeToPlugin(CPlugin *pPlugin, const ke::RefPtr<Native> &pEntry);
|
||||
ke::PassRef<Native> AddFakeNative(IPluginFunction *pFunc, const char *name, SPVM_FAKENATIVE_FUNC func);
|
||||
ke::PassRef<Native> FindNative(const char *name);
|
||||
private:
|
||||
ke::PassRef<Native> AddNativeToCache(CNativeOwner *pOwner, const sp_nativeinfo_t *ntv);
|
||||
void ClearNativeFromCache(CNativeOwner *pOwner, const char *name);
|
||||
void BindNativeToPlugin(CPlugin *pPlugin, const sp_native_t *ntv, uint32_t index, const ke::Ref<Native> &pEntry);
|
||||
void BindNativeToPlugin(CPlugin *pPlugin, const sp_native_t *ntv, uint32_t index, const ke::RefPtr<Native> &pEntry);
|
||||
private:
|
||||
typedef NameHashSet<ke::Ref<Native>, Native> NativeCache;
|
||||
typedef NameHashSet<ke::RefPtr<Native>, Native> NativeCache;
|
||||
|
||||
List<IfaceInfo> m_Interfaces;
|
||||
HandleType_t m_TypeRoot;
|
||||
|
||||
@@ -1716,7 +1716,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
ke::Ref<IDatabase> db_;
|
||||
ke::RefPtr<IDatabase> db_;
|
||||
Transaction *txn_;
|
||||
IdentityToken_t *ident_;
|
||||
IPluginFunction *success_;
|
||||
|
||||
Reference in New Issue
Block a user