1 #ifndef GRAPH_ANALYSIS_IO_HPP 2 #define GRAPH_ANALYSIS_IO_HPP 9 namespace representation {
15 extern std::map<Type, std::string>
TypeTxt;
22 const std::string
CLASS(
"0");
23 const std::string
LABEL(
"1");
33 typedef shared_ptr<Writer>
Ptr;
42 void write(
const std::string& filename,
const BaseGraph& graph)
const;
48 virtual void write(
const std::string& filename,
const BaseGraph::Ptr& graph)
const { (void)filename; (void)graph;
throw std::runtime_error(
"Writer: writer not implemented"); }
59 typedef shared_ptr<Reader>
Ptr;
63 void read(
const std::string& filename,
BaseGraph& graph);
65 virtual void read(
const std::string& filename,
BaseGraph::Ptr graph) { (void) filename; (void) graph;
throw std::runtime_error(
"Reader: reader not implemented"); }
249 typedef std::map<representation::Type, Writer::Ptr>
WriterMap;
250 typedef std::map<representation::Type, Reader::Ptr>
ReaderMap;
251 typedef std::map<representation::Suffix, representation::Type>
SuffixMap;
269 static WriterMap msWriters;
270 static ReaderMap msReaders;
271 static SuffixMap msSuffixes;
277 #endif //GRAPH_ANALYSIS_IO_HPP std::string Suffix
Definition: GraphIO.hpp:13
std::map< representation::Suffix, representation::Type > SuffixMap
Definition: GraphIO.hpp:251
std::map< representation::Type, Writer::Ptr > WriterMap
Definition: GraphIO.hpp:249
Definition: GraphIO.hpp:11
Main class for handling I/O for graphs.
Definition: GraphIO.hpp:246
Definition: GraphIO.hpp:11
shared_ptr< Reader > Ptr
Definition: GraphIO.hpp:59
Interface for Reader implementation that perform custom graph deserialization.
Definition: GraphIO.hpp:56
virtual ~Writer()
Definition: GraphIO.hpp:35
General Graph template that should be implemented to wrap specific graph library functionality We ass...
Definition: BaseGraph.hpp:27
virtual ~Reader()
Definition: GraphIO.hpp:61
shared_ptr< Writer > Ptr
Definition: GraphIO.hpp:33
static ReaderMap getReaderMap()
Definition: GraphIO.hpp:260
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
Definition: GraphIO.hpp:11
std::map< representation::Type, Reader::Ptr > ReaderMap
Definition: GraphIO.hpp:250
Definition: GraphIO.hpp:11
const std::string LABEL("1")
Definition: GraphIO.hpp:11
shared_ptr< GraphElement > Ptr
Definition: GraphElement.hpp:46
Interface for Writer implementations that perform custom graph serialization.
Definition: GraphIO.hpp:30
void setUuid(const GraphElement::Ptr &element, const std::string &uuid) const
Definition: GraphIO.hpp:70
Definition: GraphIO.hpp:11
virtual void write(const std::string &filename, const BaseGraph::Ptr &graph) const
Definition: GraphIO.hpp:48
static WriterMap getWriterMap()
Definition: GraphIO.hpp:259
Definition: GraphIO.hpp:11
static SuffixMap getSuffixMap()
Definition: GraphIO.hpp:261
Definition: GraphIO.hpp:11
virtual void read(const std::string &filename, BaseGraph::Ptr graph)
Definition: GraphIO.hpp:65
shared_ptr< BaseGraph > Ptr
Definition: BaseGraph.hpp:34
const std::string CLASS("0")
GEXF reader/writer common conventions.
Type
Definition: GraphIO.hpp:11
std::map< Type, std::string > TypeTxt
Definition: GraphIO.cpp:20