5 #ifndef __pinocchio_python_utils_pickle_vector_hpp__ 6 #define __pinocchio_python_utils_pickle_vector_hpp__ 8 #include <boost/python.hpp> 9 #include <boost/python/tuple.hpp> 10 #include <boost/python/stl_iterator.hpp> 21 template<
typename VecType>
25 {
return boost::python::make_tuple(); }
27 static boost::python::tuple
getstate(boost::python::object op)
29 return boost::python::make_tuple(boost::python::list(boost::python::extract<const VecType&>(op)()));
32 static void setstate(boost::python::object op, boost::python::tuple tup)
34 if(boost::python::len(tup) > 0)
36 VecType &
o = boost::python::extract<VecType&>(op)();
37 boost::python::stl_input_iterator<typename VecType::value_type> begin(tup[0]), end;
51 #endif // ifndef __pinocchio_python_utils_pickle_vector_hpp__ static void setstate(boost::python::object op, boost::python::tuple tup)
static boost::python::tuple getinitargs(const VecType &)
Create a pickle interface for the std::vector and aligned vector.
static bool getstate_manages_dict()
Main pinocchio namespace.
static boost::python::tuple getstate(boost::python::object op)