pinocchio  3.7.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
 
Loading...
Searching...
No Matches
comparable.hpp
1//
2// Copyright (c) 2020 INRIA
3//
4
5#ifndef __pinocchio_python_utils_comparable_hpp__
6#define __pinocchio_python_utils_comparable_hpp__
7
8#include <boost/python.hpp>
9
10namespace pinocchio
11{
12 namespace python
13 {
14
15 namespace bp = boost::python;
16
20 template<class C, bool has_comparison_operators = true>
21 struct ComparableVisitor
22 : public bp::def_visitor<ComparableVisitor<C, has_comparison_operators>>
23 {
24 template<class PyClass>
25 void visit(PyClass & cl) const
26 {
27 cl.def(bp::self == bp::self).def(bp::self != bp::self);
28 }
29 };
30
31 template<class C>
32 struct ComparableVisitor<C, false> : public bp::def_visitor<ComparableVisitor<C, false>>
33 {
34 template<class PyClass>
35 void visit(PyClass &) const
36 {
37 }
38 };
39 } // namespace python
40} // namespace pinocchio
41
42#endif // ifndef __pinocchio_python_utils_comparable_hpp__
Main pinocchio namespace.
Definition treeview.dox:11