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

Function serialize

dlib/directed_graph/directed_graph_kernel_1.h:410–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408 bool is_checked
409 >
410 void serialize (
411 const directed_graph_kernel_1<T,E,mem_manager,is_checked>& item,
412 std::ostream& out
413 )
414 {
415 try
416 {
417 serialize(item.number_of_nodes(), out);
418
419 // serialize each node
420 for (unsigned long i = 0; i < item.number_of_nodes(); ++i)
421 {
422 serialize(item.node(i).data, out);
423
424 // serialize all the child edges
425 serialize(item.node(i).number_of_children(), out);
426 for (unsigned long c = 0; c < item.node(i).number_of_children(); ++c)
427 {
428 serialize(item.node(i).child(c).index(), out);
429 serialize(item.node(i).child_edge(c), out);
430 }
431 }
432 }
433 catch (serialization_error& e)
434 {
435 throw serialization_error(e.info + "\n while serializing object of type directed_graph_kernel_1");
436 }
437 }
438
439// ----------------------------------------------------------------------------------------
440

Callers

nothing calls this directly

Calls 4

serialization_errorClass · 0.85
number_of_childrenMethod · 0.80
number_of_nodesMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected