7 #include "path/to/ns1.h" 8 #include "path/to/ns1/ClassB.h" 9 #include "path/to/ns2.h" 10 #include "path/to/ns2/ClassA.h" 11 #include "path/to/ns3.h" 22 m_.doc() =
"pybind11 wrapper of namespaces_py";
26 py::class_<ns1::ClassA, std::shared_ptr<ns1::ClassA>>(m_ns1,
"ClassA")
29 py::class_<ns1::ClassB, std::shared_ptr<ns1::ClassB>>(m_ns1,
"ClassB")
34 py::class_<ns2::ClassA, std::shared_ptr<ns2::ClassA>>(m_ns2,
"ClassA")
36 .def(
"memberFunction",[](ns2::ClassA*
self){
return self->memberFunction();})
37 .def(
"nsArg",[](ns2::ClassA*
self,
const ns1::ClassB&
arg){
return self->nsArg(arg);},
py::arg(
"arg"))
38 .def(
"nsReturn",[](ns2::ClassA*
self,
double q){
return self->nsReturn(q);},
py::arg(
"q"))
39 .def_static(
"afunction",[](){
return ns2::ClassA::afunction();});
42 py::class_<ns2::ns3::ClassB, std::shared_ptr<ns2::ns3::ClassB>>(m_ns2_ns3,
"ClassB")
45 py::class_<ns2::ClassC, std::shared_ptr<ns2::ClassC>>(m_ns2,
"ClassC")
48 m_ns2.attr(
"aNs2Var") = ns2::aNs2Var;
49 m_ns2.
def(
"aGlobalFunction",[](){
return ns2::aGlobalFunction();});
50 m_ns2.
def(
"overloadedGlobalFunction",[](
const ns1::ClassA&
a){
return ns2::overloadedGlobalFunction(a);},
py::arg(
"a"));
51 m_ns2.
def(
"overloadedGlobalFunction",[](
const ns1::ClassA& a,
double b){
return ns2::overloadedGlobalFunction(a, b);},
py::arg(
"a"),
py::arg(
"b"));
52 py::class_<ClassD, std::shared_ptr<ClassD>>(m_,
"ClassD")
57 py::class_<gtsam::Values, std::shared_ptr<gtsam::Values>>(m_gtsam,
"Values")
59 .def(py::init<const gtsam::Values&>(),
py::arg(
"other"))
66 #include "python/specializations.h"
A non-templated config holding any types of Manifold-group elements.
module_ def_submodule(const char *name, const char *doc=nullptr)
module_ & def(const char *name_, Func &&f, const Extra &...extra)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArgReturnType arg() const
EIGEN_DEVICE_FUNC const Scalar & q
PYBIND11_MODULE(namespaces_py, m_)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)