Changeset 517:2b6d5d22bb23 in lemon1.2 for lemon/lgf_reader.h
 Timestamp:
 02/20/09 22:37:19 (13 years ago)
 Branch:
 default
 Parents:
 516:dab9e610e37d (diff), 488:b1ef32ab39f3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.  Phase:
 public
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

lemon/lgf_reader.h
r487 r517 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003200 85 * Copyright (C) 20032009 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 848 848 readLine(); 849 849 } 850 line.putback(c); 850 if (readSuccess()) { 851 line.putback(c); 852 } 851 853 } 852 854 … … 1688 1690 readLine(); 1689 1691 } 1690 line.putback(c); 1692 if (readSuccess()) { 1693 line.putback(c); 1694 } 1691 1695 } 1692 1696 … … 2245 2249 readLine(); 2246 2250 } 2247 line.putback(c); 2251 if (readSuccess()) { 2252 line.putback(c); 2253 } 2248 2254 } 2249 2255 … … 2586 2592 readLine(); 2587 2593 } 2588 line.putback(c); 2594 if (readSuccess()) { 2595 line.putback(c); 2596 } 2589 2597 } 2590 2598 
lemon/lgf_reader.h
r440 r517 391 391 class DigraphReader; 392 392 393 /// \brief Return a \ref DigraphReader class394 ///395 /// This function just returns a \ref DigraphReader class.396 /// \relates DigraphReader397 393 template <typename Digraph> 398 DigraphReader<Digraph> digraphReader(Digraph& digraph, 399 std::istream& is = std::cin) { 400 DigraphReader<Digraph> tmp(digraph, is); 401 return tmp; 402 } 403 404 /// \brief Return a \ref DigraphReader class 405 /// 406 /// This function just returns a \ref DigraphReader class. 407 /// \relates DigraphReader 394 DigraphReader<Digraph> digraphReader(Digraph& digraph, 395 std::istream& is = std::cin); 408 396 template <typename Digraph> 409 DigraphReader<Digraph> digraphReader(Digraph& digraph, 410 const std::string& fn) { 411 DigraphReader<Digraph> tmp(digraph, fn); 412 return tmp; 413 } 414 415 /// \brief Return a \ref DigraphReader class 416 /// 417 /// This function just returns a \ref DigraphReader class. 418 /// \relates DigraphReader 397 DigraphReader<Digraph> digraphReader(Digraph& digraph, const std::string& fn); 419 398 template <typename Digraph> 420 DigraphReader<Digraph> digraphReader(Digraph& digraph, const char* fn) { 421 DigraphReader<Digraph> tmp(digraph, fn); 422 return tmp; 423 } 399 DigraphReader<Digraph> digraphReader(Digraph& digraph, const char *fn); 424 400 425 401 /// \ingroup lemon_io … … 585 561 private: 586 562 587 friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph, 588 std::istream& is); 589 friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph, 590 const std::string& fn); 591 friend DigraphReader<Digraph> digraphReader<>(Digraph& digraph, 592 const char *fn); 563 template <typename DGR> 564 friend DigraphReader<DGR> digraphReader(DGR& digraph, std::istream& is); 565 template <typename DGR> 566 friend DigraphReader<DGR> digraphReader(DGR& digraph, 567 const std::string& fn); 568 template <typename DGR> 569 friend DigraphReader<DGR> digraphReader(DGR& digraph, const char *fn); 593 570 594 571 DigraphReader(DigraphReader& other) … … 1213 1190 }; 1214 1191 1192 /// \brief Return a \ref DigraphReader class 1193 /// 1194 /// This function just returns a \ref DigraphReader class. 1195 /// \relates DigraphReader 1196 template <typename Digraph> 1197 DigraphReader<Digraph> digraphReader(Digraph& digraph, std::istream& is) { 1198 DigraphReader<Digraph> tmp(digraph, is); 1199 return tmp; 1200 } 1201 1202 /// \brief Return a \ref DigraphReader class 1203 /// 1204 /// This function just returns a \ref DigraphReader class. 1205 /// \relates DigraphReader 1206 template <typename Digraph> 1207 DigraphReader<Digraph> digraphReader(Digraph& digraph, 1208 const std::string& fn) { 1209 DigraphReader<Digraph> tmp(digraph, fn); 1210 return tmp; 1211 } 1212 1213 /// \brief Return a \ref DigraphReader class 1214 /// 1215 /// This function just returns a \ref DigraphReader class. 1216 /// \relates DigraphReader 1217 template <typename Digraph> 1218 DigraphReader<Digraph> digraphReader(Digraph& digraph, const char* fn) { 1219 DigraphReader<Digraph> tmp(digraph, fn); 1220 return tmp; 1221 } 1222 1215 1223 template <typename Graph> 1216 1224 class GraphReader; 1217 1218 /// \brief Return a \ref GraphReader class 1219 /// 1220 /// This function just returns a \ref GraphReader class. 1221 /// \relates GraphReader 1225 1222 1226 template <typename Graph> 1223 GraphReader<Graph> graphReader(Graph& graph, std::istream& is = std::cin) { 1224 GraphReader<Graph> tmp(graph, is); 1225 return tmp; 1226 } 1227 1228 /// \brief Return a \ref GraphReader class 1229 /// 1230 /// This function just returns a \ref GraphReader class. 1231 /// \relates GraphReader 1227 GraphReader<Graph> graphReader(Graph& graph, 1228 std::istream& is = std::cin); 1232 1229 template <typename Graph> 1233 GraphReader<Graph> graphReader(Graph& graph, const std::string& fn) { 1234 GraphReader<Graph> tmp(graph, fn); 1235 return tmp; 1236 } 1237 1238 /// \brief Return a \ref GraphReader class 1239 /// 1240 /// This function just returns a \ref GraphReader class. 1241 /// \relates GraphReader 1230 GraphReader<Graph> graphReader(Graph& graph, const std::string& fn); 1242 1231 template <typename Graph> 1243 GraphReader<Graph> graphReader(Graph& graph, const char* fn) { 1244 GraphReader<Graph> tmp(graph, fn); 1245 return tmp; 1246 } 1232 GraphReader<Graph> graphReader(Graph& graph, const char *fn); 1247 1233 1248 1234 /// \ingroup lemon_io … … 1371 1357 1372 1358 private: 1373 friend GraphReader<Graph> graphReader<>(Graph& graph, std::istream& is); 1374 friend GraphReader<Graph> graphReader<>(Graph& graph, 1375 const std::string& fn); 1376 friend GraphReader<Graph> graphReader<>(Graph& graph, const char *fn); 1359 template <typename GR> 1360 friend GraphReader<GR> graphReader(GR& graph, std::istream& is); 1361 template <typename GR> 1362 friend GraphReader<GR> graphReader(GR& graph, const std::string& fn); 1363 template <typename GR> 1364 friend GraphReader<GR> graphReader(GR& graph, const char *fn); 1377 1365 1378 1366 GraphReader(GraphReader& other) … … 2044 2032 2045 2033 }; 2034 2035 /// \brief Return a \ref GraphReader class 2036 /// 2037 /// This function just returns a \ref GraphReader class. 2038 /// \relates GraphReader 2039 template <typename Graph> 2040 GraphReader<Graph> graphReader(Graph& graph, std::istream& is) { 2041 GraphReader<Graph> tmp(graph, is); 2042 return tmp; 2043 } 2044 2045 /// \brief Return a \ref GraphReader class 2046 /// 2047 /// This function just returns a \ref GraphReader class. 2048 /// \relates GraphReader 2049 template <typename Graph> 2050 GraphReader<Graph> graphReader(Graph& graph, const std::string& fn) { 2051 GraphReader<Graph> tmp(graph, fn); 2052 return tmp; 2053 } 2054 2055 /// \brief Return a \ref GraphReader class 2056 /// 2057 /// This function just returns a \ref GraphReader class. 2058 /// \relates GraphReader 2059 template <typename Graph> 2060 GraphReader<Graph> graphReader(Graph& graph, const char* fn) { 2061 GraphReader<Graph> tmp(graph, fn); 2062 return tmp; 2063 } 2046 2064 2047 2065 class SectionReader;
Note: See TracChangeset
for help on using the changeset viewer.