.. _program_listing_file__tmp_ws_src_eigenpy_include_eigenpy_pickle-vector.hpp: Program Listing for File pickle-vector.hpp ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/eigenpy/include/eigenpy/pickle-vector.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // // Copyright (c) 2019-2020 CNRS INRIA // #ifndef __eigenpy_utils_pickle_vector_hpp__ #define __eigenpy_utils_pickle_vector_hpp__ #include #include #include namespace eigenpy { template struct PickleVector : boost::python::pickle_suite { static boost::python::tuple getinitargs(const VecType&) { return boost::python::make_tuple(); } static boost::python::tuple getstate(boost::python::object op) { return boost::python::make_tuple( boost::python::list(boost::python::extract(op)())); } static void setstate(boost::python::object op, boost::python::tuple tup) { if (boost::python::len(tup) > 0) { VecType& o = boost::python::extract(op)(); boost::python::stl_input_iterator begin( tup[0]), end; while (begin != end) { o.push_back(*begin); ++begin; } } } static bool getstate_manages_dict() { return true; } }; } // namespace eigenpy #endif // ifndef __eigenpy_utils_pickle_vector_hpp__