diff options
Diffstat (limited to 'src/lua/common/je_lua_proxy.h')
-rw-r--r-- | src/lua/common/je_lua_proxy.h | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/lua/common/je_lua_proxy.h b/src/lua/common/je_lua_proxy.h index d6a6a0a..aa03fa0 100644 --- a/src/lua/common/je_lua_proxy.h +++ b/src/lua/common/je_lua_proxy.h @@ -3,6 +3,8 @@ #include "je_lua_shared.hpp" +struct lua_State; + namespace JinEngine { namespace Lua @@ -11,22 +13,12 @@ namespace JinEngine class Proxy { public: - void bind(SharedBase* s) - { - if (s == nullptr) - return; - shared = s; - shared->retain(); - } + /// + /// Set lua_State and object it bind. + /// + void bind(SharedBase* s); - void release() - { - if (shared != nullptr) - { - shared->release(); - shared = nullptr; - } - } + void release(); template<class T> Shared<T>& getShared() @@ -44,10 +36,7 @@ namespace JinEngine return shared.getObject(); } - const char* getObjectType() - { - return shared->type; - } + const char* getObjectType(); // Bind shared object. SharedBase* shared; |