MCPcopy Create free account
hub / github.com/cactus-compute/cactus / read_graph_header

Function read_graph_header

cactus/graph/graph_io.cpp:366–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364 }
365
366 GraphFile::GraphHeader read_graph_header(std::istream& in) {
367 GraphFile::GraphHeader header;
368 header.magic = read_u32(in);
369 header.version = read_u32(in);
370 header.node_count = read_u32(in);
371 header.flags = read_u32(in);
372
373 if (header.magic != CACTUS_GRAPH_MAGIC) {
374 throw std::runtime_error("Invalid graph file: bad magic");
375 }
376 if (header.version != 1) {
377 throw std::runtime_error("Unsupported graph file version: " +
378 std::to_string(header.version));
379 }
380
381 return header;
382 }
383
384 GraphFile::NodeEntry read_node_entry(std::istream& in) {
385 GraphFile::NodeEntry node;

Callers 1

load_graphFunction · 0.85

Calls 1

read_u32Function · 0.85

Tested by

no test coverage detected