Go to the documentation of this file. 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;
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;
277 #endif //GRAPH_ANALYSIS_IO_HPP
static std::string appendSuffix(const std::string &filename, representation::Type format)
Definition: GraphIO.cpp:190
@ LEMON
Definition: GraphIO.hpp:11
static WriterMap getWriterMap()
Definition: GraphIO.hpp:259
static std::string write(const std::string &filename, const BaseGraph::Ptr &graph, representation::Type format=representation::UNKNOWN)
Definition: GraphIO.cpp:115
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
Interface for Writer implementations that perform custom graph serialization.
Definition: GraphIO.hpp:30
static void read(const std::string &filename, BaseGraph::Ptr graph, representation::Type format=representation::UNKNOWN)
Definition: GraphIO.cpp:158
virtual void read(const std::string &filename, BaseGraph::Ptr graph)
Definition: GraphIO.hpp:65
void read(const std::string &filename, BaseGraph &graph)
Definition: GraphIO.cpp:49
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< BaseGraph > Ptr
Definition: BaseGraph.hpp:34
static representation::Type getTypeFromSuffix(representation::Suffix suffix)
Definition: GraphIO.cpp:163
@ GRAPHVIZ
Definition: GraphIO.hpp:11
void write(const std::string &filename, const BaseGraph &graph) const
Definition: GraphIO.cpp:43
std::string Suffix
Definition: GraphIO.hpp:13
std::map< Type, std::string > TypeTxt
Definition: GraphIO.cpp:20
@ OROGEN_MODEL
Definition: GraphIO.hpp:11
static ReaderMap getReaderMap()
Definition: GraphIO.hpp:260
std::map< representation::Type, Writer::Ptr > WriterMap
Definition: GraphIO.hpp:249
virtual ~Reader()
Definition: GraphIO.hpp:61
virtual void write(const std::string &filename, const BaseGraph::Ptr &graph) const
Definition: GraphIO.hpp:48
@ END_MARKER
Definition: GraphIO.hpp:11
const std::string CLASS("0")
GEXF reader/writer common conventions.
Main class for handling I/O for graphs.
Definition: GraphIO.hpp:246
@ UNKNOWN
Definition: GraphIO.hpp:11
shared_ptr< GraphElement > Ptr
Definition: GraphElement.hpp:46
shared_ptr< Reader > Ptr
Definition: GraphIO.hpp:59
static SuffixMap getSuffixMap()
Definition: GraphIO.hpp:261
static representation::Type getTypeFromFilename(const std::string &filename)
Definition: GraphIO.cpp:174
@ YAML
Definition: GraphIO.hpp:11
@ GRAPHML
Definition: GraphIO.hpp:11
static representation::Suffix getSuffix(representation::Type format)
Definition: GraphIO.cpp:211
shared_ptr< Writer > Ptr
Definition: GraphIO.hpp:33
const std::string LABEL("1")
Type
Definition: GraphIO.hpp:11
Interface for Reader implementation that perform custom graph deserialization.
Definition: GraphIO.hpp:56
std::map< representation::Suffix, representation::Type > SuffixMap
Definition: GraphIO.hpp:251
@ GEXF
Definition: GraphIO.hpp:11
std::map< representation::Type, Reader::Ptr > ReaderMap
Definition: GraphIO.hpp:250
void setUuid(const GraphElement::Ptr &element, const std::string &uuid) const
Definition: GraphIO.hpp:70