MCPcopy Create free account
hub / github.com/davisking/dlib / serialize

Function serialize

dlib/array2d/array2d_kernel.h:380–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 5

serialization_errorClass · 0.85
nrMethod · 0.45
ncMethod · 0.45
resetMethod · 0.45
move_nextMethod · 0.45

Tested by

no test coverage detected