aboutsummaryrefslogtreecommitdiff
path: root/src/lua/common/je_lua_runtime.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-08 22:05:31 +0800
committerchai <chaifix@163.com>2018-12-08 22:05:31 +0800
commita16ce94158c9cf22a19c0e73dfe2e992a8302af1 (patch)
tree52d80d950cd410ba82af909e18f77e3b11cd6eda /src/lua/common/je_lua_runtime.cpp
parentd34e5c9d7c6135e805f2cc231411cdcc9910190c (diff)
*去除shared template
Diffstat (limited to 'src/lua/common/je_lua_runtime.cpp')
-rw-r--r--src/lua/common/je_lua_runtime.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lua/common/je_lua_runtime.cpp b/src/lua/common/je_lua_runtime.cpp
index 055073d..0110d22 100644
--- a/src/lua/common/je_lua_runtime.cpp
+++ b/src/lua/common/je_lua_runtime.cpp
@@ -19,7 +19,7 @@ namespace JinEngine
using DepsMap = LuaObject::DepsMap;
- LuaObject* luax_newinstance(lua_State* L, const char* type, SharedBase* shared)
+ LuaObject* luax_newinstance(lua_State* L, const char* type, Shared* shared)
{
LuaObject* obj = static_cast<LuaObject*>(luax_newinstance(L, type, sizeof(LuaObject)));
obj->state = L;
@@ -46,7 +46,7 @@ namespace JinEngine
DepsMap& srcDeps = *src->dependencies;
for (DepsMap::iterator it = srcDeps.begin(); it != srcDeps.end(); ++it)
{
- SharedBase* shr = it->second;
+ Shared* shr = it->second;
// Try get lua object.
luax_getobject(src->state, shr);
LuaObject* luaObj = (LuaObject*)luax_checktype(src->state, -1, shr->getType());
@@ -54,7 +54,7 @@ namespace JinEngine
luax_copyinstance(to, luaObj);
luax_pop(to, 1); // Pop reference object.
}
- SharedBase * shr = src->getShared();
+ Shared * shr = src->getShared();
LuaObject* obj = luax_newinstance(to, src->getObjectType(), shr);
(*obj->dependencies) = (*src->dependencies);
// Add to objects_table.
@@ -68,13 +68,13 @@ namespace JinEngine
DepsMap::iterator it = deps.begin();
for (; it != deps.end(); ++it)
{
- SharedBase* dep = it->second;
+ Shared* dep = it->second;
luax_addreference(to, shr, dep);
}
return obj;
}
- int luax_getobject(lua_State* L, SharedBase* shared)
+ int luax_getobject(lua_State* L, Shared* shared)
{
luax_getobjectstable(L);
luax_pushlightuserdata(L, shared);
@@ -83,7 +83,7 @@ namespace JinEngine
return 1;
}
- void luax_removeobject(lua_State* L, SharedBase* shared)
+ void luax_removeobject(lua_State* L, Shared* shared)
{
luax_getobjectstable(L);
luax_pushlightuserdata(L, shared);
@@ -152,7 +152,7 @@ namespace JinEngine
return 1;
}
- void luax_getreference(lua_State* L, SharedBase* shared)
+ void luax_getreference(lua_State* L, Shared* shared)
{
luax_getreferencestable(L);
luax_pushlightuserdata(L, shared);
@@ -160,7 +160,7 @@ namespace JinEngine
luax_remove(L, -2);
}
- bool luax_addreference(lua_State* L, SharedBase* shared, SharedBase* dep)
+ bool luax_addreference(lua_State* L, Shared* shared, Shared* dep)
{
luax_getreference(L, shared);
// If no dependencies table, add one.
@@ -186,7 +186,7 @@ namespace JinEngine
return true;
}
- void luax_removereference(lua_State* L, SharedBase* shared)
+ void luax_removereference(lua_State* L, Shared* shared)
{
luax_getreferencestable(L);
luax_pushlightuserdata(L, shared);
@@ -195,7 +195,7 @@ namespace JinEngine
luax_pop(L, 1);
}
- void luax_removereference(lua_State* L, SharedBase* shared, SharedBase* dep)
+ void luax_removereference(lua_State* L, Shared* shared, Shared* dep)
{
luax_getreference(L, shared);
if (luax_isnil(L, -1))