printable.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016 CNRS
3 //
4 
5 #ifndef __pinocchio_python_utils_printable_hpp__
6 #define __pinocchio_python_utils_printable_hpp__
7 
8 #include <boost/python.hpp>
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14 
15  namespace bp = boost::python;
16 
20  template<class C>
21  struct PrintableVisitor : public bp::def_visitor< PrintableVisitor<C> >
22  {
23  template<class PyClass>
24  void visit(PyClass & cl) const
25  {
26  cl
27  .def(bp::self_ns::str(bp::self_ns::self))
28  .def(bp::self_ns::repr(bp::self_ns::self))
29  ;
30  }
31  };
32  } // namespace python
33 } // namespace pinocchio
34 
35 #endif // ifndef __pinocchio_python_utils_printable_hpp__
Set the Python method str and repr to use the overloading operator<<.
Definition: printable.hpp:21
void visit(PyClass &cl) const
Definition: printable.hpp:24
Main pinocchio namespace.
Definition: timings.cpp:28


pinocchio
Author(s):
autogenerated on Fri Jun 23 2023 02:38:32