welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::carriages::basic_carriage< Resolution > Struct Template Reference

A carriage: welder's reflection-driven traversal, parameterized on a Resolution (which markers it obeys). More...

#include <welder/carriage.hpp>

Static Public Member Functions

template<rod B, class E, class Style = naming::none>
static auto bind_enum (typename B::module_type &m, const char *name=nullptr)
 Reflect over enum E and register it via rod B onto module m.
template<rod B, class T, std::meta::info Decl, auto Bases>
static auto make_class_of (typename B::module_type &m, const char *cls_name, const char *doc)
 Call the rod's class-creation primitive, preferring the extended declaring-entity-aware form when the rod provides one.
template<rod B, class T, class Style = naming::none, std::meta::info Decl = std::meta::info{}>
static auto bind_type (typename B::module_type &m, const char *name=nullptr)
 Reflect over T and register it via rod B onto module m.
template<rod B, class T, class Style = naming::none, std::meta::info Decl = std::meta::info{}>
static void predeclare_type (typename B::module_type &m, const char *name=nullptr)
 Phase 1 of the two-phase sweep: register T's NAME only (create the class handle via make_class_of, then discard it — it lives in scope.attr(name)), WITHOUT filling its interior.
template<rod B, class T, class Style = naming::none, std::meta::info Decl = std::meta::info{}>
static void fill_type (typename B::module_type &m, const char *name=nullptr)
 Phase 3 of the two-phase sweep: RETRIEVE T's predeclared handle (via the rod's reopen_class) and fill its interior — nested types, constructors, members, methods, operators — exactly as bind_type's tail does.
template<rod B, std::meta::info Fn, class Style = naming::none>
static auto bind_function (typename B::module_type &m, const char *name=nullptr)
 Register free function Fn — with its participating overload siblings — as a module-level function of m.
template<rod B, std::meta::info Var, class Style = naming::none>
static auto bind_variable (typename B::module_type &m, const char *name=nullptr)
 Register a single namespace variable Var as an attribute of m.
template<rod B, std::meta::info Ns, class Style = naming::none>
static void bind_namespace (typename B::module_type &m)
 Reflect over a whole namespace Ns and expose its members on module m.
template<rod B, std::meta::info Ns, class Style = naming::none>
static B::module_type bind_namespace_as_submodule (typename B::module_type &m, const char *name=nullptr)
 Define a submodule of m and bind namespace Ns into it.
template<rod B, std::meta::info Ns, class Style = naming::none, class Pre, class Post>
static void build_module (typename B::module_type &m, Pre pre, Post post)
 Fill an existing module out of top-level namespace Ns: pre hook, bind the namespace, post hook.

Static Private Member Functions

template<rod B, std::meta::info BoundInto, std::meta::info Src, class Style, class Cls>
static void bind_members (Cls &cls)
 Flatten the eligible data members, methods and operators of Src onto the class handle cls (a handle for a type deriving from Src) — public ones, plus protected ones whose access is admitted (see detail::member_access_admitted; private never binds).
template<rod B, class E, class Style, class EnumHandle>
static void emit_enumerators (EnumHandle &e)
 The per-enumerator walk shared by bind_enum and bind_nested_enum: each enumerator resolves like a data member (the enum's policy + its own marks) and is emitted through the rod's add_enumerator.
template<rod B, class E, class Style>
static std::vector< welder::detail::enumerator_doccollect_enum_docs ()
 Gather the documented, participating enumerators of E as welder::detail::enumerator_doc entries, in declaration order, to fold into the enum's class docstring (an welder::detail::enum_doc).
template<rod B, class T, class Style, class Cls>
static void bind_class_interior (typename B::module_type &m, Cls &cls)
 Everything a class binding contains beyond the class handle itself — shared by bind_type (a module-scope class) and bind_nested_type (a class-scoped one).
template<rod B, class T, class Style, class Cls>
static void bind_properties (Cls &cls)
 Emit T's method-backed properties: every accessor-marked member function (own + flattened bases', see detail::collect_accessors), shape-validated and paired into one detail::property_entry per property name by detail::property_entries — the getter authoritative, the setter optional (absent = read-only).
template<rod B, class T, class Cls>
static void bind_operators (Cls &cls)
 Emit T's operators: member ones (own + flattened bases') and the anchored free operators** of T's enclosing namespace, combined per (operator, arity) slot (detail::operator_entries / operator_slot_set) so a one-value-per-slot backend (the Lua rods) receives each slot's complete overload set in one call — a free operator+ and a member operator+ can never clobber each other, and a flattened base's operator now shares its slot with the derived type's instead of being overwritten.
template<rod B, std::meta::info Outer, class Style, class Cls>
static void bind_nested_types (typename B::module_type &m, Cls &cls)
 Register the participating member types of Outer onto its class handle cls — the nested-class / nested-enum walk.
template<rod B, class T, class Style, std::meta::info Decl = std::meta::info{}, class OuterCls>
static void bind_nested_type (typename B::module_type &m, OuterCls &outer, const char *name=nullptr)
 Register nested class T onto the class handle of its enclosing type — bind_type's class-scope sibling.
template<rod B, class E, class Style, class OuterCls>
static void bind_nested_enum (typename B::module_type &m, OuterCls &outer, const char *name=nullptr)
 Register nested enum E onto the class handle of its enclosing type — bind_enum's class-scope sibling (see bind_nested_type for the shared rationale; the fallback for a rod without make_nested_enum is the module-scope make_enum).
template<rod B, class T, std::meta::info Decl, auto Bases, class OuterCls>
static auto make_nested_class_of (typename B::module_type &m, OuterCls &outer, const char *cls_name, const char *doc)
 Call the rod's nested-class primitive when it declares one, else fall back to the module-scope factory (flat placement).
template<rod B, class E>
static auto make_enum_of (typename B::module_type &m, const char *name, const welder::detail::enum_doc &ed)
 Create the module-scope enum handle for E, folding its enumerator docs into the class docstring where the backend supports it.
template<rod B, class E, class OuterCls>
static auto make_nested_enum_of (typename B::module_type &m, OuterCls &outer, const char *name, const welder::detail::enum_doc &ed)
 make_nested_class_of's enum counterpart: the rod's make_nested_enum when present, else the module-scope make_enum — each preferring the extended enum-doc-folding form over the legacy summary-only one, exactly like make_enum_of.

Detailed Description

template<resolution Resolution>
struct welder::carriages::basic_carriage< Resolution >

A carriage: welder's reflection-driven traversal, parameterized on a Resolution (which markers it obeys).

In welding, the carriage (or tractor) is the mechanism that drives the torch — fed by the rod — steadily along the joint. Here it is the entity that walks a reflected type or namespace and drives a welder::rod's emission primitives along it: it owns all the traversal and emission orchestration (base flattening, the bindability gate, name resolution, sessions), delegating only the which participates decisions to Resolution and the framework-specific emission to the rod. It is a stateless policy struct of static member templates, each parameterized on the rod B and the name style Style.

Two are aliased for welder::welder's Carriage argument (defaulted to welder::stitch_welding_carriage): the marker-directed stitch carriage and the greedy tack carriage (welder::tack_welding_carriage). A user may inject either, or a bespoke basic_carriage<CustomResolution> — the seam is deliberately open. The members cross-reference each other (a namespace's class members bind via bind_type, a nested namespace recurses via bind_namespace), so a replacement is expected to be a coherent whole rather than a partial override.

Template Parameters
Resolutionthe resolution policy (a welder::resolution): marker_resolution or greedy_resolution, or a bespoke one.

Definition at line 468 of file carriage.hpp.

Member Function Documentation

◆ bind_class_interior()

template<resolution Resolution>
template<rod B, class T, class Style, class Cls>
void welder::carriages::basic_carriage< Resolution >::bind_class_interior ( typename B::module_type & m,
Cls & cls )
inlinestaticprivate

Everything a class binding contains beyond the class handle itself — shared by bind_type (a module-scope class) and bind_nested_type (a class-scoped one).

Order matters: nested member types register first — a rod places them on the class handle just created, and pybind11 converts a later constructor/method default argument at registration time, so a nested enum a default argument names must already exist. Then the constructor set (with the no-constructor-left fail-safe), then data members / methods / operators (bind_members).

Template Parameters
Bthe rod.
Tthe type whose binding to fill.
Stylethe name style.
Parameters
mthe module handle (rods without nested placement fall back to it).
clsthe class handle make_class/make_nested_class created.

Definition at line 658 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_type(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_type(), and welder::carriages::basic_carriage< carriages::marker_resolution >::fill_type().

◆ bind_enum()

template<resolution Resolution>
template<rod B, class E, class Style = naming::none>
auto welder::carriages::basic_carriage< Resolution >::bind_enum ( typename B::module_type & m,
const char * name = nullptr )
inlinestatic

Reflect over enum E and register it via rod B onto module m.

Emits its docstring, then each enumerator that resolves as bound (an enumerator honors the enum's policy and its own exclude/include marks, exactly like a data member). finish_enum lets the backend apply a whole-enum finalizer — e.g. exporting an unscoped enum's values into the enclosing scope, mirroring C++.

Template Parameters
Bthe rod.
Ethe enum type.
Parameters
mthe module handle to register onto.
namethe target name (used verbatim, beating any weld_as), or nullptr to resolve E's weld_as/styled name.
Returns
the rod's enum handle.

Definition at line 1156 of file carriage.hpp.

◆ bind_function()

template<resolution Resolution>
template<rod B, std::meta::info Fn, class Style = naming::none>
auto welder::carriages::basic_carriage< Resolution >::bind_function ( typename B::module_type & m,
const char * name = nullptr )
inlinestatic

Register free function Fn — with its participating overload siblings — as a module-level function of m.

The semi-manual leaf: gate then emit one name, without walking a namespace. Fn (which resolves the group's target name, and is welded even if its own marks would resolve it out — the explicit call is the stronger statement of intent) must be admitted by Resolution for B's language; its participating same-name siblings join the group, keeping the call consistent with the namespace walk on every rod (a one-value-per-name framework registers the complete set). Every group member's signature runs the bindability gate.

Template Parameters
Bthe rod.
Fna reflection of the free function.
Parameters
mthe module handle to register onto.
namethe target name (used verbatim, beating any weld_as), or nullptr to resolve Fn's weld_as/styled name.

Definition at line 1346 of file carriage.hpp.

◆ bind_members()

template<resolution Resolution>
template<rod B, std::meta::info BoundInto, std::meta::info Src, class Style, class Cls>
void welder::carriages::basic_carriage< Resolution >::bind_members ( Cls & cls)
inlinestaticprivate

Flatten the eligible data members, methods and operators of Src onto the class handle cls (a handle for a type deriving from Src) — public ones, plus protected ones whose access is admitted (see detail::member_access_admitted; private never binds).

A base that Resolution treats as native is skipped here (it binds as a base of the class handle); the rest are recursed first so that, on a name clash, the member declared closer to the derived type wins. Constructors are never flattened (the derived type provides its own).

Template Parameters
Bthe rod.
BoundIntothe welded type whose class handle receives the members — held fixed through the flattening recursion, and handed to the resolution hooks as their bound-into context.
Srca reflection of the (base or derived) type whose members to flatten.
Stylethe name style each member's name flows through.
Clsthe rod's class-handle type (deduced).
Parameters
clsthe class handle to register onto.

Definition at line 491 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_class_interior().

◆ bind_namespace()

template<resolution Resolution>
template<rod B, std::meta::info Ns, class Style = naming::none>
void welder::carriages::basic_carriage< Resolution >::bind_namespace ( typename B::module_type & m)
inlinestatic

Reflect over a whole namespace Ns and expose its members on module m.

Resolution decides what participates (marker-directed under marker_resolution, greedy under greedy_resolution); classes bind via bind_type(), free functions and namespace variables become module attributes, and a nested namespace holding participating content becomes a submodule (recursed under its own policy). Members are visited in declaration order.

Template Parameters
Bthe rod.
Nsa reflection of the namespace.
Parameters
mthe module handle to fill.

Definition at line 1429 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace_as_submodule(), and welder::carriages::basic_carriage< carriages::marker_resolution >::build_module().

◆ bind_namespace_as_submodule()

template<resolution Resolution>
template<rod B, std::meta::info Ns, class Style = naming::none>
B::module_type welder::carriages::basic_carriage< Resolution >::bind_namespace_as_submodule ( typename B::module_type & m,
const char * name = nullptr )
inlinestatic

Define a submodule of m and bind namespace Ns into it.

Template Parameters
Bthe rod.
Nsa reflection of the namespace.
Parameters
mthe parent module handle.
namethe submodule name (verbatim), or nullptr to resolve Ns's styled/weld_as name.
Returns
the new submodule handle.

Definition at line 1672 of file carriage.hpp.

◆ bind_nested_enum()

template<resolution Resolution>
template<rod B, class E, class Style, class OuterCls>
void welder::carriages::basic_carriage< Resolution >::bind_nested_enum ( typename B::module_type & m,
OuterCls & outer,
const char * name = nullptr )
inlinestaticprivate

Register nested enum E onto the class handle of its enclosing type — bind_enum's class-scope sibling (see bind_nested_type for the shared rationale; the fallback for a rod without make_nested_enum is the module-scope make_enum).

Template Parameters
Bthe rod.
Ethe nested enum type.
Stylethe name style.
Parameters
mthe module handle (the flat-placement fallback scope).
outerthe enclosing type's class handle.
namethe bound name (an alias-resolved override), or nullptr to resolve E's weld_as/styled name.

Definition at line 1035 of file carriage.hpp.

◆ bind_nested_type()

template<resolution Resolution>
template<rod B, class T, class Style, std::meta::info Decl = std::meta::info{}, class OuterCls>
void welder::carriages::basic_carriage< Resolution >::bind_nested_type ( typename B::module_type & m,
OuterCls & outer,
const char * name = nullptr )
inlinestaticprivate

Register nested class T onto the class handle of its enclosing type — bind_type's class-scope sibling.

Same interior (constructors, fail-safes, members, its own nested types — so nesting recurses), differing only in where the class handle is created: a rod implementing the optional make_nested_class places the new class under outer (the Python rods pass the enclosing class as the registration scope, yielding module.Outer.Inner); one that doesn't falls back to the module-scope make_class — a flat sibling under its usual resolved name, so two outers' same-named nested types then collide (rename with weld_as, or implement the hook).

No participates assert here: participation was the caller's member resolution (a nested type needs no weld).

Template Parameters
Bthe rod.
Tthe nested class type.
Stylethe name style.
Declthe declaring entity when it differs from ^^T — the MEMBER ALIAS a type was welded through (the alias is the one spellable name an aliased specialization has, which the text-emitting rods need); a null reflection for the declared-nested route.
Parameters
mthe module handle (the flat-placement fallback scope).
outerthe enclosing type's class handle.
namethe bound name (an alias-resolved override), or nullptr to resolve T's weld_as/styled name.

Definition at line 998 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_types().

◆ bind_nested_types()

template<resolution Resolution>
template<rod B, std::meta::info Outer, class Style, class Cls>
void welder::carriages::basic_carriage< Resolution >::bind_nested_types ( typename B::module_type & m,
Cls & cls )
inlinestaticprivate

Register the participating member types of Outer onto its class handle cls — the nested-class / nested-enum walk.

A nested type resolves like any other class member — the outer's policy plus the type's own exclude/include/only marks (class_member_participates), with the usual access admission — never via its own weld: nested types are interface helpers of their enclosing type, and the enclosing weld is the discovery marker. Deliberately skipped:

  • member type aliases (binding one would re-register its target; the alias-welding route is namespace-scope only);
  • unions (is_class_type excludes them) — unions never bind anywhere in welder (reading an inactive member is UB; use std::variant), so a nested one is skipped and any member using it fails the gate with the union diagnostic;
  • unnamed types (there is nothing to name them by — bind the member* of that type or exclude it), and incomplete member types (nothing to register; a use of one also fails the gate);
  • a flattened base's nested types: a nested type registers exactly once, with its DECLARING class — two derived types flattening one mixin would otherwise register it twice (a framework load error). A flattened signature naming one therefore fails the gate until the declaring base is welded (or the member trusted/excluded).
Template Parameters
Bthe rod.
Outerthe enclosing (welded) type being bound.
Stylethe name style.
Parameters
mthe module handle (the flat-placement fallback scope).
clsthe outer type's class handle.

Definition at line 892 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_class_interior().

◆ bind_operators()

template<resolution Resolution>
template<rod B, class T, class Cls>
void welder::carriages::basic_carriage< Resolution >::bind_operators ( Cls & cls)
inlinestaticprivate

Emit T's operators: member ones (own + flattened bases') and the anchored free operators** of T's enclosing namespace, combined per (operator, arity) slot (detail::operator_entries / operator_slot_set) so a one-value-per-slot backend (the Lua rods) receives each slot's complete overload set in one call — a free operator+ and a member operator+ can never clobber each other, and a flattened base's operator now shares its slot with the derived type's instead of being overwritten.

Three routes out of the combined entry list:

  • a spaceship group (operator<=>, member or free) never binds directly — it reaches the rod as add_comparisons, which synthesizes the four relational slots via rewritten expressions (a < b), skipping any slot an explicit participating operator already covers (covered_comparison_slots); only the operand types face the gate (the std::*_ordering return never crosses);
  • the free ostream inserter (operator<<(std::ostream&, T)) becomes the rod's stringifier (__str__ / __tostring) via add_stringifier — collected separately, so its std::ostream& never faces the gate;
  • every other slot goes to add_operator when the rod exposes it (special_method_name on the slot's leader), each entry gated whole.
Template Parameters
Bthe rod.
Tthe welded type.
Parameters
clsthe class handle.

Definition at line 813 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_class_interior().

◆ bind_properties()

template<resolution Resolution>
template<rod B, class T, class Style, class Cls>
void welder::carriages::basic_carriage< Resolution >::bind_properties ( Cls & cls)
inlinestaticprivate

Emit T's method-backed properties: every accessor-marked member function (own + flattened bases', see detail::collect_accessors), shape-validated and paired into one detail::property_entry per property name by detail::property_entries — the getter authoritative, the setter optional (absent = read-only).

Each half is gated for bindability like any callable; the resolved name (explicit mark name verbatim, else the styled-then-stripped identifier) is computed here — the driver owns property naming, like class/enum names — and handed to the rod's add_property<T, Getter, Setter> hook.

Template Parameters
Bthe rod.
Tthe welded type.
Stylethe name style.
Parameters
clsthe class handle.

Definition at line 770 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_class_interior().

◆ bind_type()

template<resolution Resolution>
template<rod B, class T, class Style = naming::none, std::meta::info Decl = std::meta::info{}>
auto welder::carriages::basic_carriage< Resolution >::bind_type ( typename B::module_type & m,
const char * name = nullptr )
inlinestatic

Reflect over T and register it via rod B onto module m.

Emits:

  • native inheritance from T's native ancestors (per Resolution; each a base of the class handle — bind those bases separately, before T);
  • T's own nested member types (classes + enums, recursively) that resolve as bound — like any member, under T's policy + their own marks, no weld of their own (bind_nested_types); a rod with the optional make_nested_class/make_nested_enum primitives places them under T's binding (Python: module.T.Inner), others fall back to flat module-scope placement;
  • the default constructor (if any), each public non-copy/move constructor, and — for a baseless aggregate whose fields all bind — a synthesized field constructor;
  • data members / methods / operators that resolve as bound (public, plus protected where detail::member_access_admitted admits them — see policy::weld_protected; private never), plus the eligible members of every flattened (non-native) public base.
Template Parameters
Bthe rod.
Tthe type to bind.
Declthe declaring entity when it differs from ^^T — the namespace-scope alias a class-template specialization was welded through (set by bind_namespace's alias branch, which has already resolved participation); a null reflection for the direct route.
Parameters
mthe module handle to register onto.
namethe target name (used verbatim, beating any weld_as), or nullptr to resolve T's weld_as/styled name.
Returns
the rod's class handle, so callers can chain further registrations.

Definition at line 1239 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().

◆ bind_variable()

template<resolution Resolution>
template<rod B, std::meta::info Var, class Style = naming::none>
auto welder::carriages::basic_carriage< Resolution >::bind_variable ( typename B::module_type & m,
const char * name = nullptr )
inlinestatic

Register a single namespace variable Var as an attribute of m.

The semi-manual leaf for a global/constant: a const/constexpr Var becomes a value snapshot, a mutable one a live get/set property (backend-dependent). Var must be admitted by Resolution for B's language; its type runs the bindability gate. The emission runs inside its own per-module session (opened and finalized here), so it composes with a later namespace/module weld onto the same handle.

Template Parameters
Bthe rod.
Vara reflection of the namespace-scope variable.
Parameters
mthe module handle to register onto.
namethe target name (used verbatim, beating any weld_as), or nullptr to resolve Var's weld_as/styled name.

Definition at line 1386 of file carriage.hpp.

◆ build_module()

template<resolution Resolution>
template<rod B, std::meta::info Ns, class Style = naming::none, class Pre, class Post>
void welder::carriages::basic_carriage< Resolution >::build_module ( typename B::module_type & m,
Pre pre,
Post post )
inlinestatic

Fill an existing module out of top-level namespace Ns: pre hook, bind the namespace, post hook.

Template Parameters
Bthe rod.
Nsa reflection of the (asserted top-level) namespace; its name is meant to be the module name.
Stylethe name style each generated name flows through.
Prethe pre-hook callable type.
Postthe post-hook callable type.
Parameters
mthe module handle to fill.
preinvoked with m before the namespace is bound.
postinvoked with m after the namespace is bound.

Definition at line 1699 of file carriage.hpp.

◆ collect_enum_docs()

template<resolution Resolution>
template<rod B, class E, class Style>
std::vector< welder::detail::enumerator_doc > welder::carriages::basic_carriage< Resolution >::collect_enum_docs ( )
inlinestaticprivate

Gather the documented, participating enumerators of E as welder::detail::enumerator_doc entries, in declaration order, to fold into the enum's class docstring (an welder::detail::enum_doc).

An enum has no per-enumerator docstring slot the Python stub tools surface, so a [[=welder::doc]] on an enumerator rides in the class docstring's Attributes section instead — the one place the stub generators carry it into the .pyi. This mirrors emit_enumerators' participation test exactly (an excluded enumerator neither binds nor is documented) and uses the same styled name the stub shows, so the section describes precisely the enumerators the binding exposes. A backend that folds it (the Python rods) takes the extended make_enum; one that does not (the Lua/luacats rods) sees only the summary via the legacy make_enum — see make_enum_of.

Template Parameters
Bthe rod.
Ethe enum type.
Stylethe name style.

Definition at line 625 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_enum(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_enum().

◆ emit_enumerators()

template<resolution Resolution>
template<rod B, class E, class Style, class EnumHandle>
void welder::carriages::basic_carriage< Resolution >::emit_enumerators ( EnumHandle & e)
inlinestaticprivate

The per-enumerator walk shared by bind_enum and bind_nested_enum: each enumerator resolves like a data member (the enum's policy + its own marks) and is emitted through the rod's add_enumerator.

Template Parameters
Bthe rod.
Ethe enum type.
Stylethe name style.
Parameters
ethe rod's enum handle.

Definition at line 598 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_enum(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_enum().

◆ fill_type()

template<resolution Resolution>
template<rod B, class T, class Style = naming::none, std::meta::info Decl = std::meta::info{}>
void welder::carriages::basic_carriage< Resolution >::fill_type ( typename B::module_type & m,
const char * name = nullptr )
inlinestatic

Phase 3 of the two-phase sweep: RETRIEVE T's predeclared handle (via the rod's reopen_class) and fill its interior — nested types, constructors, members, methods, operators — exactly as bind_type's tail does.

Runs after phase 1 (all names) and phase 2 (all opaque containers), so every container-typed member/signature resolves to a registered Python name.

See also
predeclare_type
bind_namespace

Definition at line 1319 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().

◆ make_class_of()

template<resolution Resolution>
template<rod B, class T, std::meta::info Decl, auto Bases>
auto welder::carriages::basic_carriage< Resolution >::make_class_of ( typename B::module_type & m,
const char * cls_name,
const char * doc )
inlinestatic

Call the rod's class-creation primitive, preferring the extended declaring-entity-aware form when the rod provides one.

Decl is the entity the type was declared through^^T, or the namespace-scope alias welding a class-template specialization. A helper (not a lambda in bind_type): std::meta::info is consteval-only, so a lambda referencing such a constexpr local escalates to consteval (P2564) and cannot take the runtime module handle; template parameters do not.

Template Parameters
Bthe rod.
Tthe type to bind.
Declthe declaring entity handed to a spelling-aware rod.
Basesthe native base reflections.
Parameters
mthe module handle to register onto.
cls_namethe resolved target-language name.
docthe class docstring, or nullptr.
Returns
the rod's class handle.

Definition at line 1192 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::make_nested_class_of().

◆ make_enum_of()

template<resolution Resolution>
template<rod B, class E>
auto welder::carriages::basic_carriage< Resolution >::make_enum_of ( typename B::module_type & m,
const char * name,
const welder::detail::enum_doc & ed )
inlinestaticprivate

Create the module-scope enum handle for E, folding its enumerator docs into the class docstring where the backend supports it.

A doc-folding rod (the Python rods) declares the extended make_enum<E>(m, name, const enum_doc&) — its DocStyle renders the summary plus an Attributes section listing ed's enumerators. A rod that has no such surface (the Lua rods; luacats, which documents enumerators through its own ---@field emission) keeps the legacy make_enum<E>(m, name, summary), which sees only ed's summary.

Template Parameters
Bthe rod.
Ethe enum type.
Parameters
mthe module handle.
namethe resolved target-language name.
edthe enum docstring pieces (summary + documented enumerators).
Returns
the rod's enum handle for E.

Definition at line 1106 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_enum(), and welder::carriages::basic_carriage< carriages::marker_resolution >::make_nested_enum_of().

◆ make_nested_class_of()

template<resolution Resolution>
template<rod B, class T, std::meta::info Decl, auto Bases, class OuterCls>
auto welder::carriages::basic_carriage< Resolution >::make_nested_class_of ( typename B::module_type & m,
OuterCls & outer,
const char * cls_name,
const char * doc )
inlinestaticprivate

Call the rod's nested-class primitive when it declares one, else fall back to the module-scope factory (flat placement).

A static helper, not a lambda in bind_nested_type, for the same P2564 reason as make_class_of.

A spelling-aware rod may declare the extended, declaring-entity-aware form make_nested_class<T, Decl, Bases> (preferred when Decl is set — the member alias an unnameable specialization was welded through); the flat fallback likewise threads Decl into make_class_of, so a text-emitting rod's extended make_class receives it too.

Template Parameters
Bthe rod.
Tthe nested class type.
Declthe declaring member alias, or a null reflection.
Basesthe native base reflections.
Parameters
mthe module handle.
outerthe enclosing type's class handle.
cls_namethe resolved target-language name.
docthe class docstring, or nullptr.
Returns
the rod's class handle for T.

Definition at line 1067 of file carriage.hpp.

◆ make_nested_enum_of()

template<resolution Resolution>
template<rod B, class E, class OuterCls>
auto welder::carriages::basic_carriage< Resolution >::make_nested_enum_of ( typename B::module_type & m,
OuterCls & outer,
const char * name,
const welder::detail::enum_doc & ed )
inlinestaticprivate

make_nested_class_of's enum counterpart: the rod's make_nested_enum when present, else the module-scope make_enum — each preferring the extended enum-doc-folding form over the legacy summary-only one, exactly like make_enum_of.

Template Parameters
Bthe rod.
Ethe nested enum type.
Parameters
mthe module handle.
outerthe enclosing type's class handle.
namethe resolved target-language name.
edthe enum docstring pieces (summary + documented enumerators).
Returns
the rod's enum handle for E.

Definition at line 1126 of file carriage.hpp.

Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_enum().

◆ predeclare_type()

template<resolution Resolution>
template<rod B, class T, class Style = naming::none, std::meta::info Decl = std::meta::info{}>
void welder::carriages::basic_carriage< Resolution >::predeclare_type ( typename B::module_type & m,
const char * name = nullptr )
inlinestatic

Phase 1 of the two-phase sweep: register T's NAME only (create the class handle via make_class_of, then discard it — it lives in scope.attr(name)), WITHOUT filling its interior.

Run for every welded class before any opaque container or member signature is bound, so the framework never spells T's raw C++ name in a docstring (a def-time-ordering artifact stubgen rejects). The handle is retrieved and filled later by fill_type. Only rods that opt into the two-phase sweep (welder::two_phase_rod) reach this; Decl and the gates mirror bind_type.

See also
bind_namespace

Definition at line 1294 of file carriage.hpp.


The documentation for this struct was generated from the following file: