5 #ifndef __pinocchio_python_utils_std_aligned_vector_hpp__
6 #define __pinocchio_python_utils_std_aligned_vector_hpp__
8 #include <boost/python.hpp>
30 template<
class T,
bool NoProxy = false,
bool EnableFromPythonListConverter = true>
32 :
public ::boost::python::vector_indexing_suite<
33 typename container::aligned_vector<T>,
36 contains_vector_derived_policies<typename container::aligned_vector<T>, NoProxy>>
43 static void expose(
const std::string & class_name,
const std::string & doc_string =
"")
48 template<
typename VisitorDerived>
50 const std::string & class_name,
const boost::python::def_visitor<VisitorDerived> & visitor)
52 expose(class_name,
"", visitor);
55 template<
typename VisitorDerived>
57 const std::string & class_name,
58 const std::string & doc_string,
59 const boost::python::def_visitor<VisitorDerived> & visitor)
62 if (!eigenpy::register_symbolic_link_to_registered_type<vector_type>())
64 bp::class_<vector_type>
cl(class_name.c_str(), doc_string.c_str());
67 .def(bp::init<size_t, const value_type &>(
68 bp::args(
"self",
"size",
"value"),
69 "Constructor from a given size and a given value."))
70 .def(bp::init<const vector_type &>(bp::args(
"self",
"other"),
"Copy constructor"))
74 (bp::arg(
"self"), bp::arg(
"deep_copy") =
false),
75 "Returns the aligned_vector as a Python list.")
77 #ifndef PINOCCHIO_PYTHON_NO_SERIALIZATION
83 if (EnableFromPythonListConverter)
91 #endif // ifndef __pinocchio_python_utils_std_aligned_vector_hpp__