|
welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
|
Owning handle for a py::native_enum<E>, plus the scope + name to reach the finalized enum object. More...
#include <welder/rods/python/pybind11/rod.hpp>
Public Member Functions | |
| void | value (const char *n, E v) |
| Add enumerator n = v to the pending native enum. | |
| void | export_values () |
| Export the enumerators into the enclosing scope (unscoped enums). | |
| void | finalize () |
| Commit the enum onto scope as name, and stamp the pybind11-stubgen native-enum marker. | |
Public Attributes | |
| py::object | scope |
| the enclosing scope: a (sub)module, or — for a nested enum — the enclosing class handle | |
| const char * | name |
| the enum's Python name | |
| std::unique_ptr< py::native_enum< E > > | impl |
| the (move-only) native enum | |
Owning handle for a py::native_enum<E>, plus the scope + name to reach the finalized enum object.
native_enum binds Python's stdlib enum.IntEnum, so enumerators are int-convertible (int(E.Value)) and compare against ints — matching pybind11's legacy py::enum_ default and the nanobind backend's nb::is_arithmetic(). We use native_enum because plain py::enum_ is discouraged as of pybind11 3.0.
native_enum is move-only and must be explicitly .finalize()d, so it is wrapped here in a movable handle the shared bind_enum driver can hold by value, drive via value()/export_values(), and finalize at the end.
|
inline |
|
inline |
|
inline |
| std::unique_ptr<py::native_enum<E> > welder::rods::pybind11::rod< DocStyle >::enum_handle< E >::impl |
the (move-only) native enum
Definition at line 525 of file rod.hpp.
Referenced by export_values(), finalize(), and value().
| const char* welder::rods::pybind11::rod< DocStyle >::enum_handle< E >::name |
| py::object welder::rods::pybind11::rod< DocStyle >::enum_handle< E >::scope |
the enclosing scope: a (sub)module, or — for a nested enum — the enclosing class handle
Definition at line 522 of file rod.hpp.
Referenced by finalize().