|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
The opaque-container generator rod (satisfies welder::rod). More...
#include <welder/rods/python/opaque_containers/rod.hpp>
Classes | |
| struct | module_handle |
| A copyable handle onto the growing document threaded through every emission primitive (the rod's module_type). More... | |
| struct | class_handle |
| The per-class handle: it carries the document so the per-member hooks (add_field / add_method / …) can collect from members and signatures. More... | |
| struct | enum_handle |
| The enum handle — enums use no containers, so it carries nothing. More... | |
| struct | session |
| No deferred module state. More... | |
Public Types | |
| using | module_type = module_handle |
| template<class> | |
| using | class_handle_type = class_handle |
| template<class> | |
| using | enum_handle_type = enum_handle |
Static Public Member Functions | |
| static consteval const char * | special_method_name (std::meta::info) |
| No operators expose special names here (containers are collected from operator signatures directly). | |
| template<class T, auto Bases, std::size_t... I> | |
| static class_handle | make_class (module_type &m, const char *, const char *, std::index_sequence< I... >) |
| template<class T, std::meta::info Decl, auto Bases, std::size_t... I> | |
| static class_handle | make_class (module_type &m, const char *, const char *, std::index_sequence< I... >) |
| The declaring-entity-aware form the carriage prefers (see bind_type); the generator keys off member types, so Decl is unused. | |
| template<class T, auto Bases, std::size_t... I> | |
| static class_handle | make_nested_class (module_type &m, class_handle &, const char *, const char *, std::index_sequence< I... >) |
| template<class T, auto Ctors, bool HasDefault, bool Aggregate, bool Copyable> | |
| static void | add_constructors (class_handle &cls) |
| Collect from each participating constructor's parameter types. | |
| template<std::meta::info Mem, class Style = ::welder::naming::none> | |
| static void | add_field (class_handle &cls) |
| Collect the container(s) in data member Mem's type — excluded when Mem carries [[=welder::rods::python::by_value]]. | |
| template<class T, std::meta::info Getter, std::meta::info Setter> | |
| static void | add_property (class_handle &cls, const char *) |
| Collect from the property accessor signatures (getter return, setter param). | |
| template<auto Fns, class Style = ::welder::naming::none> | |
| static void | add_method (class_handle &cls) |
| template<auto Fns, class Style = ::welder::naming::none> | |
| static void | add_static_method (class_handle &cls) |
| template<class T, auto Fns> | |
| static void | add_operator (class_handle &cls) |
| template<class T, auto Fns, auto Covered> | |
| static void | add_comparisons (class_handle &) |
| template<class T, std::meta::info Fn> | |
| static void | add_stringifier (class_handle &) |
| template<class E> | |
| static enum_handle | make_enum (module_type &, const char *, const ::welder::detail::enum_doc &) |
| template<class E> | |
| static enum_handle | make_nested_enum (module_type &, class_handle &, const char *, const ::welder::detail::enum_doc &) |
| template<std::meta::info, class = ::welder::naming::none> | |
| static void | add_enumerator (enum_handle &) |
| template<class E> | |
| static void | finish_enum (enum_handle &) |
| static session | open_module (module_type &) |
| static void | set_module_doc (module_type &, const char *) |
| template<auto Fns, class Style = ::welder::naming::none> | |
| static void | add_function (module_type &m, const char *=nullptr) |
| Collect from a free function's overload group signatures (a Style-aware site). | |
| template<std::meta::info Var, class Style = ::welder::naming::none> | |
| static void | add_variable (module_type &m, session &, const char *=nullptr) |
| Collect the container(s) in a namespace variable's type (a Style-aware site). | |
| static module_type | add_submodule (module_type &m, const char *name) |
| Recurse into a nested namespace, carrying the document through. | |
| static void | close_module (module_type &, session &) |
| template<std::meta::info Ns, class Style = ::welder::naming::none> | |
| static void | generate (std::ostream &os) |
| Emit the opaque-container header for the welded types in namespace Ns to os. | |
Static Public Attributes | |
| static constexpr lang | language {lang::py} |
| Opaque containers are Python-only. | |
| template<class T> | |
| static constexpr bool | has_native_caster = true |
| Permissive: the generator only reads the welded surface to find containers, so it does not need a backend's bindability oracle — disabling the gate lets it run over the same types the Python rods bind without re-deriving their caster logic. | |
The opaque-container generator rod (satisfies welder::rod).
Its emission primitives COLLECT the reference containers each welded surface uses into a document; generate renders the header.
| using welder::rods::opaque_containers::rod::class_handle_type = class_handle |
| using welder::rods::opaque_containers::rod::enum_handle_type = enum_handle |
|
inlinestatic |
|
inlinestatic |
Collect from each participating constructor's parameter types.
The carriage's add_constructors hook carries no name style, so these are unstyled sites (a later data-member visit refines any custom name).
Definition at line 108 of file rod.hpp.
References welder::rods::opaque_containers::rod::class_handle::doc.
|
inlinestatic |
|
inlinestatic |
Collect the container(s) in data member Mem's type — excluded when Mem carries [[=welder::rods::python::by_value]].
A Style-aware site: the naming hook sees Mem and its class (parent_of(Mem)).
Definition at line 117 of file rod.hpp.
References welder::rods::opaque_containers::rod::class_handle::doc, and welder::rods::python::marked_by_value().
|
inlinestatic |
Collect from a free function's overload group signatures (a Style-aware site).
Definition at line 177 of file rod.hpp.
References welder::rods::opaque_containers::rod::module_handle::doc.
|
inlinestatic |
Definition at line 134 of file rod.hpp.
References welder::rods::opaque_containers::rod::class_handle::doc.
|
inlinestatic |
Definition at line 144 of file rod.hpp.
References welder::rods::opaque_containers::rod::class_handle::doc.
|
inlinestatic |
Collect from the property accessor signatures (getter return, setter param).
The carriage's add_property hook carries no name style (unstyled site).
Definition at line 127 of file rod.hpp.
References welder::rods::opaque_containers::rod::class_handle::doc.
|
inlinestatic |
Definition at line 139 of file rod.hpp.
References welder::rods::opaque_containers::rod::class_handle::doc.
|
inlinestatic |
|
inlinestatic |
Recurse into a nested namespace, carrying the document through.
Definition at line 191 of file rod.hpp.
References welder::rods::opaque_containers::rod::module_handle::doc, and welder::rods::opaque_containers::rod::module_handle::prefix.
|
inlinestatic |
Collect the container(s) in a namespace variable's type (a Style-aware site).
Definition at line 185 of file rod.hpp.
References welder::rods::opaque_containers::rod::module_handle::doc.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Emit the opaque-container header for the welded types in namespace Ns to os.
Runs welder's generic driver over Ns with this text-emitting backend, so the header opens exactly the containers the Python rods would bind — by_value-marked ones excluded. Style is accepted for signature parity but unused (container names are derived, not styled).
| Ns | a reflection of the (top-level) namespace to scan. |
| os | the stream to write the finished header to. |
Definition at line 207 of file rod.hpp.
References welder::doc(), and welder::rods::opaque_containers::namespace_name().
|
inlinestatic |
The declaring-entity-aware form the carriage prefers (see bind_type); the generator keys off member types, so Decl is unused.
Definition at line 93 of file rod.hpp.
References welder::rods::opaque_containers::rod::module_handle::doc.
|
inlinestatic |
Definition at line 86 of file rod.hpp.
References welder::rods::opaque_containers::rod::module_handle::doc.
|
inlinestatic |
|
inlinestatic |
Definition at line 98 of file rod.hpp.
References welder::rods::opaque_containers::rod::module_handle::doc.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestaticconsteval |
No operators expose special names here (containers are collected from operator signatures directly).
|
staticconstexpr |
Permissive: the generator only reads the welded surface to find containers, so it does not need a backend's bindability oracle — disabling the gate lets it run over the same types the Python rods bind without re-deriving their caster logic.