| 378 | typename mem_manager |
| 379 | > |
| 380 | void serialize ( |
| 381 | const array2d<T,mem_manager>& item, |
| 382 | std::ostream& out |
| 383 | ) |
| 384 | { |
| 385 | try |
| 386 | { |
| 387 | // The reason the serialization is a little funny is because we are trying to |
| 388 | // maintain backwards compatibility with an older serialization format used by |
| 389 | // dlib while also encoding things in a way that lets the array2d and matrix |
| 390 | // objects have compatible serialization formats. |
| 391 | serialize(-item.nr(),out); |
| 392 | serialize(-item.nc(),out); |
| 393 | |
| 394 | item.reset(); |
| 395 | while (item.move_next()) |
| 396 | serialize(item.element(),out); |
| 397 | item.reset(); |
| 398 | } |
| 399 | catch (serialization_error& e) |
| 400 | { |
| 401 | throw serialization_error(e.info + "\n while serializing object of type array2d"); |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | template < |
| 406 | typename T, |
nothing calls this directly
no test coverage detected