welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::rods::opaque_containers::rod Struct Reference

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.

Detailed Description

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.

Definition at line 43 of file rod.hpp.

Member Typedef Documentation

◆ class_handle_type

Definition at line 65 of file rod.hpp.

◆ enum_handle_type

Definition at line 66 of file rod.hpp.

◆ module_type

Member Function Documentation

◆ add_comparisons()

template<class T, auto Fns, auto Covered>
void welder::rods::opaque_containers::rod::add_comparisons ( class_handle & )
inlinestatic

Definition at line 149 of file rod.hpp.

◆ add_constructors()

template<class T, auto Ctors, bool HasDefault, bool Aggregate, bool Copyable>
void welder::rods::opaque_containers::rod::add_constructors ( class_handle & cls)
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).

See also
welder::rod

Definition at line 108 of file rod.hpp.

References welder::rods::opaque_containers::rod::class_handle::doc.

◆ add_enumerator()

template<std::meta::info, class = ::welder::naming::none>
void welder::rods::opaque_containers::rod::add_enumerator ( enum_handle & )
inlinestatic

Definition at line 166 of file rod.hpp.

◆ add_field()

template<std::meta::info Mem, class Style = ::welder::naming::none>
void welder::rods::opaque_containers::rod::add_field ( class_handle & cls)
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)).

See also
welder::rod

Definition at line 117 of file rod.hpp.

References welder::rods::opaque_containers::rod::class_handle::doc, and welder::rods::python::marked_by_value().

◆ add_function()

template<auto Fns, class Style = ::welder::naming::none>
void welder::rods::opaque_containers::rod::add_function ( module_type & m,
const char * = nullptr )
inlinestatic

Collect from a free function's overload group signatures (a Style-aware site).

See also
welder::rod

Definition at line 177 of file rod.hpp.

References welder::rods::opaque_containers::rod::module_handle::doc.

◆ add_method()

template<auto Fns, class Style = ::welder::naming::none>
void welder::rods::opaque_containers::rod::add_method ( class_handle & cls)
inlinestatic

Definition at line 134 of file rod.hpp.

References welder::rods::opaque_containers::rod::class_handle::doc.

◆ add_operator()

template<class T, auto Fns>
void welder::rods::opaque_containers::rod::add_operator ( class_handle & cls)
inlinestatic

Definition at line 144 of file rod.hpp.

References welder::rods::opaque_containers::rod::class_handle::doc.

◆ add_property()

template<class T, std::meta::info Getter, std::meta::info Setter>
void welder::rods::opaque_containers::rod::add_property ( class_handle & cls,
const char *  )
inlinestatic

Collect from the property accessor signatures (getter return, setter param).

The carriage's add_property hook carries no name style (unstyled site).

See also
welder::rod

Definition at line 127 of file rod.hpp.

References welder::rods::opaque_containers::rod::class_handle::doc.

◆ add_static_method()

template<auto Fns, class Style = ::welder::naming::none>
void welder::rods::opaque_containers::rod::add_static_method ( class_handle & cls)
inlinestatic

Definition at line 139 of file rod.hpp.

References welder::rods::opaque_containers::rod::class_handle::doc.

◆ add_stringifier()

template<class T, std::meta::info Fn>
void welder::rods::opaque_containers::rod::add_stringifier ( class_handle & )
inlinestatic

Definition at line 151 of file rod.hpp.

◆ add_submodule()

module_type welder::rods::opaque_containers::rod::add_submodule ( module_type & m,
const char * name )
inlinestatic

Recurse into a nested namespace, carrying the document through.

See also
welder::rod

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.

◆ add_variable()

template<std::meta::info Var, class Style = ::welder::naming::none>
void welder::rods::opaque_containers::rod::add_variable ( module_type & m,
session & ,
const char * = nullptr )
inlinestatic

Collect the container(s) in a namespace variable's type (a Style-aware site).

See also
welder::rod

Definition at line 185 of file rod.hpp.

References welder::rods::opaque_containers::rod::module_handle::doc.

◆ close_module()

void welder::rods::opaque_containers::rod::close_module ( module_type & ,
session &  )
inlinestatic

Definition at line 195 of file rod.hpp.

◆ finish_enum()

template<class E>
void welder::rods::opaque_containers::rod::finish_enum ( enum_handle & )
inlinestatic

Definition at line 167 of file rod.hpp.

◆ generate()

template<std::meta::info Ns, class Style = ::welder::naming::none>
void welder::rods::opaque_containers::rod::generate ( std::ostream & os)
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).

Template Parameters
Nsa reflection of the (top-level) namespace to scan.
Parameters
osthe 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().

◆ make_class() [1/2]

template<class T, std::meta::info Decl, auto Bases, std::size_t... I>
class_handle welder::rods::opaque_containers::rod::make_class ( module_type & m,
const char * ,
const char * ,
std::index_sequence< I... >  )
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.

◆ make_class() [2/2]

template<class T, auto Bases, std::size_t... I>
class_handle welder::rods::opaque_containers::rod::make_class ( module_type & m,
const char * ,
const char * ,
std::index_sequence< I... >  )
inlinestatic

Definition at line 86 of file rod.hpp.

References welder::rods::opaque_containers::rod::module_handle::doc.

◆ make_enum()

template<class E>
enum_handle welder::rods::opaque_containers::rod::make_enum ( module_type & ,
const char * ,
const ::welder::detail::enum_doc &  )
inlinestatic

Definition at line 156 of file rod.hpp.

◆ make_nested_class()

template<class T, auto Bases, std::size_t... I>
class_handle welder::rods::opaque_containers::rod::make_nested_class ( module_type & m,
class_handle & ,
const char * ,
const char * ,
std::index_sequence< I... >  )
inlinestatic

Definition at line 98 of file rod.hpp.

References welder::rods::opaque_containers::rod::module_handle::doc.

◆ make_nested_enum()

template<class E>
enum_handle welder::rods::opaque_containers::rod::make_nested_enum ( module_type & ,
class_handle & ,
const char * ,
const ::welder::detail::enum_doc &  )
inlinestatic

Definition at line 161 of file rod.hpp.

◆ open_module()

session welder::rods::opaque_containers::rod::open_module ( module_type & )
inlinestatic

Definition at line 171 of file rod.hpp.

◆ set_module_doc()

void welder::rods::opaque_containers::rod::set_module_doc ( module_type & ,
const char *  )
inlinestatic

Definition at line 172 of file rod.hpp.

◆ special_method_name()

consteval const char * welder::rods::opaque_containers::rod::special_method_name ( std::meta::info )
inlinestaticconsteval

No operators expose special names here (containers are collected from operator signatures directly).

See also
welder::rod

Definition at line 79 of file rod.hpp.

Member Data Documentation

◆ has_native_caster

template<class T>
bool welder::rods::opaque_containers::rod::has_native_caster = true
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.

See also
welder::caster_oracle

Definition at line 75 of file rod.hpp.

◆ language

lang welder::rods::opaque_containers::rod::language {lang::py}
staticconstexpr

Opaque containers are Python-only.

Definition at line 44 of file rod.hpp.


The documentation for this struct was generated from the following file:
  • src/welder/rods/python/opaque_containers/rod.hpp