1 #ifndef DYNAMIC_GRAPH_PYTHON_MODULE_HH 2 #define DYNAMIC_GRAPH_PYTHON_MODULE_HH 4 #ifdef PINOCCHIO_WITH_URDFDOM 6 #include <pinocchio/fwd.hpp> 9 #include <boost/python.hpp> 10 #include <boost/mpl/for_each.hpp> 12 #include <dynamic-graph/entity.h> 23 template <
typename T,
int Options = AddCommands | AddSignals>
26 assert(dynamic_cast<T*>(ent) != NULL);
27 bp::object obj(bp::ptr(static_cast<T*>(ent)));
32 template <
typename T,
int Options = AddCommands | AddSignals>
34 return makeEntity1<T, Options>(
"");
45 template <
typename T,
typename bases = boost::python::bases<dynamicgraph::Entity>,
46 int Options = AddCommands | AddSignals>
49 std::string hiddenClassName(T::CLASS_NAME);
50 namespace bp = boost::python;
51 bp::class_<T, bases, boost::noncopyable> obj(hiddenClassName.c_str(), bp::init<std::string>());
71 bp::def(T::CLASS_NAME.c_str(), &internal::makeEntity1<T, Options>);
72 bp::def(T::CLASS_NAME.c_str(), &internal::makeEntity2<T, Options>);
81 #endif // DYNAMIC_GRAPH_PYTHON_MODULE_HH bp::object makeEntity2()
Definition: module.hh:33
void addSignals(boost::python::object obj)
bp::object makeEntity1(const char *name)
Definition: module.hh:24
constexpr int AddCommands
Definition: module.hh:19
auto exposeEntity()
Definition: module.hh:47
constexpr int AddSignals
Definition: module.hh:18
void addCommands(boost::python::object obj)
Definition: convert-dg-to-py.hh:8
Entity * create(const char *type, const char *name)
Create an instance of Entity.
Definition: entity-py.cc:57