| 15 | |
| 16 | template<typename T> |
| 17 | py::tuple getstate(const T& item) |
| 18 | { |
| 19 | using namespace dlib; |
| 20 | std::vector<char> buf; |
| 21 | buf.reserve(5000); |
| 22 | vectorstream sout(buf); |
| 23 | serialize(item, sout); |
| 24 | return py::make_tuple(py::handle( |
| 25 | PyBytes_FromStringAndSize(buf.size()?&buf[0]:0, buf.size()))); |
| 26 | } |
| 27 | |
| 28 | template<typename T> |
| 29 | T setstate(py::tuple state) |
nothing calls this directly
no test coverage detected