lemon/bits/graph_extender.h
changeset 617 4137ef9aacc6
parent 440 88ed40ad0d4f
child 685 a27356ceb5bd
     1.1 --- a/lemon/bits/graph_extender.h	Fri Apr 24 10:15:33 2009 +0200
     1.2 +++ b/lemon/bits/graph_extender.h	Fri Apr 24 11:54:48 2009 +0200
     1.3 @@ -37,9 +37,10 @@
     1.4    // \brief Extender for the digraph implementations
     1.5    template <typename Base>
     1.6    class DigraphExtender : public Base {
     1.7 +    typedef Base Parent;
     1.8 +
     1.9    public:
    1.10  
    1.11 -    typedef Base Parent;
    1.12      typedef DigraphExtender Digraph;
    1.13  
    1.14      // Base extensions
    1.15 @@ -218,10 +219,9 @@
    1.16      template <typename _Value>
    1.17      class NodeMap
    1.18        : public MapExtender<DefaultMap<Digraph, Node, _Value> > {
    1.19 -    public:
    1.20 -      typedef DigraphExtender Digraph;
    1.21        typedef MapExtender<DefaultMap<Digraph, Node, _Value> > Parent;
    1.22  
    1.23 +    public:
    1.24        explicit NodeMap(const Digraph& digraph)
    1.25          : Parent(digraph) {}
    1.26        NodeMap(const Digraph& digraph, const _Value& value)
    1.27 @@ -243,10 +243,9 @@
    1.28      template <typename _Value>
    1.29      class ArcMap
    1.30        : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
    1.31 -    public:
    1.32 -      typedef DigraphExtender Digraph;
    1.33        typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
    1.34  
    1.35 +    public:
    1.36        explicit ArcMap(const Digraph& digraph)
    1.37          : Parent(digraph) {}
    1.38        ArcMap(const Digraph& digraph, const _Value& value)
    1.39 @@ -330,9 +329,10 @@
    1.40    // \brief Extender for the Graphs
    1.41    template <typename Base>
    1.42    class GraphExtender : public Base {
    1.43 +    typedef Base Parent;
    1.44 +
    1.45    public:
    1.46  
    1.47 -    typedef Base Parent;
    1.48      typedef GraphExtender Graph;
    1.49  
    1.50      typedef True UndirectedTag;
    1.51 @@ -601,10 +601,9 @@
    1.52      template <typename _Value>
    1.53      class NodeMap
    1.54        : public MapExtender<DefaultMap<Graph, Node, _Value> > {
    1.55 -    public:
    1.56 -      typedef GraphExtender Graph;
    1.57        typedef MapExtender<DefaultMap<Graph, Node, _Value> > Parent;
    1.58  
    1.59 +    public:
    1.60        NodeMap(const Graph& graph)
    1.61          : Parent(graph) {}
    1.62        NodeMap(const Graph& graph, const _Value& value)
    1.63 @@ -626,10 +625,9 @@
    1.64      template <typename _Value>
    1.65      class ArcMap
    1.66        : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
    1.67 -    public:
    1.68 -      typedef GraphExtender Graph;
    1.69        typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
    1.70  
    1.71 +    public:
    1.72        ArcMap(const Graph& graph)
    1.73          : Parent(graph) {}
    1.74        ArcMap(const Graph& graph, const _Value& value)
    1.75 @@ -651,10 +649,9 @@
    1.76      template <typename _Value>
    1.77      class EdgeMap
    1.78        : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
    1.79 -    public:
    1.80 -      typedef GraphExtender Graph;
    1.81        typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
    1.82  
    1.83 +    public:
    1.84        EdgeMap(const Graph& graph)
    1.85          : Parent(graph) {}
    1.86