2 #ifndef ANDRES_GRAPH_COMPLETE_GRAPH_HDF5_HXX
3 #define ANDRES_GRAPH_COMPLETE_GRAPH_HDF5_HXX
9 #include "../complete-graph.hxx"
16 template<
class VISITOR>
20 template<
class VISITOR>
21 const int GraphTraitsHDF5<CompleteGraph<VISITOR> >::ID = 10002;
23 template <
class VISITOR>
26 template <
class VISITOR>
29 template <
class VISITOR>
32 const hid_t parentHandle,
33 const std::string& graphName,
37 hdf5::HandleCheck<ANDRES_GRAPH_HDF5_DEBUG> handleCheck;
38 hid_t groupHandle =
openGroup(parentHandle, graphName,
true);
42 int ID = GraphTraitsHDF5<Graph>::ID;
43 save(groupHandle,
"graph-type-id", ID);
44 }
catch (std::exception& e) {
49 throw std::runtime_error(
"error saving complete graph: " + sError);
53 template <
class VISITOR>
56 const hid_t parentHandle,
57 const std::string& graphName,
61 hdf5::HandleCheck<ANDRES_GRAPH_HDF5_DEBUG> handleCheck;
62 hid_t groupHandle =
openGroup(parentHandle, graphName);
67 load(groupHandle,
"graph-type-id", ID);
68 if(ID != GraphTraitsHDF5<CompleteGraph>::ID) {
69 sError =
"Stored graph type is not a CompleteGraph.";
73 std::size_t numberOfVertices;
74 load(groupHandle,
"number-of-vertices", numberOfVertices);
75 graph.
assign(numberOfVertices);
77 catch(std::exception& e) {
84 throw std::runtime_error(
"error loading complete graph: " + sError);
92 #endif // #ifndef ANDRES_GRAPH_COMPLETE_GRAPH_HDF5_HXX