795 |
795 |
796 /// \brief Add a new node map reader command for the reader. |
796 /// \brief Add a new node map reader command for the reader. |
797 /// |
797 /// |
798 /// Add a new node map reader command for the reader. |
798 /// Add a new node map reader command for the reader. |
799 template <typename Map> |
799 template <typename Map> |
800 NodeSetReader& readNodeMap(std::string name, Map& map) { |
800 NodeSetReader& readNodeMap(std::string label, Map& map) { |
801 return _readMap< |
801 return _readMap< |
802 typename Traits::template Reader<typename Map::Value>, Map, |
802 typename Traits::template Reader<typename Map::Value>, Map, |
803 typename _reader_bits::Arg<Map>::Type>(name, map); |
803 typename _reader_bits::Arg<Map>::Type>(label, map); |
804 } |
804 } |
805 |
805 |
806 template <typename Map> |
806 template <typename Map> |
807 NodeSetReader& readNodeMap(std::string name, const Map& map) { |
807 NodeSetReader& readNodeMap(std::string label, const Map& map) { |
808 return _readMap< |
808 return _readMap< |
809 typename Traits::template Reader<typename Map::Value>, Map, |
809 typename Traits::template Reader<typename Map::Value>, Map, |
810 typename _reader_bits::Arg<Map>::Type>(name, map); |
810 typename _reader_bits::Arg<Map>::Type>(label, map); |
811 } |
811 } |
812 |
812 |
813 /// \brief Add a new node map reader command for the reader. |
813 /// \brief Add a new node map reader command for the reader. |
814 /// |
814 /// |
815 /// Add a new node map reader command for the reader. |
815 /// Add a new node map reader command for the reader. |
816 template <typename Reader, typename Map> |
816 template <typename ItemReader, typename Map> |
817 NodeSetReader& readNodeMap(std::string name, Map& map, |
817 NodeSetReader& readNodeMap(std::string label, Map& map, |
818 const Reader& reader = Reader()) { |
818 const ItemReader& ir = ItemReader()) { |
819 return _readMap<Reader, Map, typename _reader_bits::Arg<Map>::Type> |
819 return _readMap<ItemReader, Map, typename _reader_bits::Arg<Map>::Type> |
820 (name, map, reader); |
820 (label, map, ir); |
821 } |
821 } |
822 |
822 |
823 template <typename Reader, typename Map> |
823 template <typename ItemReader, typename Map> |
824 NodeSetReader& readNodeMap(std::string name, const Map& map, |
824 NodeSetReader& readNodeMap(std::string label, const Map& map, |
825 const Reader& reader = Reader()) { |
825 const ItemReader& ir = ItemReader()) { |
826 return _readMap<Reader, Map, typename _reader_bits::Arg<Map>::Type> |
826 return _readMap<ItemReader, Map, typename _reader_bits::Arg<Map>::Type> |
827 (name, map, reader); |
827 (label, map, ir); |
828 } |
828 } |
829 |
829 |
830 private: |
830 private: |
831 |
831 |
832 template <typename Reader, typename Map, typename MapParameter> |
832 template <typename ItemReader, typename Map, typename MapParameter> |
833 NodeSetReader& _readMap(std::string name, MapParameter map, |
833 NodeSetReader& _readMap(std::string label, MapParameter map, |
834 const Reader& reader = Reader()) { |
834 const ItemReader& ir = ItemReader()) { |
835 checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>(); |
835 checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>(); |
836 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
836 checkConcept<_reader_bits::ItemReader<typename Map::Value>, ItemReader>(); |
837 if (readers.find(name) != readers.end()) { |
837 if (readers.find(label) != readers.end()) { |
838 ErrorMessage msg; |
838 ErrorMessage msg; |
839 msg << "Multiple read rule for node map: " << name; |
839 msg << "Multiple read rule for node map: " << label; |
840 throw IoParameterError(msg.message()); |
840 throw IoParameterError(msg.message()); |
841 } |
841 } |
842 readers.insert( |
842 readers.insert( |
843 make_pair(name, new _reader_bits:: |
843 make_pair(label, new _reader_bits:: |
844 MapReader<Node, Map, Reader>(map, reader))); |
844 MapReader<Node, Map, ItemReader>(map, ir))); |
845 return *this; |
845 return *this; |
846 } |
846 } |
847 |
847 |
848 public: |
848 public: |
849 |
849 |
850 /// \brief Add a new node map skipper command for the reader. |
850 /// \brief Add a new node map skipper command for the reader. |
851 /// |
851 /// |
852 /// Add a new node map skipper command for the reader. |
852 /// Add a new node map skipper command for the reader. |
853 template <typename Reader> |
853 template <typename ItemReader> |
854 NodeSetReader& skipNodeMap(std::string name, |
854 NodeSetReader& skipNodeMap(std::string label, |
855 const Reader& reader = Reader()) { |
855 const ItemReader& ir = ItemReader()) { |
856 if (readers.find(name) != readers.end()) { |
856 if (readers.find(label) != readers.end()) { |
857 ErrorMessage msg; |
857 ErrorMessage msg; |
858 msg << "Multiple read rule for node map: " << name; |
858 msg << "Multiple read rule for node map: " << label; |
859 throw IoParameterError(msg.message()); |
859 throw IoParameterError(msg.message()); |
860 } |
860 } |
861 readers.insert(make_pair(name, new _reader_bits:: |
861 readers.insert(make_pair(label, new _reader_bits:: |
862 SkipReader<Node, Reader>(reader))); |
862 SkipReader<Node, ItemReader>(ir))); |
863 return *this; |
863 return *this; |
864 } |
864 } |
865 |
865 |
866 protected: |
866 protected: |
867 |
867 |
1025 |
1027 |
1026 /// \brief Add a new edge map reader command for the reader. |
1028 /// \brief Add a new edge map reader command for the reader. |
1027 /// |
1029 /// |
1028 /// Add a new edge map reader command for the reader. |
1030 /// Add a new edge map reader command for the reader. |
1029 template <typename Map> |
1031 template <typename Map> |
1030 EdgeSetReader& readEdgeMap(std::string name, Map& map) { |
1032 EdgeSetReader& readEdgeMap(std::string label, Map& map) { |
1031 return _readMap< |
1033 return _readMap< |
1032 typename Traits::template Reader<typename Map::Value>, Map, |
1034 typename Traits::template Reader<typename Map::Value>, Map, |
1033 typename _reader_bits::Arg<Map>::Type>(name, map); |
1035 typename _reader_bits::Arg<Map>::Type>(label, map); |
1034 } |
1036 } |
1035 |
1037 |
1036 template <typename Map> |
1038 template <typename Map> |
1037 EdgeSetReader& readEdgeMap(std::string name, const Map& map) { |
1039 EdgeSetReader& readEdgeMap(std::string label, const Map& map) { |
1038 return _readMap< |
1040 return _readMap< |
1039 typename Traits::template Reader<typename Map::Value>, Map, |
1041 typename Traits::template Reader<typename Map::Value>, Map, |
1040 typename _reader_bits::Arg<Map>::Type>(name, map); |
1042 typename _reader_bits::Arg<Map>::Type>(label, map); |
1041 } |
1043 } |
1042 |
1044 |
1043 /// \brief Add a new edge map reader command for the reader. |
1045 /// \brief Add a new edge map reader command for the reader. |
1044 /// |
1046 /// |
1045 /// Add a new edge map reader command for the reader. |
1047 /// Add a new edge map reader command for the reader. |
1046 template <typename Reader, typename Map> |
1048 template <typename ItemReader, typename Map> |
1047 EdgeSetReader& readEdgeMap(std::string name, Map& map, |
1049 EdgeSetReader& readEdgeMap(std::string label, Map& map, |
1048 const Reader& reader = Reader()) { |
1050 const ItemReader& ir = ItemReader()) { |
1049 return _readMap<Reader, Map, |
1051 return _readMap<ItemReader, Map, |
1050 typename _reader_bits::Arg<Map>::Type>(name, map, reader); |
1052 typename _reader_bits::Arg<Map>::Type>(label, map, ir); |
1051 } |
1053 } |
1052 |
1054 |
1053 template <typename Reader, typename Map> |
1055 template <typename ItemReader, typename Map> |
1054 EdgeSetReader& readEdgeMap(std::string name, const Map& map, |
1056 EdgeSetReader& readEdgeMap(std::string label, const Map& map, |
1055 const Reader& reader = Reader()) { |
1057 const ItemReader& ir = ItemReader()) { |
1056 return _readMap<Reader, Map, |
1058 return _readMap<ItemReader, Map, |
1057 typename _reader_bits::Arg<Map>::Type>(name, map, reader); |
1059 typename _reader_bits::Arg<Map>::Type>(label, map, ir); |
1058 } |
1060 } |
1059 |
1061 |
1060 private: |
1062 private: |
1061 |
1063 |
1062 template <typename Reader, typename Map, typename MapParameter> |
1064 template <typename ItemReader, typename Map, typename MapParameter> |
1063 EdgeSetReader& _readMap(std::string name, MapParameter map, |
1065 EdgeSetReader& _readMap(std::string label, MapParameter map, |
1064 const Reader& reader = Reader()) { |
1066 const ItemReader& ir = ItemReader()) { |
1065 checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>(); |
1067 checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>(); |
1066 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1068 checkConcept<_reader_bits::ItemReader<typename Map::Value>, ItemReader>(); |
1067 if (readers.find(name) != readers.end()) { |
1069 if (readers.find(label) != readers.end()) { |
1068 ErrorMessage msg; |
1070 ErrorMessage msg; |
1069 msg << "Multiple read rule for edge map: " << name; |
1071 msg << "Multiple read rule for edge map: " << label; |
1070 throw IoParameterError(msg.message()); |
1072 throw IoParameterError(msg.message()); |
1071 } |
1073 } |
1072 readers.insert( |
1074 readers.insert( |
1073 make_pair(name, new _reader_bits:: |
1075 make_pair(label, new _reader_bits:: |
1074 MapReader<Edge, Map, Reader>(map, reader))); |
1076 MapReader<Edge, Map, ItemReader>(map, ir))); |
1075 return *this; |
1077 return *this; |
1076 } |
1078 } |
1077 |
1079 |
1078 public: |
1080 public: |
1079 |
1081 |
1080 /// \brief Add a new edge map skipper command for the reader. |
1082 /// \brief Add a new edge map skipper command for the reader. |
1081 /// |
1083 /// |
1082 /// Add a new edge map skipper command for the reader. |
1084 /// Add a new edge map skipper command for the reader. |
1083 template <typename Reader> |
1085 template <typename ItemReader> |
1084 EdgeSetReader& skipEdgeMap(std::string name, |
1086 EdgeSetReader& skipEdgeMap(std::string label, |
1085 const Reader& reader = Reader()) { |
1087 const ItemReader& ir = ItemReader()) { |
1086 if (readers.find(name) != readers.end()) { |
1088 if (readers.find(label) != readers.end()) { |
1087 ErrorMessage msg; |
1089 ErrorMessage msg; |
1088 msg << "Multiple read rule for edge map: " << name; |
1090 msg << "Multiple read rule for edge map: " << label; |
1089 throw IoParameterError(msg.message()); |
1091 throw IoParameterError(msg.message()); |
1090 } |
1092 } |
1091 readers.insert(make_pair(name, new _reader_bits:: |
1093 readers.insert(make_pair(label, new _reader_bits:: |
1092 SkipReader<Edge, Reader>(reader))); |
1094 SkipReader<Edge, ItemReader>(ir))); |
1093 return *this; |
1095 return *this; |
1094 } |
1096 } |
1095 |
1097 |
1096 protected: |
1098 protected: |
1097 |
1099 |
1269 |
1273 |
1270 /// \brief Add a new undirected edge map reader command for the reader. |
1274 /// \brief Add a new undirected edge map reader command for the reader. |
1271 /// |
1275 /// |
1272 /// Add a new edge undirected map reader command for the reader. |
1276 /// Add a new edge undirected map reader command for the reader. |
1273 template <typename Map> |
1277 template <typename Map> |
1274 UEdgeSetReader& readUEdgeMap(std::string name, Map& map) { |
1278 UEdgeSetReader& readUEdgeMap(std::string label, Map& map) { |
1275 return _readMap< |
1279 return _readMap< |
1276 typename Traits::template Reader<typename Map::Value>, Map, |
1280 typename Traits::template Reader<typename Map::Value>, Map, |
1277 typename _reader_bits::Arg<Map>::Type>(name, map); |
1281 typename _reader_bits::Arg<Map>::Type>(label, map); |
1278 } |
1282 } |
1279 |
1283 |
1280 template <typename Map> |
1284 template <typename Map> |
1281 UEdgeSetReader& readUEdgeMap(std::string name, const Map& map) { |
1285 UEdgeSetReader& readUEdgeMap(std::string label, const Map& map) { |
1282 return _readMap< |
1286 return _readMap< |
1283 typename Traits::template Reader<typename Map::Value>, Map, |
1287 typename Traits::template Reader<typename Map::Value>, Map, |
1284 typename _reader_bits::Arg<Map>::Type>(name, map); |
1288 typename _reader_bits::Arg<Map>::Type>(label, map); |
1285 } |
1289 } |
1286 |
1290 |
1287 /// \brief Add a new undirected edge map reader command for the reader. |
1291 /// \brief Add a new undirected edge map reader command for the reader. |
1288 /// |
1292 /// |
1289 /// Add a new edge undirected map reader command for the reader. |
1293 /// Add a new edge undirected map reader command for the reader. |
1290 template <typename Reader, typename Map> |
1294 template <typename ItemReader, typename Map> |
1291 UEdgeSetReader& readUEdgeMap(std::string name, Map& map, |
1295 UEdgeSetReader& readUEdgeMap(std::string label, Map& map, |
1292 const Reader& reader = Reader()) { |
1296 const ItemReader& ir = ItemReader()) { |
1293 return _readMap<Reader, Map, typename _reader_bits::Arg<Map>::Type> |
1297 return _readMap<ItemReader, Map, typename _reader_bits::Arg<Map>::Type> |
1294 (name, map, reader); |
1298 (label, map, ir); |
1295 } |
1299 } |
1296 |
1300 |
1297 template <typename Reader, typename Map> |
1301 template <typename ItemReader, typename Map> |
1298 UEdgeSetReader& readUEdgeMap(std::string name, const Map& map, |
1302 UEdgeSetReader& readUEdgeMap(std::string label, const Map& map, |
1299 const Reader& reader = Reader()) { |
1303 const ItemReader& ir = ItemReader()) { |
1300 return _readMap<Reader, Map, typename _reader_bits::Arg<Map>::Type > |
1304 return _readMap<ItemReader, Map, typename _reader_bits::Arg<Map>::Type > |
1301 (name, map, reader); |
1305 (label, map, ir); |
1302 } |
1306 } |
1303 |
1307 |
1304 private: |
1308 private: |
1305 |
1309 |
1306 template <typename Reader, typename Map, typename MapParameter> |
1310 template <typename ItemReader, typename Map, typename MapParameter> |
1307 UEdgeSetReader& _readMap(std::string name, MapParameter map, |
1311 UEdgeSetReader& _readMap(std::string label, MapParameter map, |
1308 const Reader& reader = Reader()) { |
1312 const ItemReader& ir = ItemReader()) { |
1309 checkConcept<concepts::WriteMap<UEdge, typename Map::Value>, Map>(); |
1313 checkConcept<concepts::WriteMap<UEdge, typename Map::Value>, Map>(); |
1310 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1314 checkConcept<_reader_bits::ItemReader<typename Map::Value>, ItemReader>(); |
1311 if (readers.find(name) != readers.end()) { |
1315 if (readers.find(label) != readers.end()) { |
1312 ErrorMessage msg; |
1316 ErrorMessage msg; |
1313 msg << "Multiple read rule for edge map: " << name; |
1317 msg << "Multiple read rule for edge map: " << label; |
1314 throw IoParameterError(msg.message()); |
1318 throw IoParameterError(msg.message()); |
1315 } |
1319 } |
1316 readers.insert( |
1320 readers.insert( |
1317 make_pair(name, new _reader_bits:: |
1321 make_pair(label, new _reader_bits:: |
1318 MapReader<UEdge, Map, Reader>(map, reader))); |
1322 MapReader<UEdge, Map, ItemReader>(map, ir))); |
1319 return *this; |
1323 return *this; |
1320 } |
1324 } |
1321 |
1325 |
1322 public: |
1326 public: |
1323 |
1327 |
1324 /// \brief Add a new undirected edge map skipper command for the reader. |
1328 /// \brief Add a new undirected edge map skipper command for the reader. |
1325 /// |
1329 /// |
1326 /// Add a new undirected edge map skipper command for the reader. |
1330 /// Add a new undirected edge map skipper command for the reader. |
1327 template <typename Reader> |
1331 template <typename ItemReader> |
1328 UEdgeSetReader& skipUEdgeMap(std::string name, |
1332 UEdgeSetReader& skipUEdgeMap(std::string label, |
1329 const Reader& reader = Reader()) { |
1333 const ItemReader& ir = ItemReader()) { |
1330 if (readers.find(name) != readers.end()) { |
1334 if (readers.find(label) != readers.end()) { |
1331 ErrorMessage msg; |
1335 ErrorMessage msg; |
1332 msg << "Multiple read rule for node map: " << name; |
1336 msg << "Multiple read rule for node map: " << label; |
1333 throw IoParameterError(msg.message()); |
1337 throw IoParameterError(msg.message()); |
1334 } |
1338 } |
1335 readers.insert(make_pair(name, new _reader_bits:: |
1339 readers.insert(make_pair(label, new _reader_bits:: |
1336 SkipReader<UEdge, Reader>(reader))); |
1340 SkipReader<UEdge, ItemReader>(ir))); |
1337 return *this; |
1341 return *this; |
1338 } |
1342 } |
1339 |
1343 |
1340 /// \brief Add a new directed edge map reader command for the reader. |
1344 /// \brief Add a new directed edge map reader command for the reader. |
1341 /// |
1345 /// |
1342 /// Add a new directed edge map reader command for the reader. |
1346 /// Add a new directed edge map reader command for the reader. |
1343 template <typename Map> |
1347 template <typename Map> |
1344 UEdgeSetReader& readEdgeMap(std::string name, Map& map) { |
1348 UEdgeSetReader& readEdgeMap(std::string label, Map& map) { |
1345 return _readDirMap< |
1349 return _readDirMap< |
1346 typename Traits::template Reader<typename Map::Value>, Map, |
1350 typename Traits::template Reader<typename Map::Value>, Map, |
1347 typename _reader_bits::Arg<Map>::Type>(name, map); |
1351 typename _reader_bits::Arg<Map>::Type>(label, map); |
1348 } |
1352 } |
1349 |
1353 |
1350 template <typename Map> |
1354 template <typename Map> |
1351 UEdgeSetReader& readEdgeMap(std::string name, const Map& map) { |
1355 UEdgeSetReader& readEdgeMap(std::string label, const Map& map) { |
1352 return _readDirMap< |
1356 return _readDirMap< |
1353 typename Traits::template Reader<typename Map::Value>, Map, |
1357 typename Traits::template Reader<typename Map::Value>, Map, |
1354 typename _reader_bits::Arg<Map>::Type>(name, map); |
1358 typename _reader_bits::Arg<Map>::Type>(label, map); |
1355 } |
1359 } |
1356 |
1360 |
1357 /// \brief Add a new directed edge map reader command for the reader. |
1361 /// \brief Add a new directed edge map reader command for the reader. |
1358 /// |
1362 /// |
1359 /// Add a new directed edge map reader command for the reader. |
1363 /// Add a new directed edge map reader command for the reader. |
1360 template <typename Reader, typename Map> |
1364 template <typename ItemReader, typename Map> |
1361 UEdgeSetReader& readEdgeMap(std::string name, Map& map, |
1365 UEdgeSetReader& readEdgeMap(std::string label, Map& map, |
1362 const Reader& reader = Reader()) { |
1366 const ItemReader& ir = ItemReader()) { |
1363 return _readDirMap<Reader, Map, typename _reader_bits::Arg<Map>::Type> |
1367 return _readDirMap<ItemReader, Map, |
1364 (name, map, reader); |
1368 typename _reader_bits::Arg<Map>::Type>(label, map, ir); |
1365 } |
1369 } |
1366 |
1370 |
1367 template <typename Reader, typename Map> |
1371 template <typename ItemReader, typename Map> |
1368 UEdgeSetReader& readEdgeMap(std::string name, const Map& map, |
1372 UEdgeSetReader& readEdgeMap(std::string label, const Map& map, |
1369 const Reader& reader = Reader()) { |
1373 const ItemReader& ir = ItemReader()) { |
1370 return _readDirMap<Reader, Map, typename _reader_bits::Arg<Map>::Type> |
1374 return _readDirMap<ItemReader, Map, |
1371 (name, map, reader); |
1375 typename _reader_bits::Arg<Map>::Type>(label, map, ir); |
1372 } |
1376 } |
1373 |
1377 |
1374 private: |
1378 private: |
1375 |
1379 |
1376 template <typename Reader, typename Map, typename MapParameter> |
1380 template <typename ItemReader, typename Map, typename MapParameter> |
1377 UEdgeSetReader& _readDirMap(std::string name, MapParameter map, |
1381 UEdgeSetReader& _readDirMap(std::string label, MapParameter map, |
1378 const Reader& reader = Reader()) { |
1382 const ItemReader& ir = ItemReader()) { |
1379 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1383 checkConcept<_reader_bits::ItemReader<typename Map::Value>, ItemReader>(); |
1380 checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>(); |
1384 checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>(); |
1381 readUEdgeMap("+" + name, |
1385 readUEdgeMap("+" + label, |
1382 _reader_bits::forwardComposeMap(graph, map), reader); |
1386 _reader_bits::forwardComposeMap(graph, map), ir); |
1383 readUEdgeMap("-" + name, |
1387 readUEdgeMap("-" + label, |
1384 _reader_bits::backwardComposeMap(graph, map), reader); |
1388 _reader_bits::backwardComposeMap(graph, map), ir); |
1385 return *this; |
1389 return *this; |
1386 } |
1390 } |
1387 |
1391 |
1388 public: |
1392 public: |
1389 |
1393 |
1390 /// \brief Add a new directed edge map skipper command for the reader. |
1394 /// \brief Add a new directed edge map skipper command for the reader. |
1391 /// |
1395 /// |
1392 /// Add a new directed edge map skipper command for the reader. |
1396 /// Add a new directed edge map skipper command for the reader. |
1393 template <typename Reader> |
1397 template <typename ItemReader> |
1394 UEdgeSetReader& skipEdgeMap(std::string name, |
1398 UEdgeSetReader& skipEdgeMap(std::string label, |
1395 const Reader& reader = Reader()) { |
1399 const ItemReader& ir = ItemReader()) { |
1396 skipUEdgeMap("+" + name, reader); |
1400 skipUEdgeMap("+" + label, ir); |
1397 skipUEdgeMap("-" + name, reader); |
1401 skipUEdgeMap("-" + label, ir); |
1398 return *this; |
1402 return *this; |
1399 } |
1403 } |
1400 |
1404 |
1401 protected: |
1405 protected: |
1402 |
1406 |
1421 throw DataFormatError("Cannot find nodeset or label map"); |
1425 throw DataFormatError("Cannot find nodeset or label map"); |
1422 } |
1426 } |
1423 std::vector<_reader_bits::MapReaderBase<UEdge>* > index; |
1427 std::vector<_reader_bits::MapReaderBase<UEdge>* > index; |
1424 std::string line; |
1428 std::string line; |
1425 |
1429 |
1426 getline(is, line); |
1430 { |
1427 std::istringstream ls(line); |
1431 getline(is, line); |
1428 std::string id; |
1432 std::istringstream ls(line); |
1429 while (ls >> id) { |
1433 std::string id; |
1430 typename MapReaders::iterator it = readers.find(id); |
1434 while (ls >> id) { |
1431 if (it != readers.end()) { |
1435 typename MapReaders::iterator it = readers.find(id); |
1432 index.push_back(it->second); |
1436 if (it != readers.end()) { |
1433 it->second->touch(); |
1437 index.push_back(it->second); |
1434 } else { |
1438 it->second->touch(); |
1435 index.push_back(&skipper); |
1439 } else { |
1436 } |
1440 index.push_back(&skipper); |
1437 if (id == "label") { |
1441 } |
1438 inverter.reset(index.back()->getInverter()); |
1442 if (id == "label") { |
1439 index.back() = inverter.get(); |
1443 inverter.reset(index.back()->getInverter()); |
1440 } |
1444 index.back() = inverter.get(); |
1441 } |
1445 } |
1442 for (typename MapReaders::iterator it = readers.begin(); |
1446 } |
1443 it != readers.end(); ++it) { |
1447 for (typename MapReaders::iterator it = readers.begin(); |
1444 if (!it->second->touched()) { |
1448 it != readers.end(); ++it) { |
1445 ErrorMessage msg; |
1449 if (!it->second->touched()) { |
1446 msg << "Map not found in file: " << it->first; |
1450 ErrorMessage msg; |
1447 throw IoParameterError(msg.message()); |
1451 msg << "Map not found in file: " << it->first; |
1448 } |
1452 throw IoParameterError(msg.message()); |
|
1453 } |
|
1454 } |
1449 } |
1455 } |
1450 while (getline(is, line)) { |
1456 while (getline(is, line)) { |
1451 std::istringstream ls(line); |
1457 std::istringstream ls(line); |
1452 Node from = nodeLabelReader->read(ls); |
1458 Node from = nodeLabelReader->read(ls); |
1453 Node to = nodeLabelReader->read(ls); |
1459 Node to = nodeLabelReader->read(ls); |
1454 UEdge edge = graph.addEdge(from, to); |
1460 UEdge edge = graph.addEdge(from, to); |
1455 for (int i = 0; i < (int)index.size(); ++i) { |
1461 for (int i = 0; i < int(index.size()); ++i) { |
1456 index[i]->read(ls, edge); |
1462 index[i]->read(ls, edge); |
1457 } |
1463 } |
1458 } |
1464 } |
1459 } |
1465 } |
1460 |
1466 |