26 #include "pybind11/pybind11.h" 38 namespace typehandling {
42 void declareSimpleGenericMap(utils::python::WrapperCollection& wrappers,
std::string const& suffix,
44 using Class = SimpleGenericMap<K>;
45 using PyClass = py::class_<Class, std::shared_ptr<Class>, MutableGenericMap<K>>;
47 std::string className =
"SimpleGenericMap" + suffix;
50 "A `dict`-like `~collections.abc.MutableMapping` for use when sharing a map between C++ and " 56 mapping : `collections.abc.Mapping`, optional 57 iterable : iterable, optional 59 A ``SimpleGenericMap`` takes the same input arguments as `dict`. 61 wrappers.wrapType(PyClass(wrappers.module, className.c_str(), docstring.c_str()), 62 [](auto& mod,
auto&
cls) {
70 cls.def(py::init<>());
71 cls.def(
"copy", [](Class
const&
self) {
return Class(
self); });
80 declareSimpleGenericMap<std::string>(wrappers,
"S",
"strings");
A base class for image defects.
void wrapSimpleGenericMap(utils::python::WrapperCollection &wrappers)
A helper class for subdividing pybind11 module across multiple translation units (i.e.
std::string declareGenericMapRestrictions(std::string const &className, std::string const &keyName)