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