| 73 | } |
| 74 | |
| 75 | static void setstate(python::object obj, python::tuple state) { |
| 76 | // restore the object's __dict__ |
| 77 | python::dict d = python::extract<python::dict>(obj.attr("__dict__")); |
| 78 | d.update(state[0]); |
| 79 | |
| 80 | // restore the C++ object |
| 81 | python::object o = state[1]; |
| 82 | iostreams::stream<iostreams::array_source> is(PyBytes_AS_STRING(o.ptr()), |
| 83 | PyBytes_Size(o.ptr())); |
| 84 | archive::text_iarchive ia(is); |
| 85 | ia >> python::extract<T&>(obj)(); |
| 86 | } |
| 87 | |
| 88 | static bool getstate_manages_dict() { return true; } |
| 89 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected