src/lemon/default_map.h
changeset 1022 567f392d1d2e
parent 987 87f7c54892df
child 1164 80bb73097736
     1.1 --- a/src/lemon/default_map.h	Thu Nov 25 14:48:24 2004 +0000
     1.2 +++ b/src/lemon/default_map.h	Sun Nov 28 16:30:10 2004 +0000
     1.3 @@ -172,45 +172,55 @@
     1.4      template <typename _Value>
     1.5      class NodeMap : public DefaultMap<Graph, Node, NodeIt, _Value> {
     1.6      public:
     1.7 -      typedef DefaultMappableGraphExtender<_Base> Graph;
     1.8 -
     1.9 -      typedef typename Graph::Node Node;
    1.10 -      typedef typename Graph::NodeIt NodeIt;
    1.11 -
    1.12 +      typedef DefaultMappableGraphExtender Graph;
    1.13        typedef DefaultMap<Graph, Node, NodeIt, _Value> Parent;
    1.14  
    1.15 -      //typedef typename Parent::Graph Graph;
    1.16 -      typedef typename Parent::Value Value;
    1.17 -
    1.18        NodeMap(const Graph& _g) 
    1.19  	: Parent(_g) {}
    1.20 -      NodeMap(const Graph& _g, const Value& _v) 
    1.21 +      NodeMap(const Graph& _g, const _Value& _v) 
    1.22  	: Parent(_g, _v) {}
    1.23 -
    1.24      };
    1.25  
    1.26      template <typename _Value>
    1.27      class EdgeMap : public DefaultMap<Graph, Edge, EdgeIt, _Value> {
    1.28      public:
    1.29 -      typedef DefaultMappableGraphExtender<_Base> Graph;
    1.30 -
    1.31 -      typedef typename Graph::Edge Edge;
    1.32 -      typedef typename Graph::EdgeIt EdgeIt;
    1.33 -
    1.34 +      typedef DefaultMappableGraphExtender Graph;
    1.35        typedef DefaultMap<Graph, Edge, EdgeIt, _Value> Parent;
    1.36  
    1.37 -      //typedef typename Parent::Graph Graph;
    1.38 -      typedef typename Parent::Value Value;
    1.39 -
    1.40        EdgeMap(const Graph& _g) 
    1.41  	: Parent(_g) {}
    1.42 -      EdgeMap(const Graph& _g, const Value& _v) 
    1.43 +      EdgeMap(const Graph& _g, const _Value& _v) 
    1.44  	: Parent(_g, _v) {}
    1.45 -
    1.46      };
    1.47      
    1.48    };
    1.49  
    1.50 +  template <typename _Base> 
    1.51 +  class MappableUndirGraphExtender : 
    1.52 +    public DefaultMappableGraphExtender<_Base> {
    1.53 +  public:
    1.54 +
    1.55 +    typedef MappableUndirGraphExtender Graph;
    1.56 +    typedef DefaultMappableGraphExtender<_Base> Parent;
    1.57 +
    1.58 +    typedef typename Parent::UndirEdge UndirEdge;
    1.59 +    typedef typename Parent::UndirEdgeIt UndirEdgeIt;
    1.60 +
    1.61 +    template <typename _Value>
    1.62 +    class UndirEdgeMap :
    1.63 +      public DefaultMap<Graph, UndirEdge, UndirEdgeIt, _Value> {
    1.64 +    public:
    1.65 +      typedef MappableUndirGraphExtender Graph;
    1.66 +      typedef DefaultMap<Graph, UndirEdge, UndirEdgeIt, _Value> Parent;
    1.67 +
    1.68 +      UndirEdgeMap(const Graph& _g) 
    1.69 +	: Parent(_g) {}
    1.70 +      UndirEdgeMap(const Graph& _g, const _Value& _v) 
    1.71 +	: Parent(_g, _v) {}
    1.72 +    };
    1.73 +
    1.74 +
    1.75 +  };
    1.76  
    1.77  }
    1.78