1.1 --- a/src/lemon/graph_reader.h Thu May 19 11:46:42 2005 +0000
1.2 +++ b/src/lemon/graph_reader.h Thu May 19 11:49:42 2005 +0000
1.3 @@ -299,6 +299,22 @@
1.4 reader->run();
1.5 }
1.6
1.7 + /// \brief Gives back the node by its id.
1.8 + ///
1.9 + /// It reads an id from the stream and gives back which node belongs to
1.10 + /// it. It is possible only if there was read an "id" named node map.
1.11 + Node readId(std::istream& is, Node) const {
1.12 + return nodeset_reader.readId(is, Node());
1.13 + }
1.14 +
1.15 + /// \brief Gives back the edge by its id.
1.16 + ///
1.17 + /// It reads an id from the stream and gives back which edge belongs to
1.18 + /// it. It is possible only if there was read an "id" named edge map.
1.19 + Edge readId(std::istream& is, Edge) const {
1.20 + return edgeset_reader.readId(is, Edge());
1.21 + }
1.22 +
1.23 private:
1.24
1.25 LemonReader* reader;
1.26 @@ -673,6 +689,13 @@
1.27 /// \brief Add a new labeled edge reader for the reader.
1.28 ///
1.29 /// Add a new labeled edge reader for the reader.
1.30 + UndirGraphReader& readEdge(std::string name, Edge& edge) {
1.31 + undir_edge_reader.readEdge(name, edge);
1.32 + }
1.33 +
1.34 + /// \brief Add a new labeled undirected edge reader for the reader.
1.35 + ///
1.36 + /// Add a new labeled undirected edge reader for the reader.
1.37 UndirGraphReader& readUndirEdge(std::string name, UndirEdge& edge) {
1.38 undir_edge_reader.readUndirEdge(name, edge);
1.39 }
1.40 @@ -713,6 +736,32 @@
1.41 reader->run();
1.42 }
1.43
1.44 + /// \brief Gives back the node by its id.
1.45 + ///
1.46 + /// It reads an id from the stream and gives back which node belongs to
1.47 + /// it. It is possible only if there was read an "id" named node map.
1.48 + Node readId(std::istream& is, Node) const {
1.49 + return nodeset_reader.readId(is, Node());
1.50 + }
1.51 +
1.52 + /// \brief Gives back the edge by its id.
1.53 + ///
1.54 + /// It reads an id from the stream and gives back which edge belongs to
1.55 + /// it. It is possible only if there was read an "id" named edge map.
1.56 + Edge readId(std::istream& is, Edge) const {
1.57 + return undir_edgeset_reader.readId(is, Edge());
1.58 + }
1.59 +
1.60 + /// \brief Gives back the undirected edge by its id.
1.61 + ///
1.62 + /// It reads an id from the stream and gives back which undirected edge
1.63 + /// belongs to it. It is possible only if there was read an "id" named
1.64 + /// edge map.
1.65 + UndirEdge readId(std::istream& is, UndirEdge) const {
1.66 + return undir_edgeset_reader.readId(is, UndirEdge());
1.67 + }
1.68 +
1.69 +
1.70 private:
1.71
1.72 LemonReader* reader;