| 57 | |
| 58 | |
| 59 | void luabind::detail::class_rep::shared_init(lua_State * L) |
| 60 | { |
| 61 | lua_newtable(L); |
| 62 | handle(L, -1).swap(m_table); |
| 63 | lua_newtable(L); |
| 64 | handle(L, -1).swap(m_default_table); |
| 65 | lua_pop(L, 2); |
| 66 | |
| 67 | class_registry* r = class_registry::get_registry(L); |
| 68 | // the following line should be equivalent whether or not this is a cpp class |
| 69 | assert((r->cpp_class() != LUA_NOREF) && "you must call luabind::open()"); |
| 70 | |
| 71 | lua_rawgeti(L, LUA_REGISTRYINDEX, (m_class_type == cpp_class) ? r->cpp_class() : r->lua_class()); |
| 72 | lua_setmetatable(L, -2); |
| 73 | |
| 74 | handle(L, -1).swap(m_self_ref); |
| 75 | |
| 76 | m_instance_metatable = (m_class_type == cpp_class) ? r->cpp_instance() : r->lua_instance(); |
| 77 | |
| 78 | lua_rawgetp(L, LUA_REGISTRYINDEX, &cast_graph_tag); |
| 79 | m_casts = static_cast<cast_graph*>(lua_touserdata(L, -1)); |
| 80 | lua_pop(L, 1); |
| 81 | |
| 82 | lua_rawgetp(L, LUA_REGISTRYINDEX, &classid_map_tag); |
| 83 | m_classes = static_cast<class_id_map*>(lua_touserdata(L, -1)); |
| 84 | lua_pop(L, 1); |
| 85 | |
| 86 | } |
| 87 | |
| 88 | luabind::detail::class_rep::class_rep(lua_State* L, const char* name_) |
| 89 | : m_type(typeid(null_type)) |
nothing calls this directly
no test coverage detected