this function will add all the overloads in method rep to this class' lua tables. If there already are overloads with this name, thses will simply be appended to the overload list
| 1460 | // this class' lua tables. If there already are overloads with this |
| 1461 | // name, thses will simply be appended to the overload list |
| 1462 | void luabind::detail::class_rep::register_methods(lua_State* L) |
| 1463 | { |
| 1464 | LUABIND_CHECK_STACK(L); |
| 1465 | // insert the function in the normal member table |
| 1466 | // and in the default member table |
| 1467 | m_default_table_ref.get(L); |
| 1468 | m_table_ref.get(L); |
| 1469 | |
| 1470 | // pops the tables |
| 1471 | detail::stack_pop pop_tables(L, 2); |
| 1472 | |
| 1473 | for (list_class<method_rep>::const_iterator m = m_methods.begin(); |
| 1474 | m != m_methods.end(); ++m) |
| 1475 | { |
| 1476 | // create the function closure in m_table_ref |
| 1477 | lua_pushstring(L, m->name); |
| 1478 | lua_pushlightuserdata(L, const_cast<void*>((const void*)&(*m))); |
| 1479 | lua_pushboolean(L, 0); |
| 1480 | lua_pushlightuserdata(L, reinterpret_cast<void*>(0x1337)); |
| 1481 | lua_pushcclosure(L, function_dispatcher, 3); |
| 1482 | lua_settable(L, -3); |
| 1483 | |
| 1484 | // create the function closure in m_default_table_ref |
| 1485 | lua_pushstring(L, m->name); |
| 1486 | lua_pushlightuserdata(L, const_cast<void*>((const void*)&(*m))); |
| 1487 | lua_pushboolean(L, 1); |
| 1488 | lua_pushlightuserdata(L, reinterpret_cast<void*>(0x1337)); |
| 1489 | lua_pushcclosure(L, function_dispatcher, 3); |
| 1490 | lua_settable(L, -4); |
| 1491 | } |
| 1492 | } |
| 1493 | |
| 1494 | const class_rep::property_map& luabind::detail::class_rep::properties() const |
| 1495 | { |
no test coverage detected