lemon/lemon_reader.h
changeset 2292 38d985e82205
parent 2260 4274224f8a7d
child 2334 c1e936e6a46b
equal deleted inserted replaced
26:b8a37846a509 27:3c997b4b11cd
   115       void set(const Key& key, const Value& val) {
   115       void set(const Key& key, const Value& val) {
   116 	map.set(graph.direct(key, true), val);
   116 	map.set(graph.direct(key, true), val);
   117       }
   117       }
   118 
   118 
   119     private:
   119     private:
       
   120       const Graph& graph;
   120       typename Ref<Map>::Type map;
   121       typename Ref<Map>::Type map;
   121       const Graph& graph;
       
   122     };
   122     };
   123 
   123 
   124     template <typename Graph, typename Map>
   124     template <typename Graph, typename Map>
   125     ForwardComposeMap<Graph, Map>
   125     ForwardComposeMap<Graph, Map>
   126     forwardComposeMap(const Graph& graph, const Map& map) {
   126     forwardComposeMap(const Graph& graph, const Map& map) {
   145       void set(const Key& key, const Value& val) {
   145       void set(const Key& key, const Value& val) {
   146 	map.set(graph.direct(key, false), val);
   146 	map.set(graph.direct(key, false), val);
   147       }
   147       }
   148 
   148 
   149     private:
   149     private:
       
   150       const Graph& graph;
   150       typename Ref<Map>::Type map;
   151       typename Ref<Map>::Type map;
   151       const Graph& graph;
       
   152     };
   152     };
   153 
   153 
   154 
   154 
   155     template <typename Graph, typename Map>
   155     template <typename Graph, typename Map>
   156     BackwardComposeMap<Graph, Map>
   156     BackwardComposeMap<Graph, Map>
  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<concepts::WriteMap<Edge, typename Map::Value>, Map>();
  1379       checkConcept<concepts::WriteMap<Edge, typename Map::Value>, Map>();
  1380       readMap("+" + name, 
  1380       readUEdgeMap("+" + name, 
  1381 	      _reader_bits::forwardComposeMap(graph, map), reader);
  1381                    _reader_bits::forwardComposeMap(graph, map), reader);
  1382       readMap("-" + name, 
  1382       readUEdgeMap("-" + name, 
  1383 	      _reader_bits::backwardComposeMap(graph, map), reader);
  1383                    _reader_bits::backwardComposeMap(graph, map), reader);
  1384       return *this;      
  1384       return *this;      
  1385     }
  1385     }
  1386 
  1386 
  1387   public:
  1387   public:
  1388 
  1388 
  1389     /// \brief Add a new directed edge map skipper command for the reader.
  1389     /// \brief Add a new directed edge map skipper command for the reader.
  1390     ///
  1390     ///
  1391     /// Add a new directed edge map skipper command for the reader.
  1391     /// Add a new directed edge map skipper command for the reader.
  1392     template <typename Reader>
  1392     template <typename Reader>
  1393     UEdgeSetReader& skipEdgeMap(std::string name, 
  1393     UEdgeSetReader& skipEdgeMap(std::string name, 
  1394 				    const Reader& reader = Reader()) {
  1394                                 const Reader& reader = Reader()) {
  1395       skipMap("+" + name, reader);
  1395       skipUEdgeMap("+" + name, reader);
  1396       skipMap("-" + name, reader);
  1396       skipUEdgeMap("-" + name, reader);
  1397       return *this;
  1397       return *this;
  1398     }
  1398     }
  1399 
  1399 
  1400   protected:
  1400   protected:
  1401 
  1401