10 #include "wrap/serialization.h" 11 #include <boost/serialization/export.hpp> 22 m_.doc() =
"pybind11 wrapper of enum_py";
24 py::enum_<Color>(m_,
"Color", py::arithmetic())
25 .
value(
"Red", Color::Red)
26 .value(
"Green", Color::Green)
27 .value(
"Blue", Color::Blue);
30 py::class_<Pet, std::shared_ptr<Pet>> pet(m_,
"Pet");
32 .def(py::init<const string&, Kind>(),
py::arg(
"name"),
py::arg(
"type"))
36 py::enum_<Pet::Kind>(pet,
"Kind", py::arithmetic())
37 .
value(
"Dog", Pet::Kind::Dog)
38 .value(
"Cat", Pet::Kind::Cat);
41 py::enum_<gtsam::VerbosityLM>(m_gtsam,
"VerbosityLM", py::arithmetic())
42 .
value(
"SILENT", gtsam::VerbosityLM::SILENT)
43 .value(
"SUMMARY", gtsam::VerbosityLM::SUMMARY)
44 .value(
"TERMINATION", gtsam::VerbosityLM::TERMINATION)
45 .value(
"LAMBDA", gtsam::VerbosityLM::LAMBDA)
46 .value(
"TRYLAMBDA", gtsam::VerbosityLM::TRYLAMBDA)
47 .value(
"TRYCONFIG", gtsam::VerbosityLM::TRYCONFIG)
48 .value(
"DAMPED", gtsam::VerbosityLM::DAMPED)
49 .value(
"TRYDELTA", gtsam::VerbosityLM::TRYDELTA);
52 py::class_<gtsam::MCU, std::shared_ptr<gtsam::MCU>> mcu(m_gtsam,
"MCU");
56 py::enum_<gtsam::MCU::Avengers>(mcu,
"Avengers", py::arithmetic())
57 .
value(
"CaptainAmerica", gtsam::MCU::Avengers::CaptainAmerica)
58 .value(
"IronMan", gtsam::MCU::Avengers::IronMan)
59 .value(
"Hulk", gtsam::MCU::Avengers::Hulk)
60 .value(
"Hawkeye", gtsam::MCU::Avengers::Hawkeye)
61 .value(
"Thor", gtsam::MCU::Avengers::Thor);
64 py::enum_<gtsam::MCU::GotG>(mcu,
"GotG", py::arithmetic())
65 .
value(
"Starlord", gtsam::MCU::GotG::Starlord)
66 .value(
"Gamorra", gtsam::MCU::GotG::Gamorra)
67 .value(
"Rocket", gtsam::MCU::GotG::Rocket)
68 .value(
"Drax", gtsam::MCU::GotG::Drax)
69 .value(
"Groot", gtsam::MCU::GotG::Groot);
73 #include "python/specializations.h"
module_ def_submodule(const char *name, const char *doc=nullptr)
PYBIND11_MODULE(enum_py, m_)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const