|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
Namespaces | |
| namespace | carriages |
| namespace | detail |
| The stored forms of the annotation vocabulary. | |
| namespace | diag |
| namespace | mark |
| The bare mark annotation objects — use directly or call to scope by language. | |
| namespace | naming |
| namespace | policy |
| The policy annotation values. | |
| namespace | rods |
| namespace | rv |
| The return-value policy values, the user-facing spelling of rv_kind. | |
Classes | |
| struct | bind_flat_spec |
| The stored form of a bind_flat mark (a plain tag — it carries no state). More... | |
| struct | welded_registration |
| The default registration oracle of the bindability gate: a program-defined class/enum type counts as registered iff it is welded for the language. More... | |
| struct | welder |
| welder's binding entry point, parameterized on a rod. More... | |
Concepts | |
| concept | caster_oracle |
| The one bindability fact a backend must provide: can it natively convert a type without welder registering it? | |
| concept | doc_style |
| A style folds a welder::detail::function_doc into one docstring, and a welder::detail::enum_doc (an enum's summary plus its enumerator docs) into the enum's class docstring. | |
| concept | resolution |
| The contract a resolution — the carriage's which-participates policy — must satisfy to be injected as welder::carriages::basic_carriage's Resolution argument. | |
| concept | rod |
| The contract a rod (a welder backend, welder::rods::…::rod) must satisfy to plug into the generic driver. | |
| concept | rod_binds_containers |
| Does rod B implement the optional bind_container hook (i.e. | |
| concept | two_phase_rod |
| Does rod B opt into the driver's two-phase namespace sweep — register every welded type's NAME, bind the opaque containers that use them, then fill members? | |
Typedefs | |
| using | size_type = decltype(sizeof(0)) |
| std::size_t named without a standard-library include, keeping this vocabulary header std-free (see the file note). | |
| using | stitch_welding_carriage = carriages::basic_carriage<carriages::marker_resolution> |
| The stitch-welding carriage (the default): binds only where welder's weld / policy / marks direct — intermittent, marker-driven, like a stitch weld. | |
| using | tack_welding_carriage |
| The tack-welding carriage: binds an unmarked library greedily — every reflectable type / function / global, namespaces recursed, bases flattened — ignoring the weld markers, while still enforcing the bindability gate. | |
| using | carriage = stitch_welding_carriage |
| The default carriage — an alias for welder::stitch_welding_carriage. | |
Enumerations | |
| enum class | policy_kind : unsigned char { automatic , opt_in } |
| How greedily a type's members are reflected for binding. More... | |
| enum class | accessor_role : unsigned char { getter , setter } |
| Which half of a property a marked accessor function supplies. More... | |
| enum class | rv_kind : unsigned char { automatic , automatic_reference , take_ownership , copy , move , reference , reference_internal , none } |
| How a bound callable's returned object is owned/converted in the target language — welder's backend-neutral spelling of the return-value policy. More... | |
| enum class | container_kind : unsigned char { sequence , map , fixed_sequence } |
| Which opaque binder a reference-bound container uses. More... | |
| enum class | lang : unsigned char { py , lua } |
| The target languages welder ships rods for — but not the whole value space. More... | |
| enum class | ent_kind { class_ , enum_ , enumerator , method , static_method , function , field , variable , submodule } |
| The nameable entity kinds welder distinguishes, one per name-style hook — picked by the driver/rod so name_of calls the right transform. More... | |
Functions | |
| consteval unsigned | lang_bit (lang l) |
| The single-language bit for l within a language mask. | |
| template<class... Ls> | |
| consteval unsigned | lang_mask (Ls... ls) |
| The mask naming the languages ls. | |
| template<size_type N> | |
| consteval detail::doc_spec< N > | doc (const char(&s)[N]) |
| Attach a docstring to a namespace, class, function, or function parameter. | |
| template<size_type N> | |
| consteval detail::return_doc_spec< N > | returns (const char(&s)[N]) |
| Document a function's return value. | |
| template<size_type N, size_type M> | |
| consteval detail::tparam_spec< N, M > | tparam (const char(&name)[N], const char(&text)[M]) |
| Document a template parameter (repeatable, ordered). | |
| template<size_type N> | |
| consteval detail::weld_as_spec< N > | weld_as (const char(&s)[N]) |
| Force s as the target name in every welded language. | |
| template<class... Args> | |
| consteval auto | weld_as (Args &&... args) |
| Force a verbatim target name, optionally scoped to one or more languages. | |
| template<class... Args> | |
| consteval detail::return_policy_spec | return_policy (Args... args) |
| Force a return-value policy on a callable, optionally scoped to one or more languages. | |
| consteval detail::keep_alive_spec | keep_alive (unsigned nurse, unsigned patient) |
| Keep the call entity patient alive at least until nurse is collected. | |
| template<caster_oracle B, class T, lang L, class Reg = welded_registration> | |
| consteval bool | bindable () |
| Is T bindable to language L under backend B? | |
| template<caster_oracle B, class T, lang L, class Reg = welded_registration> | |
| consteval void | assert_bindable () |
| Hard error the instant welder would bind an unbindable type. | |
| template<caster_oracle B, std::meta::info Fn, lang L, class Reg = welded_registration> | |
| consteval void | assert_signature_bindable () |
| Assert every parameter type and the (non-void) return type of Fn binds. | |
| template<caster_oracle B, std::meta::info Member, lang L, class Reg = welded_registration> | |
| consteval void | assert_member_bindable () |
| Assert the type of a data member / namespace variable binds, unless trusted. | |
| template<caster_oracle B, std::meta::info Fn, lang L, class Reg = welded_registration> | |
| consteval void | assert_callable_bindable () |
| Assert a function/method/operator/constructor signature binds, unless trusted. | |
| template<caster_oracle B, std::meta::info Fn, lang L, class Reg = welded_registration> | |
| consteval void | assert_setter_bindable () |
| Assert a property setter's parameter binds, unless trusted — the write half of the getter/setter machinery. | |
| template<caster_oracle B, std::meta::info Fn, std::meta::info Type, lang L, class Reg = welded_registration> | |
| consteval void | assert_operands_bindable () |
| Assert the operand types of an operator<=> overload bind, unless the overload is trusted — the comparison-synthesis gate. | |
| consteval bool | is_nested_type (std::meta::info type) |
| Is type declared at class scope — a nested (member) type? | |
| consteval bool | is_reference_container (std::meta::info type) |
| Is type one of the containers welder can bind by reference (opaquely)? | |
| consteval container_kind | container_kind_of (std::meta::info type) |
| The opaque-binder kind of type. | |
| consteval bool | container_is_contiguous (std::meta::info type) |
| Is type a contiguous sequence — one whose elements live in a single block reachable via .data(), so a scalar element type can be exposed zero-copy through the buffer protocol / an nb::ndarray view? | |
| consteval std::string | cleandoc (std::string_view text) |
| Normalize a docstring the way Python's inspect.cleandoc (PEP 257) does, so a multiline doc/returns can be indented to line up with the surrounding C++ source without that indentation reaching the target language's docstring. | |
| template<std::meta::info Ent, std::meta::info SpecTmpl> | |
| consteval const char * | annotation_text_of () |
| The text of the annotation on Ent whose class template is SpecTmpl, or nullptr if it carries none. | |
| template<std::meta::info Ent> | |
| consteval const char * | doc_of () |
| The doc text on Ent (a class, namespace, function, or parameter), or nullptr. | |
| template<std::meta::info Fn> | |
| consteval const char * | return_doc_of () |
| The returns text on function Fn (documentation of its return value), or nullptr. | |
| template<std::meta::info Ent> | |
| consteval size_type | tparam_count () |
| How many tparam annotations Ent carries. | |
| template<std::meta::info Ent> | |
| consteval auto | tparam_docs () |
| The template-parameter docs declared on Ent via [[=welder::tparam("T","…")]], in annotation order. | |
| template<std::meta::info Fn> | |
| consteval auto | param_docs () |
| The parameter docs of function Fn, in declaration order. | |
| template<std::meta::info Fn, doc_style Style> | |
| std::string | function_docstring () |
| The complete docstring for function Fn under Style. | |
| template<std::meta::info Ent, lang L> | |
| consteval const char * | weld_as_of () |
| The verbatim weld_as name forced on Ent for language L, or nullptr. | |
| template<std::meta::info Ent, lang L, class Style, ent_kind K> | |
| consteval const char * | name_of () |
| The final bound name of Ent (a K-kind entity) for language L under name style Style. | |
| template<std::meta::info Ent, lang L, class Style, ent_kind K> | |
| constexpr const char * | name_of_or (const char *override_) |
| Resolve a bound name with a call-site override: override_ wins verbatim, nullptr falls back to name_of. | |
| consteval bool | weld_mask_admits (unsigned mask, lang L) |
| Does a weld mask admit language L? | |
| consteval bool | welded_for (std::meta::info type, lang L) |
| Is type welded for language L — i.e. | |
| consteval bool | names_template_specialization (std::meta::info mem) |
| Is mem a namespace-scope alias naming a class-template specialization — the one way an instantiation can enter a namespace sweep? | |
| consteval bool | alias_welded_for (std::meta::info mem, lang L) |
| Is the specialization named by alias mem welded for language L — reading the alias's own weld first, the instantiation's (via its template) second? | |
| consteval bool | alias_marks_admissible (std::meta::info mem) |
| May the annotations on alias-declaration mem appear there? | |
| consteval bool | member_alias_marks_admissible (std::meta::info mem) |
| May the annotations on member type-alias mem appear there? | |
| consteval policy_kind | policy_of (std::meta::info type) |
| The reflection policy declared on type, defaulting to automatic. | |
| consteval bool | protected_welded (std::meta::info type, lang L) |
| Does type admit its protected members for language L — i.e. | |
| consteval bool | excluded_for (std::meta::info member, lang L) |
| Does member carry an exclude mark covering language L? | |
| consteval bool | included_for (std::meta::info member, lang L) |
| Does member carry an include mark covering language L? | |
| consteval bool | trusted_for (std::meta::info member, lang L) |
| Does member carry a trust_bindable mark covering language L? | |
| consteval bool | member_no_reassign (std::meta::info member, lang L) |
| Is data member member bound read-only for L by a no_reassign mark? | |
| consteval bool | has_no_reassign_mark (std::meta::info entity) |
| Does entity carry any no_reassign mark at all (any language)? | |
| consteval bool | accessor_marked (std::meta::info member, accessor_role role, lang L) |
| Does member carry a getter/setter mark of role covering L? | |
| consteval bool | is_accessor_for (std::meta::info member, lang L) |
| Does member supply either property half for language L — i.e. | |
| consteval bool | has_accessor_mark (std::meta::info member) |
| Does member carry any getter/setter mark at all (any role, any language)? | |
| consteval std::string | accessor_explicit_name (std::meta::info member, accessor_role role, lang L) |
| The explicit property name an accessor mark of role forces for L, or "" when the name derives from the function's identifier. | |
| consteval rv_kind | return_policy_of (std::meta::info fn, lang L) |
| The return-value policy declared on callable fn for language L. | |
| template<std::meta::info Fn, lang L> | |
| consteval void | validate_return_policy () |
| Reject a return_policy on Fn (for language L) that contradicts Fn's return type. | |
| consteval bool | member_bound (std::meta::info member, lang L, policy_kind pol) |
| The core decision a backend asks for each member: does member bind for language L under policy pol? | |
| consteval std::vector< std::meta::info > | public_bases (std::meta::info type) |
| The types of the public base classes of type. | |
| consteval bool | bound_flat (std::meta::info entity) |
| Does entity (a type or a member function) carry a bind_flat mark? | |
| consteval bool | is_overridable_virtual (std::meta::info member) |
| Is member an overridable virtual — a virtual member function that welder routes through the trampoline? | |
| consteval std::vector< std::meta::info > | overridable_virtuals (std::meta::info type) |
| Every overridable virtual slot of type — the ones welder routes through a trampoline — folding in virtuals inherited from any base. | |
| consteval std::meta::info | virtual_slot (std::meta::info type, std::string_view name, std::meta::info fn_type) |
| The overridable virtual slot of type named name whose function type is fn_type — the hand-written disambiguator for an overloaded virtual. | |
| consteval std::size_t | virtual_slot_count (std::meta::info type) |
| The number of overridable virtual member functions of type, inherited ones included. | |
| consteval bool | has_virtual_methods (std::meta::info type) |
| Does type declare or inherit any overridable virtual method? | |
Variables | |
| constexpr detail::weld_spec | weld {} |
| The weld annotation: declare an entity bound, and for which languages. | |
| template<class T> | |
| constexpr bool | trust_bindable = false |
| The type-level trust customization point: specialize to true to trust T wherever it appears (member, parameter, return, container element, …). | |
| constexpr detail::accessor_spec | getter {accessor_role::getter} |
| Mark a member function as a property getter (const, no parameters). | |
| constexpr detail::accessor_spec | setter {accessor_role::setter} |
| Mark a member function as a property setter (exactly one parameter) — the write half of welder::getter, paired by property name. | |
| template<unsigned char Slot> | |
| constexpr lang | user_lang {static_cast<lang>(16 + Slot)} |
| A user-defined language: the Slot-th identity from the mask's user range (bit 16 + Slot) — for binding a language welder does not ship, without touching welder. | |
| constexpr bind_flat_spec | bind_flat {} |
| Mark a virtual entity as deliberately bound non-overridably. | |
The default carriage — an alias for welder::stitch_welding_carriage.
Definition at line 1730 of file carriage.hpp.
| using welder::size_type = decltype(sizeof(0)) |
std::size_t named without a standard-library include, keeping this vocabulary header std-free (see the file note).
sizeof yields std::size_t by definition, so decltype(sizeof(0)) is that type — this alias just gives it a readable name for the array-length template parameters below.
Definition at line 24 of file annotations.hpp.
The stitch-welding carriage (the default): binds only where welder's weld / policy / marks direct — intermittent, marker-driven, like a stitch weld.
This is welder::welder's default Carriage.
Definition at line 1716 of file carriage.hpp.
The tack-welding carriage: binds an unmarked library greedily — every reflectable type / function / global, namespaces recursed, bases flattened — ignoring the weld markers, while still enforcing the bindability gate.
For consuming a third-party library that carries no welder annotations. Public members only, like the stitch default; to tack a library's protected members too (it cannot carry the policy::weld_protected annotation), use carriages::basic_carriage<carriages::greedy_resolution<true>>.
Definition at line 1726 of file carriage.hpp.
|
strong |
Which half of a property a marked accessor function supplies.
| Enumerator | |
|---|---|
| getter | The function reads the property's value (const, no parameters). |
| setter | The function writes it (exactly one parameter). |
Definition at line 70 of file annotations.hpp.
|
strong |
Which opaque binder a reference-bound container uses.
Definition at line 43 of file containers.hpp.
|
strong |
The nameable entity kinds welder distinguishes, one per name-style hook — picked by the driver/rod so name_of calls the right transform.
Definition at line 320 of file naming.hpp.
|
strong |
The target languages welder ships rods for — but not the whole value space.
A language is a bit index into the unsigned mask the annotation vocabulary stores (lang_bit / lang_mask in <welder/annotations.hpp>), and the value space is deliberately open: these enumerators are the languages welder ships, yet any in-range welder::lang value is a valid language. Indices 0–15 are reserved for welder; an out-of-tree rod binding a language welder doesn't ship mints its identity from the user range (16–31) with welder::user_lang — see the "Extending welder" guide page.
| Enumerator | |
|---|---|
| py | Python (via the pybind11 and nanobind backends). |
| lua | Lua (via the sol2 and LuaBridge3 backends). |
|
strong |
How greedily a type's members are reflected for binding.
| Enumerator | |
|---|---|
| automatic | Reflect every member unless explicitly excluded (default). |
| opt_in | Reflect only members explicitly marked include. |
Definition at line 61 of file annotations.hpp.
|
strong |
How a bound callable's returned object is owned/converted in the target language — welder's backend-neutral spelling of the return-value policy.
The names mirror pybind11's return_value_policy / nanobind's rv_policy (the frameworks that have an explicit knob): a rod translates each to its framework's enumerator. The garbage-collected Lua runtimes (sol2, LuaBridge3) have no such knob — ownership there is decided structurally by the C++ return type (a value → a VM-owned copy/move; a pointer/reference → a non-owning view) — so the Lua rods ignore this at runtime, exactly as they ignore welder::doc. What no rod ignores is a contradiction: a reference-category policy on a by-value return references a temporary, so it is a hard error for every language (see validate_return_policy).
Definition at line 90 of file annotations.hpp.
|
consteval |
The explicit property name an accessor mark of role forces for L, or "" when the name derives from the function's identifier.
The first covering mark with a non-empty name wins (repeat the annotation for a different name per language, like weld_as).
| member | a reflection of the accessor function. |
| role | which property half to read. |
| L | the target language. |
Definition at line 314 of file reflect.hpp.
References lang_bit().
Referenced by welder::detail::property_bound_name(), and welder::detail::property_key().
|
consteval |
Does member carry a getter/setter mark of role covering L?
The stored detail::accessor_spec is deliberately non-templated (see accessor_name_capacity), so this reads off a dynamic reflection — usable inside member_bound and the overload-set selectors, where the member is a plain value.
| member | a reflection of the member function to test. |
| role | which property half to look for. |
| L | the target language. |
Definition at line 276 of file reflect.hpp.
References lang_bit().
Referenced by is_accessor_for(), and welder::detail::property_entries().
|
consteval |
May the annotations on alias-declaration mem appear there?
Only weld and weld_as are meaningful on a namespace-scope alias (they override the template's); every other welder mark — policy, exclude / include / only, trust_bindable, doc / returns / tparam, return_policy, keep_alive — belongs on the class template itself, where it applies to all instantiations, and is diagnosed here so it cannot be silently ignored. Non-welder annotations are not welder's business and pass.
| mem | a reflection of the alias to check. |
Definition at line 92 of file reflect.hpp.
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().
|
consteval |
Is the specialization named by alias mem welded for language L — reading the alias's own weld first, the instantiation's (via its template) second?
A weld on the alias-declaration takes precedence over the template's: it is the more specific declaration, and the opt-in for a third-party template you cannot annotate (using VBuf [[=welder::weld(welder::lang::py)]] = vendor::Buf<int>;). With no alias-level weld, the mark on the class template is read through the instantiation as usual.
| mem | a reflection of the alias (see names_template_specialization). |
| L | the target language. |
Definition at line 74 of file reflect.hpp.
References weld_mask_admits(), and welded_for().
Referenced by welder::carriages::marker_resolution::alias_participates(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().
|
consteval |
The text of the annotation on Ent whose class template is SpecTmpl, or nullptr if it carries none.
Ent / SpecTmpl are template parameters rather than runtime arguments because matching requires splicing the annotation's concrete SpecTmpl<N> type, which must be a constant.
| Ent | a reflection of the entity to read. |
| SpecTmpl | a class template whose specialization has a .text member convertible to a C string (detail::doc_spec, detail::return_doc_spec). |
Definition at line 118 of file doc.hpp.
References cleandoc().
Referenced by doc_of(), and return_doc_of().
|
consteval |
Hard error the instant welder would bind an unbindable type.
The offending type is the template argument of the failing instantiation, so it is named in the diagnostic backtrace.
| B | the rod. |
| T | the type being bound. |
| L | the target language. |
| Reg | the registration oracle (see welder::bindable). |
Definition at line 344 of file bindable.hpp.
References bindable(), and welder::detail::mentions_union().
Referenced by assert_member_bindable(), welder::detail::assert_operands(), welder::detail::assert_params_bindable(), assert_signature_bindable(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().
|
consteval |
Assert a function/method/operator/constructor signature binds, unless trusted.
| B | the rod. |
| Fn | a reflection of the callable. |
| L | the target language. |
Definition at line 434 of file bindable.hpp.
References assert_signature_bindable(), and trusted_for().
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_class_interior(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_function(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_operators(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_properties().
|
consteval |
Assert the type of a data member / namespace variable binds, unless trusted.
| B | the rod. |
| Member | a reflection of the data member or variable. |
| L | the target language. |
Definition at line 422 of file bindable.hpp.
References assert_bindable(), and trusted_for().
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_variable().
|
consteval |
Assert the operand types of an operator<=> overload bind, unless the overload is trusted — the comparison-synthesis gate.
Parameters only, and only those that are not the welded type itself: the ordering return type (std::strong_ordering &co.) deliberately never faces the gate, because it never crosses the language boundary — the rod binds synthesized bool-returning comparisons, not the spaceship itself.
| B | the rod. |
| Fn | a reflection of the spaceship overload. |
| Type | the welded anchor type's reflection. |
| L | the target language. |
Definition at line 497 of file bindable.hpp.
References welder::detail::assert_operands(), and trusted_for().
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_operators().
|
consteval |
Assert a property setter's parameter binds, unless trusted — the write half of the getter/setter machinery.
Parameters only, sharing the rationale of assert_operands_bindable — the property protocol has no slot for a setter's return value, so every rod discards* it (a fluent T& set_x(…) chains in C++ but writes plainly from the target language) — a return type that never crosses the boundary never faces the gate.
| B | the rod. |
| Fn | a reflection of the setter. |
| L | the target language. |
Definition at line 453 of file bindable.hpp.
References welder::detail::assert_params_bindable(), and trusted_for().
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_properties().
|
consteval |
Assert every parameter type and the (non-void) return type of Fn binds.
So the function/method/operator/constructor can round-trip through the target language. A constructor has no return type.
| B | the rod. |
| Fn | a reflection of the callable. |
| L | the target language. |
Definition at line 393 of file bindable.hpp.
References assert_bindable(), and welder::detail::assert_params_bindable().
Referenced by assert_callable_bindable().
|
consteval |
Is T bindable to language L under backend B?
(public spelling.)
| B | the rod. |
| T | the type to test. |
| L | the target language. |
| Reg | the registration oracle: which class/enum types count as registered. Defaults to welder::welded_registration (welded ⇒ registered); the carriage passes its resolution so, e.g., tack welding accepts the types its own greedy pass registers. |
Definition at line 330 of file bindable.hpp.
References welder::detail::bindable().
Referenced by assert_bindable(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_types().
|
consteval |
Does entity (a type or a member function) carry a bind_flat mark?
| entity | a reflection of the type or member to test. |
Definition at line 63 of file virtuals.hpp.
Referenced by welder::rods::nanobind::rod< DocStyle >::_make_class_at(), welder::rods::pybind11::rod< DocStyle >::_make_class_at(), is_overridable_virtual(), welder::rods::trampolines::rod::make_class(), and overridable_virtuals().
|
consteval |
Normalize a docstring the way Python's inspect.cleandoc (PEP 257) does, so a multiline doc/returns can be indented to line up with the surrounding C++ source without that indentation reaching the target language's docstring.
Three steps, matching the Python convention users of the bindings expect:
A single-line docstring is returned unchanged. Tabs are treated as single characters (not expanded to tab stops): indent doc text with spaces, as C++ source is indented generally.
| text | the raw docstring text. |
Definition at line 45 of file doc.hpp.
Referenced by annotation_text_of().
|
consteval |
Is type a contiguous sequence — one whose elements live in a single block reachable via .data(), so a scalar element type can be exposed zero-copy through the buffer protocol / an nb::ndarray view?
Among the reference containers std::vector and std::array qualify (both store their elements in one block reachable via .data()); the maps are not sequences. The buffer/ndarray path is gated on this and an arithmetic (non-bool) or POD element type. (Kept as its own predicate — rather than folding into container_kind — so a future segmented/opaque sequence stays bindable by reference while correctly getting no buffer view.)
| type | a reflection of the container specialization. |
Definition at line 122 of file containers.hpp.
Referenced by welder::rods::nanobind::rod< DocStyle >::_numpy_view(), and welder::rods::pybind11::rod< DocStyle >::bind_container().
|
consteval |
The opaque-binder kind of type.
| type | a reflection of the container specialization. |
Definition at line 103 of file containers.hpp.
References welder::detail::reference_containers(), and sequence.
Referenced by welder::rods::nanobind::rod< DocStyle >::bind_container(), and welder::rods::pybind11::rod< DocStyle >::bind_container().
|
consteval |
Attach a docstring to a namespace, class, function, or function parameter.
Backends surface it in the target language (e.g. a Python __doc__, with parameter docs folded into the function's docstring). Reading the text back is the reflection layer's job (<welder/doc.hpp>).
Usage: [[=welder::doc("Summary line.")]].
| N | the text length (deduced). |
| s | the docstring text. |
Definition at line 641 of file annotations.hpp.
Referenced by welder::rods::nanobind::rod< DocStyle >::_def_erased_field(), welder::rods::nanobind::rod< DocStyle >::_def_function(), welder::rods::pybind11::rod< DocStyle >::_def_function(), welder::rods::nanobind::rod< DocStyle >::_def_operator(), welder::rods::pybind11::rod< DocStyle >::_def_operator(), welder::rods::nanobind::rod< DocStyle >::_make_class(), welder::rods::pybind11::rod< DocStyle >::_make_class(), welder::rods::nanobind::rod< DocStyle >::_make_class_at(), welder::rods::pybind11::rod< DocStyle >::_make_class_at(), welder::rods::nanobind::rod< DocStyle >::add_field(), welder::rods::pybind11::rod< DocStyle >::add_field(), welder::rods::nanobind::rod< DocStyle >::add_property(), welder::rods::pybind11::rod< DocStyle >::add_property(), welder::rods::luacats::document::declare_table(), welder::rods::luacats::rod::generate(), welder::rods::opaque_containers::rod::generate(), welder::rods::trampolines::rod::generate(), welder::rods::luacats::rod::make_class(), welder::rods::nanobind::rod< DocStyle >::make_class(), welder::rods::pybind11::rod< DocStyle >::make_class(), welder::carriages::basic_carriage< carriages::marker_resolution >::make_class_of(), welder::rods::luacats::rod::make_enum(), welder::rods::nanobind::rod< DocStyle >::make_enum(), welder::rods::pybind11::rod< DocStyle >::make_enum(), welder::rods::luacats::rod::make_nested_class(), welder::rods::nanobind::rod< DocStyle >::make_nested_class(), welder::rods::pybind11::rod< DocStyle >::make_nested_class(), welder::rods::sol2::rod::make_nested_class(), welder::carriages::basic_carriage< carriages::marker_resolution >::make_nested_class_of(), welder::rods::luacats::rod::make_nested_enum(), welder::rods::nanobind::rod< DocStyle >::make_nested_enum(), welder::rods::pybind11::rod< DocStyle >::make_nested_enum(), welder::rods::luacats::render_overload_group(), welder::rods::luacats::rod::set_module_doc(), welder::rods::nanobind::rod< DocStyle >::set_module_doc(), and welder::rods::pybind11::rod< DocStyle >::set_module_doc().
|
consteval |
The doc text on Ent (a class, namespace, function, or parameter), or nullptr.
A function's own doc is its summary.
| Ent | a reflection of the documented entity. |
Definition at line 138 of file doc.hpp.
References annotation_text_of().
Referenced by welder::rods::luacats::rod::add_enumerator(), welder::rods::luacats::rod::add_field(), welder::rods::nanobind::rod< DocStyle >::add_field(), welder::rods::pybind11::rod< DocStyle >::add_field(), welder::rods::luacats::rod::add_property(), welder::rods::nanobind::rod< DocStyle >::add_property(), welder::rods::pybind11::rod< DocStyle >::add_property(), welder::rods::luacats::rod::add_variable(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_enum(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_enum(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_type(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_type(), welder::rods::luacats::build_overload(), welder::carriages::basic_carriage< carriages::marker_resolution >::collect_enum_docs(), function_docstring(), welder::rods::luacats::rod::generate(), param_docs(), and welder::carriages::basic_carriage< carriages::marker_resolution >::predeclare_type().
|
consteval |
Does member carry an exclude mark covering language L?
| member | a reflection of the member to test. |
| L | the target language. |
Definition at line 188 of file reflect.hpp.
References lang_bit().
Referenced by member_bound().
| std::string welder::function_docstring | ( | ) |
The complete docstring for function Fn under Style.
Its own doc summary with its parameter docs and returns folded in. Empty when the function carries no documentation at all, so a backend can skip emitting it.
| Fn | a reflection of the function. |
| Style | the docstring style (a doc_style); the caller picks one that fits its target language. |
Definition at line 300 of file doc.hpp.
References doc_of(), param_docs(), and return_doc_of().
Referenced by welder::rods::nanobind::rod< DocStyle >::_def_function(), welder::rods::pybind11::rod< DocStyle >::_def_function(), welder::rods::nanobind::rod< DocStyle >::_def_operator(), and welder::rods::pybind11::rod< DocStyle >::_def_operator().
|
consteval |
Does member carry any getter/setter mark at all (any role, any language)?
The namespace walk uses this to diagnose accessor marks on free functions, where no property surface exists.
| member | a reflection of the entity to test. |
Definition at line 300 of file reflect.hpp.
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_function(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace().
|
consteval |
Does entity carry any no_reassign mark at all (any language)?
no_reassign shapes how a nonstatic data member binds (read-only), so it is meaningless on anything else. The carriage uses this to diagnose the mark on a function, a type, a static member, or a namespace-scope variable — a hard error rather than a silent no-op, mirroring has_accessor_mark.
| entity | a reflection of the entity to test. |
Definition at line 260 of file reflect.hpp.
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_enum(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_function(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_type(), and welder::carriages::basic_carriage< carriages::marker_resolution >::bind_variable().
|
consteval |
Does type declare or inherit any overridable virtual method?
| type | a reflection of the class type. |
Definition at line 239 of file virtuals.hpp.
References overridable_virtuals().
Referenced by welder::rods::nanobind::rod< DocStyle >::_make_class_at(), welder::rods::pybind11::rod< DocStyle >::_make_class_at(), and welder::rods::python::construction_type_of().
|
consteval |
Does member carry an include mark covering language L?
| member | a reflection of the member to test. |
| L | the target language. |
Definition at line 204 of file reflect.hpp.
References lang_bit().
Referenced by member_bound().
|
consteval |
Does member supply either property half for language L — i.e.
is it an accessor the property machinery claims (and the method sweep must skip)?
| member | a reflection of the member function to test. |
| L | the target language. |
Definition at line 290 of file reflect.hpp.
References accessor_marked(), getter, and setter.
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), welder::detail::collect_accessors(), member_bound(), welder::detail::method_overload_set(), and welder::detail::validate_property_shadowing().
|
consteval |
Is type declared at class scope — a nested (member) type?
| type | a reflection of a class/enum type. |
Definition at line 106 of file carriage.hpp.
Referenced by welder::carriages::greedy_resolution< WeldProtected >::counts_as_registered(), welder::carriages::marker_resolution::counts_as_registered(), and welder::detail::scoped_registration< Resolution, Scope >::counts_as_registered().
|
consteval |
Is member an overridable virtual — a virtual member function that welder routes through the trampoline?
Excludes the (virtual) destructor, which is not an overridable slot, and any method marked bind_flat, which is bound as a plain non-overridable method. A per-declaration predicate; the whole-type slot set is overridable_virtuals, which additionally folds inherited virtuals in.
| member | a reflection of a class member. |
Definition at line 78 of file virtuals.hpp.
References bound_flat().
|
consteval |
Is type one of the containers welder can bind by reference (opaquely)?
| type | a reflection of the (possibly aliased — dealias first) type. |
Definition at line 88 of file containers.hpp.
References welder::detail::reference_containers().
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), welder::rods::opaque_containers::collect_into(), welder::rods::opaque_containers::container_depth(), welder::rods::opaque_containers::derive_name(), and welder::rods::opaque_containers::element_ok().
|
consteval |
Keep the call entity patient alive at least until nurse is collected.
Maps to pybind11 keep_alive<Nurse, Patient> / nanobind keep_alive<Nurse, Patient>; indices are 0 = return value, 1 = first argument (a method's implicit this), 2 = second, … Repeatable — attach several to declare several dependencies. Ignored by backends without the concept (the Lua rods).
Usage: [[=welder::keep_alive(1, 2)]] — keep argument 2 alive as long as the receiver (this) lives.
| nurse | the keeper whose collection bounds the dependency. |
| patient | the dependant kept alive until nurse is collected. |
Definition at line 822 of file annotations.hpp.
|
consteval |
The single-language bit for l within a language mask.
Languages are tracked as bits in a mask so a spec can name an arbitrary subset. A value past the mask width is diagnosed at compile time (mint user languages with welder::user_lang, which cannot go out of range).
| l | the language. |
| diag::lang_out_of_mask_range | (a constant-evaluation error) for a value past the mask width — instead of an opaque shift overflow. |
Definition at line 41 of file annotations.hpp.
Referenced by accessor_explicit_name(), accessor_marked(), welder::detail::accessor_mask(), excluded_for(), included_for(), lang_mask(), member_bound(), member_no_reassign(), protected_welded(), welder::detail::return_policy_mask(), return_policy_of(), trusted_for(), welder::detail::weld_as_mask(), weld_as_of(), and weld_mask_admits().
|
consteval |
The mask naming the languages ls.
| Ls | the language enum types (deduced). |
| ls | the languages to combine. |
Definition at line 56 of file annotations.hpp.
References lang_bit().
Referenced by welder::detail::exclude_spec::operator()(), welder::detail::include_spec::operator()(), welder::detail::no_reassign_spec::operator()(), welder::detail::only_spec::operator()(), welder::detail::trust_bindable_spec::operator()(), welder::detail::weld_protected_spec::operator()(), and welder::detail::weld_spec::operator()().
|
consteval |
May the annotations on member type-alias mem appear there?
A member alias participates by the member rules (the outer's policy plus the alias's own marks) with the bindability gate as the register-or-skip arbiter — so weld_as and the participation marks (exclude / include / only) are meaningful on it. Everything else is not: weld (participation never reads it — nested registration follows the outer), policy / weld_protected (they belong on the target type), trust_bindable / return_policy / keep_alive / doc / returns / tparam (no surface they could apply to). Those are diagnosed rather than silently ignored. Non-welder annotations are not welder's business and pass.
| mem | a reflection of the member alias to check. |
Definition at line 124 of file reflect.hpp.
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_types().
|
consteval |
The core decision a backend asks for each member: does member bind for language L under policy pol?
| member | a reflection of the member to resolve. |
| L | the target language. |
| pol | the enclosing type's reflection policy. |
| diag::bare_mark_only | (a constant-evaluation error) on an uncalled [[=welder::mark::only]] — it must name the languages. |
Definition at line 387 of file reflect.hpp.
References automatic, excluded_for(), included_for(), is_accessor_for(), and lang_bit().
Referenced by welder::carriages::greedy_resolution< WeldProtected >::alias_participates(), welder::carriages::marker_resolution::alias_participates(), welder::carriages::greedy_resolution< WeldProtected >::class_member_participates(), welder::carriages::marker_resolution::class_member_participates(), welder::carriages::greedy_resolution< WeldProtected >::counts_as_registered(), welder::detail::entity_bound(), welder::carriages::greedy_resolution< WeldProtected >::member_participates(), welder::carriages::marker_resolution::member_participates(), welder::detail::namespace_has_bindable(), welder::detail::namespace_has_bound(), welder::carriages::greedy_resolution< WeldProtected >::namespace_participates(), welder::carriages::marker_resolution::namespace_participates(), and welder::detail::nested_type_registered().
|
consteval |
Is data member member bound read-only for L by a no_reassign mark?
no_reassign forces the read-only binding on a mutable member (see detail::no_reassign_spec) — the const-member binding, without the const. A rod's add_field ORs this with the member's const-ness to choose the read-only path, so an in-place mutation still writes through but a rebind is rejected.
| member | a reflection of the data member to test. |
| L | the target language. |
Definition at line 243 of file reflect.hpp.
References lang_bit().
Referenced by welder::rods::luabridge::rod::add_field(), welder::rods::luacats::rod::add_field(), welder::rods::nanobind::rod< DocStyle >::add_field(), welder::rods::pybind11::rod< DocStyle >::add_field(), and welder::rods::sol2::rod::add_field().
|
consteval |
The final bound name of Ent (a K-kind entity) for language L under name style Style.
A [[=welder::weld_as]] override wins and is used verbatim (it never flows through Style); otherwise Ent's identifier is reshaped by Style's hook for kind K. The result has static storage, so both the driver and the rods feed it straight to their frameworks. This is the single place a bound name is decided — the driver uses it for class/enum/submodule names, each rod for its members.
| Ent | a reflection of the entity to name. |
| L | the target language. |
| Style | the name style (a welder::naming::name_style). |
| K | which of Style's per-kind hooks to apply. |
Definition at line 375 of file naming.hpp.
References class_, enum_, enumerator, field, function, method, static_method, variable, and weld_as_of().
Referenced by welder::rods::nanobind::rod< DocStyle >::_aggregate_arg(), welder::rods::nanobind::rod< DocStyle >::_def_aggregate_init(), welder::rods::luabridge::rod::add_enumerator(), welder::rods::luacats::rod::add_enumerator(), welder::rods::nanobind::rod< DocStyle >::add_enumerator(), welder::rods::pybind11::rod< DocStyle >::add_enumerator(), welder::rods::sol2::rod::add_enumerator(), welder::rods::luabridge::rod::add_field(), welder::rods::luacats::rod::add_field(), welder::rods::nanobind::rod< DocStyle >::add_field(), welder::rods::pybind11::rod< DocStyle >::add_field(), welder::rods::sol2::rod::add_field(), welder::rods::luabridge::rod::add_method(), welder::rods::luacats::rod::add_method(), welder::rods::nanobind::rod< DocStyle >::add_method(), welder::rods::pybind11::rod< DocStyle >::add_method(), welder::rods::sol2::rod::add_method(), welder::rods::luabridge::rod::add_static_method(), welder::rods::luacats::rod::add_static_method(), welder::rods::nanobind::rod< DocStyle >::add_static_method(), welder::rods::pybind11::rod< DocStyle >::add_static_method(), welder::rods::sol2::rod::add_static_method(), welder::detail::alias_bound_name(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), and name_of_or().
|
constexpr |
Resolve a bound name with a call-site override: override_ wins verbatim, nullptr falls back to name_of.
This is the form the driver and every rod use to honor the optional trailing name on weld_type / weld_function / weld_variable / weld_namespace_as_submodule. It exists because the fallback must be lazy: an entity with no identifier — a class/function template instantiation like Box<int> — can only be named by a weld_as or by the call-site override, and a bare override_ ? override_ : name_of<…>() would still constant-evaluate the consteval name_of (and hard-error on identifier_of) even when the override is present. Here the name_of fallback is compiled only when the entity is statically nameable; otherwise a missing override throws at binding time (it cannot be a compile-time diagnostic — whether the runtime pointer is null is unknowable there).
| Ent | a reflection of the entity to name. |
| L | the target language. |
| Style | the name style (a welder::naming::name_style). |
| K | which of Style's per-kind hooks to apply. |
| override_ | the verbatim call-site name, or nullptr for the resolved one. |
| std::invalid_argument | when the entity has neither an identifier nor a weld_as for L and override_ is nullptr. |
Definition at line 424 of file naming.hpp.
References name_of(), and weld_as_of().
Referenced by welder::rods::luabridge::rod::add_function(), welder::rods::luacats::rod::add_function(), welder::rods::nanobind::rod< DocStyle >::add_function(), welder::rods::pybind11::rod< DocStyle >::add_function(), welder::rods::sol2::rod::add_function(), welder::rods::luabridge::rod::add_variable(), welder::rods::luacats::rod::add_variable(), welder::rods::nanobind::rod< DocStyle >::add_variable(), welder::rods::pybind11::rod< DocStyle >::add_variable(), welder::rods::sol2::rod::add_variable(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_enum(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace_as_submodule(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_enum(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_type(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_type(), welder::carriages::basic_carriage< carriages::marker_resolution >::fill_type(), and welder::carriages::basic_carriage< carriages::marker_resolution >::predeclare_type().
|
consteval |
Is mem a namespace-scope alias naming a class-template specialization — the one way an instantiation can enter a namespace sweep?
members_of(ns) enumerates the class template, never its instantiations; a namespace-scope using IntRing = Ring<int>; is therefore welder's vehicle for welding one: the alias supplies both the target-language name (its identifier) and — for text-emitting rods — the C++ spelling of the otherwise unnameable specialization (has_identifier is false on Ring<int> itself).
| mem | a reflection of a namespace member. |
Definition at line 57 of file reflect.hpp.
Referenced by welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), and welder::detail::sole_alias_of_target().
|
consteval |
Every overridable virtual slot of type — the ones welder routes through a trampoline — folding in virtuals inherited from any base.
Unlike a bare members_of scan this sees a virtual type only inherits (never re-declares), which a trampoline must still cover: a Python subclass of type can override it, and dispatch runs through type's own trampoline, not the base's. A slot is its vtable identity — name + parameter types + cv/ref qualifiers, so a covariant** override is the same slot, kept with its narrowed return type; when a class overrides an inherited virtual, only the most-derived declaration is kept, and its bind_flat mark (not the base's) decides whether the slot is exposed. Protected** virtuals (the NVI hook pattern) are slots like any other — a Python subclass overrides them by plain attribute lookup, no binding involved. Private declarations are excluded: the trampoline's base-class fallback could not name them; a subclass privatizing an inherited virtual thereby withdraws the slot.
| type | a reflection of the class type. |
Definition at line 174 of file virtuals.hpp.
References bound_flat(), and welder::detail::collect_virtuals().
Referenced by has_virtual_methods(), welder::rods::trampolines::rod::make_class(), welder::rods::trampolines::render_trampoline(), welder::rods::python::trampoline_covers(), virtual_slot(), and virtual_slot_count().
|
consteval |
The parameter docs of function Fn, in declaration order.
Names and texts use static storage, so the array (and spans over it) stay valid at runtime.
| Fn | a reflection of the function. |
Definition at line 227 of file doc.hpp.
References doc_of().
Referenced by welder::rods::luacats::arg_list(), welder::rods::luacats::emit_params(), welder::rods::luacats::fun_signature(), and function_docstring().
|
consteval |
The reflection policy declared on type, defaulting to automatic.
| type | a reflection of the type to inspect. |
Definition at line 148 of file reflect.hpp.
References automatic.
Referenced by welder::detail::aggregate_initializable(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_nested_types(), welder::detail::collect_accessors(), welder::carriages::basic_carriage< carriages::marker_resolution >::collect_enum_docs(), welder::detail::collect_member_operators(), welder::carriages::basic_carriage< carriages::marker_resolution >::emit_enumerators(), welder::detail::function_overload_set(), welder::detail::method_overload_set(), welder::detail::namespace_has_bindable(), welder::detail::namespace_has_bound(), welder::detail::nested_type_registered(), welder::detail::operator_entries(), welder::detail::registered_by_member_alias(), welder::detail::stringifier_entries(), and welder::detail::validate_property_shadowing().
|
consteval |
Does type admit its protected members for language L — i.e.
does it carry a policy::weld_protected annotation covering L?
Read off the member's declaring class (so a flattened non-welded base admits its own protected members, consistent with how its marks and policy resolve), and — like every annotation — read through a class-template instantiation from the template's declaration. Repeated annotations union. This is only the default arbitration: a resolution with a protected_participates hook replaces it (see the carriage's member_access_admitted). Private members are never admitted, under any resolution.
| type | a reflection of the declaring class. |
| L | the target language. |
Definition at line 171 of file reflect.hpp.
References lang_bit().
Referenced by welder::carriages::greedy_resolution< WeldProtected >::protected_participates(), and welder::carriages::marker_resolution::protected_participates().
|
consteval |
The types of the public base classes of type.
Private/protected bases are an implementation detail and never participate in a binding. Backends decide how to treat a public base: typically, a base that is itself welded for the target language maps to native inheritance in that backend, while a non-welded base has its members flattened into the derived binding.
| type | a reflection of the derived type. |
Definition at line 418 of file reflect.hpp.
Referenced by welder::rods::sol2::rod::_collect_welded_bases(), welder::detail::aggregate_initializable(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_members(), welder::detail::collect_accessors(), welder::detail::collect_member_operators(), welder::detail::collect_native_bases(), and welder::detail::validate_property_shadowing().
|
consteval |
The returns text on function Fn (documentation of its return value), or nullptr.
A distinct spec type, so it does not collide with the summary doc.
| Fn | a reflection of the function. |
Definition at line 148 of file doc.hpp.
References annotation_text_of().
Referenced by welder::rods::luacats::build_overload(), and function_docstring().
|
consteval |
Force a return-value policy on a callable, optionally scoped to one or more languages.
The rv_kind is the last argument; zero or more lang markers precede it. With no marker the policy covers every welded language; with one or several it is scoped to those — repeat the annotation for a different policy per language. Backends without an explicit policy knob (the Lua rods) ignore it, but a reference-category policy on a by-value return is a hard error for every language (it would reference a temporary).
| args | the language markers (if any) followed by the policy. |
Definition at line 802 of file annotations.hpp.
References welder::detail::return_policy_kind(), and welder::detail::return_policy_mask().
The return-value policy declared on callable fn for language L.
Reads fn's return_policy annotations, honoring the first one whose mask covers L (a mask of 0 covers all languages). Absent any, the policy is rv_kind::automatic — the rod's default, so an unannotated callable binds exactly as before. A rod with an explicit policy knob (the Python backends) translates the result; the Lua rods ignore it (ownership is structural).
| fn | a reflection of the function/method/operator. |
| L | the target language. |
Definition at line 337 of file reflect.hpp.
References automatic, and lang_bit().
Referenced by welder::rods::nanobind::rod< DocStyle >::_def_function(), welder::rods::pybind11::rod< DocStyle >::_def_function(), welder::rods::nanobind::rod< DocStyle >::_def_operator(), welder::rods::pybind11::rod< DocStyle >::_def_operator(), welder::rods::nanobind::rod< DocStyle >::_def_truncated(), welder::rods::pybind11::rod< DocStyle >::_def_truncated(), welder::rods::nanobind::rod< DocStyle >::add_property(), welder::rods::pybind11::rod< DocStyle >::add_property(), and validate_return_policy().
|
consteval |
Document a function's return value.
Usage: [[=welder::returns("what the call yields")]] on a function.
| N | the text length (deduced). |
| s | the return-value documentation. |
Definition at line 654 of file annotations.hpp.
|
consteval |
Document a template parameter (repeatable, ordered).
Usage: [[=welder::tparam("T", "what T is")]] on a class/function template.
| N | the parameter-name length (deduced). |
| M | the text length (deduced). |
| name | the template parameter's name, matching the declaration. |
| text | its documentation. |
Definition at line 669 of file annotations.hpp.
|
consteval |
|
consteval |
The template-parameter docs declared on Ent via [[=welder::tparam("T","…")]], in annotation order.
| Ent | a reflection of the entity. |
|
consteval |
Does member carry a trust_bindable mark covering language L?
The user's vouch that the member's type is registered/convertible outside welder's view, so the bindability gate should trust it. See <welder/annotations.hpp>.
| member | a reflection of the member to test. |
| L | the target language. |
Definition at line 224 of file reflect.hpp.
References lang_bit().
Referenced by assert_callable_bindable(), assert_member_bindable(), assert_operands_bindable(), and assert_setter_bindable().
|
consteval |
Reject a return_policy on Fn (for language L) that contradicts Fn's return type.
A reference-category policy (reference / reference_internal) promises the target a view into a live C++ object; on a by-value (prvalue) return there is no such object — only a temporary — so the view would dangle. This is a contradiction in any language, so every rod (Python and Lua alike) runs the check at its per-overload bind site. Anything the framework could plausibly honor passes; only the dangling case is diagnosed.
| Fn | a reflection of the callable being bound. |
| L | the target language. |
| diag::dangling_return_policy | (a constant-evaluation error) on the contradiction. |
Definition at line 361 of file reflect.hpp.
References reference, reference_internal, and return_policy_of().
Referenced by welder::rods::luabridge::rod::_add_function(), welder::rods::luabridge::rod::_add_operator_slot(), welder::rods::luabridge::rod::_add_static_function(), welder::rods::nanobind::rod< DocStyle >::_def_function(), welder::rods::pybind11::rod< DocStyle >::_def_function(), welder::rods::nanobind::rod< DocStyle >::_def_operator(), welder::rods::pybind11::rod< DocStyle >::_def_operator(), welder::rods::nanobind::rod< DocStyle >::_def_reflected_operator(), welder::rods::pybind11::rod< DocStyle >::_def_reflected_operator(), welder::rods::sol2::rod::_register_named(), welder::rods::sol2::rod::_register_operator(), welder::rods::luabridge::rod::add_property(), welder::rods::nanobind::rod< DocStyle >::add_property(), welder::rods::pybind11::rod< DocStyle >::add_property(), and welder::rods::sol2::rod::add_property().
|
consteval |
The overridable virtual slot of type named name whose function type is fn_type — the hand-written disambiguator for an overloaded virtual.
^^Base::fn is ill-formed when fn names an overload set (P2996 has no overload-set reflection), so WELDER_PY_OVERRIDE(fn) cannot be used inside the override of an overloaded virtual. This finder selects one overload by its exact function type, for the slot-taking macro form:
(The extra parentheses keep any commas inside the expression out of the preprocessor's argument splitting.) Searches overridable_virtuals, so inherited slots are found too.
| type | a reflection of the welded type. |
| name | the virtual's identifier. |
| fn_type | a reflection of the overload's full function type, trailing qualifiers included (e.g. ^^int(int) const). |
| diag::no_matching_virtual_slot | (a constant-evaluation error) when no slot matches the name/type pair. |
Definition at line 213 of file virtuals.hpp.
References overridable_virtuals().
|
consteval |
The number of overridable virtual member functions of type, inherited ones included.
This is the N in NB_TRAMPOLINE(Base, N) / a trampoline's slot count — the virtuals actually routed through the trampoline, so per-method bind_flat marks (and the destructor) are excluded. Counts inherited virtuals too (see overridable_virtuals), so a subclass whose virtuals all come from a base still reports a non-zero count and gets a correctly sized trampoline.
| type | a reflection of the class type. |
Definition at line 232 of file virtuals.hpp.
References overridable_virtuals().
|
consteval |
Force a verbatim target name, optionally scoped to one or more languages.
The verbatim name is the last argument; zero or more lang markers precede it. With no marker the name covers every welded language; with one or several it is scoped to those. Repeat the annotation to give an entity a different verbatim name per language.
| Args | the leading lang markers then the const char[N] name (deduced). |
| args | the language markers (if any) followed by the verbatim name. |
Definition at line 736 of file annotations.hpp.
References welder::detail::weld_as_mask(), and welder::detail::weld_as_name().
|
consteval |
Force s as the target name in every welded language.
The bare, all-languages form of weld_as — the common case, spelled as its own overload (like welder::weld() with no languages) so a plain [[=welder::weld_as("do_thing")]] needs none of the variadic marker machinery. A single string argument is more specialized than the variadic form below, so it is the one chosen here.
| N | the name length including the terminator (deduced). |
| s | the verbatim name. |
Definition at line 687 of file annotations.hpp.
|
consteval |
The verbatim weld_as name forced on Ent for language L, or nullptr.
Scans Ent's annotations for a detail::weld_as_spec covering L (a mask of 0 covers all languages); the first match wins. The returned string has static storage (define_static_string), so it is usable at runtime.
| Ent | a reflection of the entity to read. |
| L | the target language. |
Definition at line 343 of file naming.hpp.
References lang_bit().
Referenced by welder::detail::alias_bound_name(), name_of(), and name_of_or().
|
consteval |
Does a weld mask admit language L?
An empty mask is the bare [[=welder::weld]] (equivalently welder::weld()): the language-agnostic weld, admitting every language. Any other mask names its languages explicitly.
| mask | the mask from a detail::weld_spec. |
| L | the target language. |
Definition at line 28 of file reflect.hpp.
References lang_bit().
Referenced by alias_welded_for(), and welded_for().
|
consteval |
Is type welded for language L — i.e.
does it carry a matching weld annotation?
| type | a reflection of the type to test. |
| L | the target language. |
Definition at line 40 of file reflect.hpp.
References weld_mask_admits().
Referenced by welder::rods::sol2::rod::_collect_welded_bases(), alias_welded_for(), welder::carriages::basic_carriage< carriages::marker_resolution >::bind_namespace(), welder::detail::collect_native_bases(), welder::carriages::marker_resolution::counts_as_registered(), welder::welded_registration::counts_as_registered(), welder::rods::opaque_containers::element_ok(), welder::detail::entity_bound(), welder::carriages::marker_resolution::is_native_base(), welder::carriages::marker_resolution::member_participates(), and welder::carriages::marker_resolution::participates().
|
inlineconstexpr |
Mark a virtual entity as deliberately bound non-overridably.
Usage: [[=welder::bind_flat]]. Two granularities:
Without it, every welded type carrying an overridable virtual must register a trampoline via welder::rods::python::trampoline_for, or welder's Python rods reject it at compile time.
Definition at line 58 of file virtuals.hpp.
|
inlineconstexpr |
Mark a member function as a property getter (const, no parameters).
A marked getter binds as an idiomatic read property instead of a method; a same-property setter (matched by name — explicit, or derived from the identifiers with the leading get/set word stripped) makes it read/write, alone it is read-only. Bare = all languages; call it to scope by language and/or force an explicit property name (see welder::detail::accessor_spec). Under policy::opt_in the mark also counts as the member's opt-in (like mark::only); an explicit exclude still beats it. For languages the mark does not cover, the function binds as an ordinary method.
Definition at line 618 of file annotations.hpp.
|
inlineconstexpr |
Mark a member function as a property setter (exactly one parameter) — the write half of welder::getter, paired by property name.
A setter whose property has no participating getter in a language is a hard error (welder binds no write-only properties).
Definition at line 624 of file annotations.hpp.
Referenced by welder::detail::property_entries().
|
inlineconstexpr |
The type-level trust customization point: specialize to true to trust T wherever it appears (member, parameter, return, container element, …).
A plain bool, so it trusts T for every language at once. Usage (at namespace scope, before binding a type that uses T):
| T | the type to trust everywhere. See welder::detail::trust_bindable_spec for the per-member granularity. |
Definition at line 590 of file annotations.hpp.
Referenced by welder::detail::bindable().
A user-defined language: the Slot-th identity from the mask's user range (bit 16 + Slot) — for binding a language welder does not ship, without touching welder.
Constrained so it can never collide with a welder-shipped language and never exceeds the mask width.
Mint it once, in one place — the application that instantiates the rod — and spell both the annotations and the rod's language from that single constant, so the two can never disagree:
Two third-party rods that both default to the same slot are re-pointed the same way — pass each a distinct user_lang at the instantiation site.
| Slot | the user-range slot, 0–15. |
|
inlineconstexpr |
The weld annotation: declare an entity bound, and for which languages.
A constexpr object (like mark::exclude and policy::weld_protected), so it is usable bare — welded for every language — or called to scope it:
Prefer the bare form unless a type really belongs to one language's surface: a project that welds language-agnostically picks up a newly built rod without touching a single annotation. welder::weld() — called with no languages — is the same all-languages mask, so both spellings agree.
Definition at line 552 of file annotations.hpp.