If you don't need very sophisticated behaviour then you can use the versions of the public function readGraph() to read a graph (or a max flow instance etc).
The given file format may contain several maps and labeled nodes or edges.
If you read a graph you need not read all the maps and items just those that you need. The interface of the UGraphReader
is very similar to the UGraphWriter but the reading method does not depend on the order of the given commands.
The reader object suppose that each not readed value does not contain whitespaces, therefore it has some extra possibilities to control how it should skip the values when the string representation contains spaces.
The reading of the directed edge maps is just a syntactical sugar. It reads two undirected edgemaps into a directed edge map. The undirected edge maps' name should be start with the '+'
and the '-'
character and the same.
|
Public Member Functions |
| UGraphReader (std::istream &_is, Graph &_graph, const DefaultSkipper &_skipper=DefaultSkipper()) |
| Construct a new UGraphReader.
|
| UGraphReader (const std::string &_filename, Graph &_graph, const DefaultSkipper &_skipper=DefaultSkipper()) |
| Construct a new UGraphReader.
|
| UGraphReader (LemonReader &_reader, Graph &_graph, const DefaultSkipper &_skipper=DefaultSkipper()) |
| Construct a new UGraphReader.
|
| ~UGraphReader () |
| Destruct the graph reader.
|
template<typename Map> |
UGraphReader & | readNodeMap (std::string name, Map &map) |
| Give a new node map reading command to the reader.
|
template<typename Reader, typename Map> |
UGraphReader & | readNodeMap (std::string name, Map &map, const Reader &reader=Reader()) |
| Give a new node map reading command to the reader.
|
template<typename Reader> |
UGraphReader & | skipNodeMap (std::string name, const Reader &reader=Reader()) |
| Give a new node map skipping command to the reader.
|
template<typename Map> |
UGraphReader & | readUEdgeMap (std::string name, Map &map) |
| Give a new undirected edge map reading command to the reader.
|
template<typename Reader, typename Map> |
UGraphReader & | readUEdgeMap (std::string name, Map &map, const Reader &reader=Reader()) |
| Give a new undirected edge map reading command to the reader.
|
template<typename Reader> |
UGraphReader & | skipUEdgeMap (std::string name, const Reader &reader=Reader()) |
| Give a new undirected edge map skipping command to the reader.
|
template<typename Map> |
UGraphReader & | readEdgeMap (std::string name, Map &map) |
| Give a new edge map reading command to the reader.
|
template<typename Reader, typename Map> |
UGraphReader & | readEdgeMap (std::string name, Map &map, const Reader &reader=Reader()) |
| Give a new edge map reading command to the reader.
|
template<typename Reader> |
UGraphReader & | skipEdgeMap (std::string name, const Reader &reader=Reader()) |
| Give a new edge map skipping command to the reader.
|
UGraphReader & | readNode (std::string name, Node &node) |
| Give a new labeled node reading command to the reader.
|
UGraphReader & | readEdge (std::string name, Edge &edge) |
| Give a new labeled edge reading command to the reader.
|
UGraphReader & | readUEdge (std::string name, UEdge &edge) |
| Give a new labeled undirected edge reading command to the reader.
|
template<typename Value> |
UGraphReader & | readAttribute (std::string name, Value &value) |
| Give a new attribute reading command.
|
template<typename Reader, typename Value> |
UGraphReader & | readAttribute (std::string name, Value &value, const Reader &reader) |
| Give a new attribute reading command.
|
| operator LemonReader & () |
| Conversion operator to LemonReader.
|
void | run () |
| Executes the reading commands.
|
bool | isLabelReader () const |
| Returns true if the reader can give back the items by its label.Returns true if the reader can give back the items by its label.
|
void | readLabel (std::istream &is, Node &node) const |
| Gives back the node by its label.
|
void | readLabel (std::istream &is, Edge &edge) const |
| Gives back the edge by its label.
|
void | readLabel (std::istream &is, UEdge &uedge) const |
| Gives back the undirected edge by its label.
|