5 #ifndef __eigenpy_utils_pickle_vector_hpp__
6 #define __eigenpy_utils_pickle_vector_hpp__
8 #include <boost/python.hpp>
9 #include <boost/python/stl_iterator.hpp>
10 #include <boost/python/tuple.hpp>
18 template <
typename VecType>
21 return boost::python::make_tuple();
24 static boost::python::tuple
getstate(boost::python::object op) {
25 return boost::python::make_tuple(
26 boost::python::list(boost::python::extract<const VecType&>(op)()));
29 static void setstate(boost::python::object op, boost::python::tuple tup) {
30 if (boost::python::len(tup) > 0) {
31 VecType& o = boost::python::extract<VecType&>(op)();
32 boost::python::stl_input_iterator<typename VecType::value_type> begin(
35 while (begin != end) {
46 #endif // ifndef __eigenpy_utils_pickle_vector_hpp__