| 61 | |
| 62 | |
| 63 | luabind::detail::class_rep::class_rep(LUABIND_TYPE_INFO type |
| 64 | , const char* name |
| 65 | , lua_State* L |
| 66 | , void(*destructor)(void*) |
| 67 | , void(*const_holder_destructor)(void*) |
| 68 | , LUABIND_TYPE_INFO holder_type |
| 69 | , LUABIND_TYPE_INFO const_holder_type |
| 70 | , void*(*extractor)(void*) |
| 71 | , const void*(*const_extractor)(void*) |
| 72 | , void(*const_converter)(void*,void*) |
| 73 | , void(*construct_holder)(void*,void*) |
| 74 | , void(*construct_const_holder)(void*,void*) |
| 75 | , void(*default_construct_holder)(void*) |
| 76 | , void(*default_construct_const_holder)(void*) |
| 77 | , void(*adopt_fun)(void*) |
| 78 | , int holder_size |
| 79 | , int holder_alignment) |
| 80 | |
| 81 | : m_type(type) |
| 82 | , m_holder_type(holder_type) |
| 83 | , m_const_holder_type(const_holder_type) |
| 84 | , m_extractor(extractor) |
| 85 | , m_const_extractor(const_extractor) |
| 86 | , m_const_converter(const_converter) |
| 87 | , m_construct_holder(construct_holder) |
| 88 | , m_construct_const_holder(construct_const_holder) |
| 89 | , m_default_construct_holder(default_construct_holder) |
| 90 | , m_default_construct_const_holder(default_construct_const_holder) |
| 91 | , m_adopt_fun(adopt_fun) |
| 92 | , m_holder_size(holder_size) |
| 93 | , m_holder_alignment(holder_alignment) |
| 94 | , m_name(name) |
| 95 | , m_class_type(cpp_class) |
| 96 | , m_destructor(destructor) |
| 97 | , m_const_holder_destructor(const_holder_destructor) |
| 98 | , m_operator_cache(0) |
| 99 | { |
| 100 | assert(m_holder_alignment >= 1 && "internal error"); |
| 101 | |
| 102 | lua_newtable(L); |
| 103 | m_table_ref.set(L); |
| 104 | |
| 105 | lua_newtable(L); |
| 106 | m_default_table_ref.set(L); |
| 107 | |
| 108 | class_registry* r = class_registry::get_registry(L); |
| 109 | assert((r->cpp_class() != LUA_NOREF) && "you must call luabind::open()"); |
| 110 | |
| 111 | detail::getref(L, r->cpp_class()); |
| 112 | lua_setmetatable(L, -2); |
| 113 | |
| 114 | lua_pushvalue(L, -1); // duplicate our user data |
| 115 | m_self_ref.set(L); |
| 116 | |
| 117 | m_instance_metatable = r->cpp_instance(); |
| 118 | } |
| 119 | |
| 120 | luabind::detail::class_rep::class_rep(lua_State* L, const char* name) |
nothing calls this directly
no test coverage detected