robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
pybind11_macros.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_PYBIND11_MACROS_HPP_
2#define ROBOTOC_PYBIND11_MACROS_HPP_
3
4#include <iostream>
5#include <sstream>
6
7namespace robotoc {
8
9#define DEFINE_ROBOTOC_PYBIND11_CLASS_CLONE(CLASS) \
10.def("clone", [](const CLASS& self) { \
11 auto copy = self; \
12 return copy; \
13})
14
15#define DEFINE_ROBOTOC_PYBIND11_CLASS_PRINT(CLASS) \
16.def("__str__", [](const CLASS& self) { \
17 std::stringstream ss; \
18 ss << self; \
19 return ss.str(); \
20})
21
22} // namespace robotoc
23
24#endif // ROBOTOC_PYBIND11_MACROS_HPP_
Definition: constraint_component_base.hpp:17