|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
welder LuaBridge3 Lua rod (header-only). More...
#include <array>#include <cstddef>#include <meta>#include <string>#include <type_traits>#include <utility>#include <vector>#include <welder/welder.hpp>#include <welder/rods/lua/metamethods.hpp>#include <welder/bind_traits.hpp>#include <lua.hpp>#include <LuaBridge/LuaBridge.h>Go to the source code of this file.
Classes | |
| struct | luabridge::Stack< E, std::enable_if_t< std::is_enum_v< E > > > |
| struct | welder::rods::luabridge::rod |
| The LuaBridge3 rod: a stateless policy type satisfying welder::rod. More... | |
| struct | welder::rods::luabridge::rod::module_scope |
| A copyable handle to a welded module (or submodule) table: the borrowed Lua state plus the namespace path from the global table. More... | |
| struct | welder::rods::luabridge::rod::session |
| Per-module session — unused: LuaBridge3 registers namespace variables as live properties eagerly (no deferred batch is needed, unlike sol2's live- variable proxy), so this is empty and open_module/close_module are no-ops. More... | |
| struct | welder::rods::luabridge::rod::class_handle< T > |
| The class handle threaded from make_class to the add_* hooks: enough to re-open the class (its module, its Lua name) plus the C++ type (via type, recovered by the per-member hooks from decltype). More... | |
| struct | welder::rods::luabridge::rod::enum_handle |
| The enum handle threaded from make_enum to add_enumerator: the enclosing module, the enum's Lua name (a nested namespace of values) and whether it is scoped (an unscoped enum also mirrors its names onto the module). More... | |
Namespaces | |
| namespace | luabridge |
| namespace | welder |
| namespace | welder::rods |
| namespace | welder::rods::luabridge |
Typedefs | |
| template<class... A> | |
| using | welder::rods::luabridge::ctor_sig = void(A...) |
| The alias void(A...) — a LuaBridge3 constructor signature (a function type whose parameters are the constructor arguments; the return type is ignored). | |
Functions | |
| template<class T, class... A> | |
| T | welder::rods::luabridge::make_object (A... args) |
| A factory that constructs T from the constructor arguments (works for normal constructors and, via C++26 parenthesized init, aggregates). | |
| consteval const char * | welder::rods::luabridge::lua_metamethod_name (std::meta::info f) |
| Map a member operator to its Lua metamethod __name, or nullptr if welder does not expose it (which also gates operator eligibility in the driver). | |
welder LuaBridge3 Lua rod (header-only).
A second Lua runtime rod alongside sol2: it implements welder's rod contract (<welder/welder.hpp>) for LuaBridge3 and hands the traversal/resolution off to welder's generic driver. All the language-agnostic work — deciding which members bind, gating bindability, walking bases and namespaces — lives in the core; only the LuaBridge3 emission primitives are here. Like sol2 it targets a loadable Lua C module entered through luaopen_<name>, but it lays the bindings down with LuaBridge3's fluent registrar instead of sol2's usertypes.
Requires the welder vocabulary first (#include <welder/vocabulary.hpp>). This header exposes exactly one thing to plug into welder::welder: the rod type welder::rods::luabridge::rod.
or, more simply, via the backend-agnostic entry macro (include this directory's module.hpp instead):
LuaBridge3 is a move-based fluent registrar: beginClass / beginNamespace move-consume their parent, and there may be only one "active" registrar at a time. welder's driver instead holds a stable module handle and mutates class / module handles across many separate add_* calls. The two are bridged with a re-open-by-path** model: welder::rods::luabridge::rod::module_scope is a light, copyable {lua_State*, namespace path}, and every emission primitive re-walks getGlobalNamespace(L).beginNamespace(path…) in a single chained expression and lets it unwind cleanly. beginNamespace reuses an existing namespace table (no wipe) and beginClass<T> re-opens a class preserving prior registrations, so the repeated open/close is correct; it costs a few extra table lookups per member at load time only. Everything else mirrors sol2:
Definition in file rod.hpp.