[luabind-cvs] luabind/luabind/luabind object.hpp,1.41,1.42
Brought to you by:
arvidn,
daniel_wallin
From: Arvid N. <ar...@us...> - 2006-10-05 19:57:57
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv780/luabind/luabind Modified Files: object.hpp Log Message: added missing function, registry() Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- object.hpp 1 Sep 2006 13:06:23 -0000 1.41 +++ object.hpp 5 Oct 2006 19:57:53 -0000 1.42 @@ -1111,6 +1111,7 @@ return object(from_stack(interpreter, -1)); } +// this could be optimized by returning a proxy inline object globals(lua_State* interpreter) { lua_pushvalue(interpreter, LUA_GLOBALSINDEX); @@ -1118,6 +1119,14 @@ return object(from_stack(interpreter, -1)); } +// this could be optimized by returning a proxy +inline object registry(lua_State* interpreter) +{ + lua_pushvalue(interpreter, LUA_REGISTRYINDEX); + detail::stack_pop pop(interpreter, 1); + return object(from_stack(interpreter, -1)); +} + template<class ValueWrapper, class K> inline object gettable(ValueWrapper const& table, K const& key) { |