copyable.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016-2021 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_python_utils_copyable_hpp__
6 #define __pinocchio_python_utils_copyable_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>
22  : public bp::def_visitor< CopyableVisitor<C> >
23  {
24  template<class PyClass>
25  void visit(PyClass & cl) const
26  { cl.def("copy",&copy,bp::arg("self"),"Returns a copy of *this."); }
27 
28  private:
29  static C copy(const C & self) { return C(self); }
30  };
31  } // namespace python
32 } // namespace pinocchio
33 
34 #endif // ifndef __pinocchio_python_utils_copyable_hpp__
static C copy(const C &self)
Definition: copyable.hpp:29
void visit(PyClass &cl) const
Definition: copyable.hpp:25
C
Definition: dcrba.py:412
Add the Python method copy to allow a copy of this by calling the copy constructor.
Definition: copyable.hpp:21
Main pinocchio namespace.
Definition: timings.cpp:28


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