- Timestamp:
- 09/09/13 20:04:42 (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/lua/lua_dispatch.hh
r212 r213 154 154 int fixed_method_wrapper( lua_State* L ) 155 155 { 156 C* c = (C*)to_pointer( L, nv::lua:: upvalue_index(1) );156 C* c = (C*)to_pointer( L, nv::lua::detail::upvalue_index(1) ); 157 157 return dispatcher<typename return_type<F>::type>::call( L, c, 1, f ); 158 158 } -
trunk/nv/lua/lua_state.hh
r212 r213 4 4 // This file is part of NV Libraries. 5 5 // For conditions of distribution and use, see copyright notice in nv.hh 6 // 7 // TODO: decouple from the type database 8 // TODO: paths for function registration? 9 6 10 7 11 #ifndef NV_LUA_HH … … 25 29 const int ref_nil = -1; 26 30 const int ret_multi = -1; 27 28 int upvalue_index( int i );29 31 30 32 typedef int reference; -
trunk/nv/lua/lua_values.hh
r211 r213 52 52 namespace detail 53 53 { 54 struct void_type {};54 int upvalue_index( int i ); 55 55 56 56 void push_unsigned( lua_State *L, lunsigned v ); -
trunk/src/lua/lua_state.cc
r212 r213 433 433 } 434 434 435 int nv::lua::upvalue_index( int i )436 {437 return lua_upvalueindex(i);438 } -
trunk/src/lua/lua_values.cc
r208 r213 13 13 using nv::lua::lnumber; 14 14 using nv::lua::lunsigned; 15 16 int nv::lua::detail::upvalue_index( int i ) 17 { 18 return lua_upvalueindex(i); 19 } 15 20 16 21 bool nv::lua::detail::is_userdata( lua_State *L, int index, const char* metatable ) -
trunk/tests/lualib_test/lualib_test.cc
r99 r213 1 1 #include <nv/lib/lua.hh> 2 2 #include <nv/lua/lua_state.hh> 3 #include <nv/lua/lua_dispatch.hh> 3 4 #include <nv/lua/lua_raw.hh> 4 5 #include <nv/lua/lua_glm.hh> … … 10 11 #include <functional> 11 12 #include <nv/gui/gui_element.hh> 13 14 void hello( const std::string& h ) 15 { 16 std::cout << h << " world from C++!" << std::endl; 17 } 18 12 19 13 20 int main(int, char* []) … … 22 29 { 23 30 nv::lua::state state( true ); 24 n lua_register_glm( state );31 nv::lua::register_glm( state ); 25 32 // run the Lua script 33 state.register_function<decltype(hello),&hello>( "hello" ); 26 34 state.do_file( "init.lua" ); 35 //std::cout << nv::function_traits<decltype(hello)>::arg_count << std::endl; 27 36 28 37 log.set_level( nv::LOG_INFO );
Note: See TracChangeset
for help on using the changeset viewer.