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

Function deserialize

dlib/array2d/array2d_kernel.h:409–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407 typename mem_manager
408 >
409 void deserialize (
410 array2d<T,mem_manager>& item,
411 std::istream& in
412 )
413 {
414 try
415 {
416 long nr, nc;
417 deserialize(nr,in);
418 deserialize(nc,in);
419
420 // this is the newer serialization format
421 if (nr < 0 || nc < 0)
422 {
423 nr *= -1;
424 nc *= -1;
425 }
426 else
427 {
428 std::swap(nr,nc);
429 }
430
431 item.set_size(nr,nc);
432
433 while (item.move_next())
434 deserialize(item.element(),in);
435 item.reset();
436 }
437 catch (serialization_error& e)
438 {
439 item.clear();
440 throw serialization_error(e.info + "\n while deserializing object of type array2d");
441 }
442 }
443
444// ----------------------------------------------------------------------------------------
445// ----------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 6

serialization_errorClass · 0.85
swapFunction · 0.70
set_sizeMethod · 0.45
move_nextMethod · 0.45
resetMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected