5 #ifndef __pinocchio_python_utils_list_hpp__ 6 #define __pinocchio_python_utils_list_hpp__ 12 #include <boost/python.hpp> 13 #include <boost/python/type_id.hpp> 23 template<
typename T,
class Allocator>
24 void extract(
const boost::python::list & list, std::vector<T,Allocator> & vec)
28 size_t size_list = (size_t)bp::len(list);
29 vec.resize(size_list);
30 for(
size_t i = 0;
i < size_list; ++
i)
32 bp::extract<T> input_T(list[
i]);
37 const std::string classname
38 = bp::extract<std::string>(list[
i].attr(
"__class__").attr(
"__name__"));
40 ss <<
"The conversion from " << classname <<
" to " 41 << bp::type_id<T>().
name() <<
" has failed." << std::endl;
48 std::vector<T,std::allocator<T> >
extract(
const boost::python::list & list)
50 std::vector<T,std::allocator<T> >
vec;
55 template<
typename T,
class Allocator>
56 std::vector<T,Allocator>
extract(
const boost::python::list & list)
58 std::vector<T,Allocator>
vec;
66 #endif // ifndef __pinocchio_python_utils_list_hpp__
std::string name(const LieGroupGenericTpl< LieGroupCollection > &lg)
Visit a LieGroupVariant to get the name of it.
Main pinocchio namespace.
void extract(const boost::python::list &list, std::vector< T, Allocator > &vec)