equal
deleted
inserted
replaced
39 #include <lemon/bits/item_reader.h> |
39 #include <lemon/bits/item_reader.h> |
40 |
40 |
41 #include <lemon/dim2.h> |
41 #include <lemon/dim2.h> |
42 |
42 |
43 #include <lemon/concept_check.h> |
43 #include <lemon/concept_check.h> |
44 #include <lemon/concept/maps.h> |
44 #include <lemon/concepts/maps.h> |
45 |
45 |
46 namespace lemon { |
46 namespace lemon { |
47 |
47 |
48 namespace _reader_bits { |
48 namespace _reader_bits { |
49 |
49 |
829 private: |
829 private: |
830 |
830 |
831 template <typename Reader, typename Map, typename MapParameter> |
831 template <typename Reader, typename Map, typename MapParameter> |
832 NodeSetReader& _readMap(std::string name, MapParameter map, |
832 NodeSetReader& _readMap(std::string name, MapParameter map, |
833 const Reader& reader = Reader()) { |
833 const Reader& reader = Reader()) { |
834 checkConcept<concept::WriteMap<Node, typename Map::Value>, Map>(); |
834 checkConcept<concepts::WriteMap<Node, typename Map::Value>, Map>(); |
835 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
835 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
836 if (readers.find(name) != readers.end()) { |
836 if (readers.find(name) != readers.end()) { |
837 ErrorMessage msg; |
837 ErrorMessage msg; |
838 msg << "Multiple read rule for node map: " << name; |
838 msg << "Multiple read rule for node map: " << name; |
839 throw IoParameterError(msg.message()); |
839 throw IoParameterError(msg.message()); |
1059 private: |
1059 private: |
1060 |
1060 |
1061 template <typename Reader, typename Map, typename MapParameter> |
1061 template <typename Reader, typename Map, typename MapParameter> |
1062 EdgeSetReader& _readMap(std::string name, MapParameter map, |
1062 EdgeSetReader& _readMap(std::string name, MapParameter map, |
1063 const Reader& reader = Reader()) { |
1063 const Reader& reader = Reader()) { |
1064 checkConcept<concept::WriteMap<Edge, typename Map::Value>, Map>(); |
1064 checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>(); |
1065 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1065 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1066 if (readers.find(name) != readers.end()) { |
1066 if (readers.find(name) != readers.end()) { |
1067 ErrorMessage msg; |
1067 ErrorMessage msg; |
1068 msg << "Multiple read rule for edge map: " << name; |
1068 msg << "Multiple read rule for edge map: " << name; |
1069 throw IoParameterError(msg.message()); |
1069 throw IoParameterError(msg.message()); |
1303 private: |
1303 private: |
1304 |
1304 |
1305 template <typename Reader, typename Map, typename MapParameter> |
1305 template <typename Reader, typename Map, typename MapParameter> |
1306 UEdgeSetReader& _readMap(std::string name, MapParameter map, |
1306 UEdgeSetReader& _readMap(std::string name, MapParameter map, |
1307 const Reader& reader = Reader()) { |
1307 const Reader& reader = Reader()) { |
1308 checkConcept<concept::WriteMap<UEdge, typename Map::Value>, Map>(); |
1308 checkConcept<concepts::WriteMap<UEdge, typename Map::Value>, Map>(); |
1309 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1309 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1310 if (readers.find(name) != readers.end()) { |
1310 if (readers.find(name) != readers.end()) { |
1311 ErrorMessage msg; |
1311 ErrorMessage msg; |
1312 msg << "Multiple read rule for edge map: " << name; |
1312 msg << "Multiple read rule for edge map: " << name; |
1313 throw IoParameterError(msg.message()); |
1313 throw IoParameterError(msg.message()); |
1374 |
1374 |
1375 template <typename Reader, typename Map, typename MapParameter> |
1375 template <typename Reader, typename Map, typename MapParameter> |
1376 UEdgeSetReader& _readDirMap(std::string name, MapParameter map, |
1376 UEdgeSetReader& _readDirMap(std::string name, MapParameter map, |
1377 const Reader& reader = Reader()) { |
1377 const Reader& reader = Reader()) { |
1378 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1378 checkConcept<_reader_bits::ItemReader<typename Map::Value>, Reader>(); |
1379 checkConcept<concept::WriteMap<Edge, typename Map::Value>, Map>(); |
1379 checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>(); |
1380 readMap("+" + name, |
1380 readMap("+" + name, |
1381 _reader_bits::forwardComposeMap(graph, map), reader); |
1381 _reader_bits::forwardComposeMap(graph, map), reader); |
1382 readMap("-" + name, |
1382 readMap("-" + name, |
1383 _reader_bits::backwardComposeMap(graph, map), reader); |
1383 _reader_bits::backwardComposeMap(graph, map), reader); |
1384 return *this; |
1384 return *this; |