MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaTableHandle

Function luaTableHandle

app/src/DataModel/FrameBuilder.cpp:2492–2503  ·  view source on GitHub ↗

* @brief Lua C closure for tableHandle(table, reg) -> handle; resolve once, off the hot path. */

Source from the content-addressed store, hash-verified

2490 * @brief Lua C closure for tableHandle(table, reg) -> handle; resolve once, off the hot path.
2491 */
2492static int luaTableHandle(lua_State* L)
2493{
2494 auto* store = static_cast<DataModel::DataTableStore*>(lua_touserdata(L, lua_upvalueindex(1)));
2495 Q_ASSERT(store);
2496
2497 const char* table = luaL_checkstring(L, 1);
2498 const char* reg = luaL_checkstring(L, 2);
2499 const qint64 handle = store->handleOf(QString::fromUtf8(table), QString::fromUtf8(reg));
2500
2501 lua_pushnumber(L, static_cast<lua_Number>(handle));
2502 return 1;
2503}
2504
2505/**
2506 * @brief Lua C closure for tableHandleMany(table, regs) -> handles; one handle per name, -1 if

Callers

nothing calls this directly

Calls 3

lua_touserdataFunction · 0.85
lua_pushnumberFunction · 0.85
handleOfMethod · 0.80

Tested by

no test coverage detected