Changeset 1530:d99c3c84f797 in lemon-0.x for demo/reader_writer_demo.cc
- Timestamp:
- 07/04/05 15:08:31 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2021
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/reader_writer_demo.cc
r1528 r1530 16 16 SmartGraph::EdgeMap<int> cap(graph); 17 17 reader.readEdgeMap("capacity",cap); 18 // reader.readNode("source",s).readNode("target",t)19 // .readEdgeMap("capacity",cap).run();20 18 reader.run(); 21 19 … … 31 29 writer.run(); 32 30 33 // LemonReader reader(std::cin);34 35 // NodeSetReader<SmartGraph> nodeset(reader, graph);36 // SmartGraph::NodeMap<int> cost(graph);37 // nodeset.readMap("cost", cost);38 // SmartGraph::NodeMap<char> mmap(graph);39 // nodeset.readMap("mmap", mmap);40 41 // EdgeSetReader<SmartGraph> edgeset(reader, graph, nodeset);42 // SmartGraph::EdgeMap<std::string> description(graph);43 // edgeset.readMap<QuotedStringReader>("description", description);44 45 // NodeReader<SmartGraph> nodes(reader, nodeset);46 // SmartGraph::Node source;47 // nodes.readNode("source", source);48 // SmartGraph::Node target;49 // nodes.readNode("target", target);50 51 // AttributeReader<> attribute(reader, "gui");52 // std::string author;53 // attribute.readAttribute<LineReader>("author", author);54 // int count;55 // attribute.readAttribute("count", count);56 57 // PrintReader print(reader);58 59 // reader.run();60 61 62 // for (SmartGraph::NodeIt it(graph); it != INVALID; ++it) {63 // std::cout << cost[it] << ' ' << mmap[it] << std::endl;64 // }65 66 // for (SmartGraph::EdgeIt it(graph); it != INVALID; ++it) {67 // std::cout << description[it] << std::endl;68 // }69 70 // std::cout << "author: " << author << std::endl;71 // std::cout << "count: " << count << std::endl;72 73 // std::cout << "source cost: " << cost[source] << std::endl;74 // std::cout << "target cost: " << cost[target] << std::endl;75 76 // std::cout.flush();77 31 } catch (DataFormatError& error) { 78 32 std::cerr << error.what() << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.