src/lemon/default_map.h
changeset 1099 91a8ee9d088d
parent 987 87f7c54892df
child 1164 80bb73097736
equal deleted inserted replaced
5:b0640be60ee8 6:b20b55a07a4c
   170 
   170 
   171     
   171     
   172     template <typename _Value>
   172     template <typename _Value>
   173     class NodeMap : public DefaultMap<Graph, Node, NodeIt, _Value> {
   173     class NodeMap : public DefaultMap<Graph, Node, NodeIt, _Value> {
   174     public:
   174     public:
   175       typedef DefaultMappableGraphExtender<_Base> Graph;
   175       typedef DefaultMappableGraphExtender Graph;
   176 
       
   177       typedef typename Graph::Node Node;
       
   178       typedef typename Graph::NodeIt NodeIt;
       
   179 
       
   180       typedef DefaultMap<Graph, Node, NodeIt, _Value> Parent;
   176       typedef DefaultMap<Graph, Node, NodeIt, _Value> Parent;
   181 
       
   182       //typedef typename Parent::Graph Graph;
       
   183       typedef typename Parent::Value Value;
       
   184 
   177 
   185       NodeMap(const Graph& _g) 
   178       NodeMap(const Graph& _g) 
   186 	: Parent(_g) {}
   179 	: Parent(_g) {}
   187       NodeMap(const Graph& _g, const Value& _v) 
   180       NodeMap(const Graph& _g, const _Value& _v) 
   188 	: Parent(_g, _v) {}
   181 	: Parent(_g, _v) {}
   189 
       
   190     };
   182     };
   191 
   183 
   192     template <typename _Value>
   184     template <typename _Value>
   193     class EdgeMap : public DefaultMap<Graph, Edge, EdgeIt, _Value> {
   185     class EdgeMap : public DefaultMap<Graph, Edge, EdgeIt, _Value> {
   194     public:
   186     public:
   195       typedef DefaultMappableGraphExtender<_Base> Graph;
   187       typedef DefaultMappableGraphExtender Graph;
   196 
       
   197       typedef typename Graph::Edge Edge;
       
   198       typedef typename Graph::EdgeIt EdgeIt;
       
   199 
       
   200       typedef DefaultMap<Graph, Edge, EdgeIt, _Value> Parent;
   188       typedef DefaultMap<Graph, Edge, EdgeIt, _Value> Parent;
   201 
       
   202       //typedef typename Parent::Graph Graph;
       
   203       typedef typename Parent::Value Value;
       
   204 
   189 
   205       EdgeMap(const Graph& _g) 
   190       EdgeMap(const Graph& _g) 
   206 	: Parent(_g) {}
   191 	: Parent(_g) {}
   207       EdgeMap(const Graph& _g, const Value& _v) 
   192       EdgeMap(const Graph& _g, const _Value& _v) 
   208 	: Parent(_g, _v) {}
   193 	: Parent(_g, _v) {}
   209 
       
   210     };
   194     };
   211     
   195     
   212   };
   196   };
   213 
   197 
       
   198   template <typename _Base> 
       
   199   class MappableUndirGraphExtender : 
       
   200     public DefaultMappableGraphExtender<_Base> {
       
   201   public:
       
   202 
       
   203     typedef MappableUndirGraphExtender Graph;
       
   204     typedef DefaultMappableGraphExtender<_Base> Parent;
       
   205 
       
   206     typedef typename Parent::UndirEdge UndirEdge;
       
   207     typedef typename Parent::UndirEdgeIt UndirEdgeIt;
       
   208 
       
   209     template <typename _Value>
       
   210     class UndirEdgeMap :
       
   211       public DefaultMap<Graph, UndirEdge, UndirEdgeIt, _Value> {
       
   212     public:
       
   213       typedef MappableUndirGraphExtender Graph;
       
   214       typedef DefaultMap<Graph, UndirEdge, UndirEdgeIt, _Value> Parent;
       
   215 
       
   216       UndirEdgeMap(const Graph& _g) 
       
   217 	: Parent(_g) {}
       
   218       UndirEdgeMap(const Graph& _g, const _Value& _v) 
       
   219 	: Parent(_g, _v) {}
       
   220     };
       
   221 
       
   222 
       
   223   };
   214 
   224 
   215 }
   225 }
   216 
   226 
   217 #endif
   227 #endif