graph_analysis
YamlWriter.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_IO_YAMLEXPORTWRITER_HPP
2 #define GRAPH_ANALYSIS_IO_YAMLEXPORTWRITER_HPP
3 
4 #include <string>
5 #include <fstream>
6 #include <stdexcept>
7 #include "../GraphIO.hpp"
8 
9 namespace graph_analysis {
10 namespace io {
11 
18 class YamlWriter : public Writer
19 {
20 private:
27  void exportVertex(const BaseGraph::Ptr& graph, std::ofstream& fout, Vertex::Ptr vertex) const;
34  void exportEdge(const BaseGraph::Ptr& graph, std::ofstream& fout, Edge::Ptr edge) const;
35 public:
41  void write(const std::string& filename, const BaseGraph& graph) const;
47  void write(const std::string& filename, const BaseGraph::Ptr& graph) const;
48 };
49 
50 } // end namespace io
51 } // end namespace graph_analysis
52 #endif // GRAPH_ANALYSIS_IO_YAMLEXPORTWRITER_HPP
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
Custom yml graph exporter.
Definition: YamlWriter.hpp:18
General Graph template that should be implemented to wrap specific graph library functionality We ass...
Definition: BaseGraph.hpp:27
void write(const std::string &filename, const BaseGraph &graph) const
outputs the given graph to the given file
Definition: YamlWriter.cpp:9
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
Interface for Writer implementations that perform custom graph serialization.
Definition: GraphIO.hpp:30
shared_ptr< BaseGraph > Ptr
Definition: BaseGraph.hpp:34