pinocchio 4.1.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#pragma once
6
7#include <boost/python.hpp>
8
9namespace pinocchio
10{
11 namespace python
12 {
13
14 namespace bp = boost::python;
15
19 template<class C, bool has_comparison_operators = true>
21 : public bp::def_visitor<ComparableVisitor<C, has_comparison_operators>>
22 {
23 template<class PyClass>
24 void visit(PyClass & cl) const
25 {
26 cl.def(bp::self == bp::self).def(bp::self != bp::self);
27 }
28 };
29
30 template<class C>
31 struct ComparableVisitor<C, false> : public bp::def_visitor<ComparableVisitor<C, false>>
32 {
33 template<class PyClass>
34 void visit(PyClass &) const
35 {
36 }
37 };
38 } // namespace python
39} // namespace pinocchio
Main pinocchio namespace.
Definition treeview.dox:11
Add the Python method == and != to allow a comparison of this.