|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
The text-emitting core of welder's opaque-container generator rod: the collector that gathers the reference containers a welded namespace uses, derives a readable target name for each, and renders the .hpp of WELDER_OPAQUE(...) declarations + welded aliases that binds them by reference. More...
#include <algorithm>#include <cstddef>#include <meta>#include <string>#include <vector>#include <welder/containers.hpp>#include <welder/naming.hpp>#include <welder/reflect.hpp>Go to the source code of this file.
Classes | |
| struct | welder::rods::opaque_containers::entry |
| One container to open opaque: its C++ spelling, its derived target name, and whether a by_value mark excluded it (kept in the set so a later use site can be reconciled, but skipped at render). More... | |
| struct | welder::rods::opaque_containers::document |
| The accumulator threaded through the rod's emission hooks: the deduped set of reference containers the welded namespace uses, and the renderer for the finished header. More... | |
Namespaces | |
| namespace | welder |
| namespace | welder::rods |
| namespace | welder::rods::opaque_containers |
Functions | |
| consteval std::string | welder::rods::opaque_containers::container_spelling (std::meta::info type) |
| The C++ text of container type, infrastructure args (allocator/comparator/ hasher) dropped — the reflection display form, which already elides them (std::vector<int>, std::map<std::__cxx11::basic_string<char>, int>). | |
| consteval std::size_t | welder::rods::opaque_containers::value_arg_count (std::meta::info type) |
| How many leading (value) template arguments of type name its element/key/value types — a sequence exposes 1, a map 2. | |
| consteval std::string | welder::rods::opaque_containers::sanitize_ident (std::string s) |
| Reduce s to a valid C++ identifier: keep [A-Za-z0-9_], collapse every other run to a single _ (dropping leading/trailing ones), and prefix _ if it would start with a digit. | |
| consteval std::string | welder::rods::opaque_containers::qualified_ident (std::meta::info entity) |
| The collision-free qualified identifier of entity: its own identifier (or, for an unnameable entity, its display_string_of) prefixed by every enclosing named namespace and enclosing class, each PascalCased and concatenated — so a type is named uniquely across namespaces (geometry::Point → GeometryPoint, physics::Point → PhysicsPoint, never a colliding bare Point). | |
| consteval std::string | welder::rods::opaque_containers::derive_name (std::meta::info arg) |
| A readable, valid, collision-free PascalCase identifier for container/element arg — the template name plus each argument's name, recursing — vector<int> → VectorInt, map<string,int> → MapStringInt, nested map<string,vector<int>> → MapStringVectorInt. | |
| consteval bool | welder::rods::opaque_containers::has_opaque_hook (std::meta::info style_type) |
| Does name style style_type (or any of its bases) declare the optional transform_opaque_container hook? | |
| template<class Style, std::meta::info Enclosing, std::meta::info Container, std::meta::info Member> | |
| consteval std::string | welder::rods::opaque_containers::opaque_name () |
| The opaque-wrapper name for container Container found on member/site Member within Enclosing — the customization point behind the generator's naming. | |
| consteval std::string | welder::rods::opaque_containers::namespace_name (std::meta::info ns) |
| The fully-qualified spelling of namespace ns for a namespace X { … } header block (no leading :: — geometry::detail, not ::geometry::detail). | |
| consteval bool | welder::rods::opaque_containers::scalar_leaf (std::meta::info t) |
| Is t a scalar leaf — a fundamental type or a std::basic_string — i.e. | |
| consteval bool | welder::rods::opaque_containers::element_ok (std::meta::info t) |
| Can the driver's PHASE 1 (name pre-registration) register t's name before PHASE 2 binds the container that uses it — i.e. | |
| consteval bool | welder::rods::opaque_containers::opaque_eligible (std::meta::info type) |
| Is container type eligible for the generator — will PHASE 1 register every element/key/value type's name before PHASE 2 binds it (see element_ok)? | |
| consteval void | welder::rods::opaque_containers::collect_into (std::vector< std::meta::info > &out, std::meta::info type) |
| Append type's directly-named reference container when it is one and eligible (see opaque_eligible). | |
| template<std::meta::info Type> | |
| consteval std::vector< std::meta::info > | welder::rods::opaque_containers::containers_in () |
| The reference containers within surface type Type (a splice-ready static list for a template for). | |
The text-emitting core of welder's opaque-container generator rod: the collector that gathers the reference containers a welded namespace uses, derives a readable target name for each, and renders the .hpp of WELDER_OPAQUE(...) declarations + welded aliases that binds them by reference.
welder cannot emit a namespace-scope type_caster specialization (PYBIND11_MAKE_OPAQUE/NB_MAKE_OPAQUE) from a runtime rod — the same wall the trampoline generator hits with subclass injection — so this build-time text rod emits it as source the consuming translation unit compiles, exactly like the trampoline and LuaCATS generators. It is backend-neutral: it emits the neutral WELDER_OPAQUE macro + weld(lang::py) aliases, so one generated header serves both Python rods.
Requires the welder vocabulary first (#include <welder/vocabulary.hpp>).
Definition in file document.hpp.