|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
Classes | |
| struct | document |
| The growing generated header: the trampoline struct bodies and their trampoline_for registrations, kept apart so the structs can share one namespace generated { … } block and the registrations sit at global scope. More... | |
| struct | rod |
| The trampoline-generator rod: a stateless welder::rod that, instead of registering a live module, appends a compilable trampoline struct (plus its trampoline_for registration) for every welded virtual type it visits. More... | |
Functions | |
| consteval std::string | int_string (std::size_t n) |
| Render a non-negative integer as decimal (constexpr std::to_string is not available on gcc-16 in a constant-evaluated context). | |
| consteval std::string | cpp_qualified_name (std::meta::info ent) |
| The fully ::-qualified name of a namespace-scope entity, leading :: included (geometry::Point → "::geometry::Point"). | |
| consteval std::string | trampoline_ident (std::meta::info type) |
| A collision-free identifier for type's generated trampoline: its qualified name with :: folded to _ (geometry::Point → geometry_Point_trampoline). | |
| consteval bool | is_c_variadic (std::meta::info fn) |
| Is fn a C-style variadic function (R(…, ...))? | |
| consteval std::string | qualifier_tokens (std::meta::info fn) |
| The trailing cv / ref-qualifier / noexcept tokens of a member function fn, in grammatical order (" const & noexcept"), each with a leading space. | |
| consteval std::string | render_trampoline (std::meta::info type) |
| Render the trampoline struct for welded virtual type type — one override per overridable virtual, each splicing the base's own reflected return/parameter types and forwarding to Python via WELDER_PY_OVERRIDE_AS (the slot-reflection form, so overloaded virtuals dispatch correctly). | |
| consteval std::string | render_registration (std::meta::info type) |
| The trampoline_for<type> specialization pointing at type's generated struct. | |
Variables | |
| constexpr const char * | generated_namespace |
| The namespace the generated trampoline structs are emitted into (fully qualified). | |
|
consteval |
The fully ::-qualified name of a namespace-scope entity, leading :: included (geometry::Point → "::geometry::Point").
Used both to name a trampoline's base and to splice the type in the generated file from any namespace.
Definition at line 51 of file document.hpp.
Referenced by render_registration(), and render_trampoline().
|
consteval |
Render a non-negative integer as decimal (constexpr std::to_string is not available on gcc-16 in a constant-evaluated context).
Definition at line 39 of file document.hpp.
Referenced by render_trampoline().
|
consteval |
Is fn a C-style variadic function (R(…, ...))?
C++26 reflection has no ellipsis/variadic predicate, so this reads the ellipsis back out of the implementation's type spelling — acceptable because it only gates a build-time error path (a variadic virtual with no bind_flat), never generated code. A concrete function type's display never contains ... for any other reason (all its parameter types are already instantiated).
Definition at line 82 of file document.hpp.
Referenced by render_trampoline().
|
consteval |
The trailing cv / ref-qualifier / noexcept tokens of a member function fn, in grammatical order (" const & noexcept"), each with a leading space.
Definition at line 89 of file document.hpp.
Referenced by render_trampoline().
|
consteval |
The trampoline_for<type> specialization pointing at type's generated struct.
Definition at line 164 of file document.hpp.
References cpp_qualified_name(), generated_namespace, and trampoline_ident().
Referenced by welder::rods::trampolines::document::add().
|
consteval |
Render the trampoline struct for welded virtual type type — one override per overridable virtual, each splicing the base's own reflected return/parameter types and forwarding to Python via WELDER_PY_OVERRIDE_AS (the slot-reflection form, so overloaded virtuals dispatch correctly).
| type | a reflection of the welded virtual type. |
Definition at line 115 of file document.hpp.
References cpp_qualified_name(), int_string(), is_c_variadic(), welder::rods::python::overridable_virtuals(), qualifier_tokens(), and trampoline_ident().
Referenced by welder::rods::trampolines::document::add().
|
consteval |
A collision-free identifier for type's generated trampoline: its qualified name with :: folded to _ (geometry::Point → geometry_Point_trampoline).
Definition at line 64 of file document.hpp.
Referenced by render_registration(), and render_trampoline().
|
inlineconstexpr |
The namespace the generated trampoline structs are emitted into (fully qualified).
Definition at line 105 of file document.hpp.
Referenced by render_registration().