Fix and uniform the usage of Graph and Parent typedefs (#268)
authorPeter Kovacs <kpeter@inf.elte.hu>
Fri, 24 Apr 2009 11:54:48 +0200
changeset 6094137ef9aacc6
parent 608 f2d6d3446adf
child 610 b95898314e09
Fix and uniform the usage of Graph and Parent typedefs (#268)

- Rename Graph typedefs to GraphType in the implementation of graph
maps and MapExtender to prevent conflicts (especially using VS).
They are not public.
- Make Parent typedefs private in all classes.
- Replace Digraph with Graph in some places
(fix faulty renamings of the script).
- Use Graph and Digraph typedefs (more) consequently.
lemon/adaptors.h
lemon/bits/array_map.h
lemon/bits/base_extender.h
lemon/bits/default_map.h
lemon/bits/edge_set_extender.h
lemon/bits/graph_adaptor_extender.h
lemon/bits/graph_extender.h
lemon/bits/map_extender.h
lemon/bits/vector_map.h
lemon/concepts/graph_components.h
lemon/core.h
lemon/edge_set.h
lemon/full_graph.h
lemon/graph_to_eps.h
lemon/grid_graph.h
lemon/hypercube_graph.h
lemon/list_graph.h
lemon/maps.h
lemon/smart_graph.h
     1.1 --- a/lemon/adaptors.h	Fri Apr 24 10:15:33 2009 +0200
     1.2 +++ b/lemon/adaptors.h	Fri Apr 24 11:54:48 2009 +0200
     1.3 @@ -109,13 +109,11 @@
     1.4  
     1.5      template <typename V>
     1.6      class NodeMap : public DGR::template NodeMap<V> {
     1.7 +      typedef typename DGR::template NodeMap<V> Parent;
     1.8 +
     1.9      public:
    1.10 -
    1.11 -      typedef typename DGR::template NodeMap<V> Parent;
    1.12 -
    1.13        explicit NodeMap(const Adaptor& adaptor)
    1.14          : Parent(*adaptor._digraph) {}
    1.15 -
    1.16        NodeMap(const Adaptor& adaptor, const V& value)
    1.17          : Parent(*adaptor._digraph, value) { }
    1.18  
    1.19 @@ -134,13 +132,11 @@
    1.20  
    1.21      template <typename V>
    1.22      class ArcMap : public DGR::template ArcMap<V> {
    1.23 +      typedef typename DGR::template ArcMap<V> Parent;
    1.24 +
    1.25      public:
    1.26 -
    1.27 -      typedef typename DGR::template ArcMap<V> Parent;
    1.28 -
    1.29        explicit ArcMap(const DigraphAdaptorBase<DGR>& adaptor)
    1.30          : Parent(*adaptor._digraph) {}
    1.31 -
    1.32        ArcMap(const DigraphAdaptorBase<DGR>& adaptor, const V& value)
    1.33          : Parent(*adaptor._digraph, value) {}
    1.34  
    1.35 @@ -255,8 +251,9 @@
    1.36  
    1.37      template <typename V>
    1.38      class NodeMap : public GR::template NodeMap<V> {
    1.39 +      typedef typename GR::template NodeMap<V> Parent;
    1.40 +
    1.41      public:
    1.42 -      typedef typename GR::template NodeMap<V> Parent;
    1.43        explicit NodeMap(const GraphAdaptorBase<GR>& adapter)
    1.44          : Parent(*adapter._graph) {}
    1.45        NodeMap(const GraphAdaptorBase<GR>& adapter, const V& value)
    1.46 @@ -277,8 +274,9 @@
    1.47  
    1.48      template <typename V>
    1.49      class ArcMap : public GR::template ArcMap<V> {
    1.50 +      typedef typename GR::template ArcMap<V> Parent;
    1.51 +
    1.52      public:
    1.53 -      typedef typename GR::template ArcMap<V> Parent;
    1.54        explicit ArcMap(const GraphAdaptorBase<GR>& adapter)
    1.55          : Parent(*adapter._graph) {}
    1.56        ArcMap(const GraphAdaptorBase<GR>& adapter, const V& value)
    1.57 @@ -298,8 +296,9 @@
    1.58  
    1.59      template <typename V>
    1.60      class EdgeMap : public GR::template EdgeMap<V> {
    1.61 +      typedef typename GR::template EdgeMap<V> Parent;
    1.62 +
    1.63      public:
    1.64 -      typedef typename GR::template EdgeMap<V> Parent;
    1.65        explicit EdgeMap(const GraphAdaptorBase<GR>& adapter)
    1.66          : Parent(*adapter._graph) {}
    1.67        EdgeMap(const GraphAdaptorBase<GR>& adapter, const V& value)
    1.68 @@ -321,9 +320,9 @@
    1.69  
    1.70    template <typename DGR>
    1.71    class ReverseDigraphBase : public DigraphAdaptorBase<DGR> {
    1.72 +    typedef DigraphAdaptorBase<DGR> Parent;
    1.73    public:
    1.74      typedef DGR Digraph;
    1.75 -    typedef DigraphAdaptorBase<DGR> Parent;
    1.76    protected:
    1.77      ReverseDigraphBase() : Parent() { }
    1.78    public:
    1.79 @@ -374,10 +373,10 @@
    1.80    class ReverseDigraph :
    1.81      public DigraphAdaptorExtender<ReverseDigraphBase<DGR> > {
    1.82  #endif
    1.83 +    typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent;
    1.84    public:
    1.85      /// The type of the adapted digraph.
    1.86      typedef DGR Digraph;
    1.87 -    typedef DigraphAdaptorExtender<ReverseDigraphBase<DGR> > Parent;
    1.88    protected:
    1.89      ReverseDigraph() { }
    1.90    public:
    1.91 @@ -403,13 +402,13 @@
    1.92  
    1.93    template <typename DGR, typename NF, typename AF, bool ch = true>
    1.94    class SubDigraphBase : public DigraphAdaptorBase<DGR> {
    1.95 +    typedef DigraphAdaptorBase<DGR> Parent;
    1.96    public:
    1.97      typedef DGR Digraph;
    1.98      typedef NF NodeFilterMap;
    1.99      typedef AF ArcFilterMap;
   1.100  
   1.101      typedef SubDigraphBase Adaptor;
   1.102 -    typedef DigraphAdaptorBase<DGR> Parent;
   1.103    protected:
   1.104      NF* _node_filter;
   1.105      AF* _arc_filter;
   1.106 @@ -509,10 +508,11 @@
   1.107      class NodeMap 
   1.108        : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 
   1.109  	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
   1.110 +      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
   1.111 +	LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
   1.112 +
   1.113      public:
   1.114        typedef V Value;
   1.115 -      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
   1.116 -	    LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
   1.117  
   1.118        NodeMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor)
   1.119          : Parent(adaptor) {}
   1.120 @@ -535,10 +535,11 @@
   1.121      class ArcMap 
   1.122        : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
   1.123  	      LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
   1.124 +      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
   1.125 +        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
   1.126 +
   1.127      public:
   1.128        typedef V Value;
   1.129 -      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>,
   1.130 -        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
   1.131  
   1.132        ArcMap(const SubDigraphBase<DGR, NF, AF, ch>& adaptor)
   1.133          : Parent(adaptor) {}
   1.134 @@ -562,13 +563,13 @@
   1.135    template <typename DGR, typename NF, typename AF>
   1.136    class SubDigraphBase<DGR, NF, AF, false>
   1.137      : public DigraphAdaptorBase<DGR> {
   1.138 +    typedef DigraphAdaptorBase<DGR> Parent;
   1.139    public:
   1.140      typedef DGR Digraph;
   1.141      typedef NF NodeFilterMap;
   1.142      typedef AF ArcFilterMap;
   1.143  
   1.144      typedef SubDigraphBase Adaptor;
   1.145 -    typedef DigraphAdaptorBase<Digraph> Parent;
   1.146    protected:
   1.147      NF* _node_filter;
   1.148      AF* _arc_filter;
   1.149 @@ -650,10 +651,11 @@
   1.150      class NodeMap 
   1.151        : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
   1.152            LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> {
   1.153 +      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
   1.154 +        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
   1.155 +
   1.156      public:
   1.157        typedef V Value;
   1.158 -      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 
   1.159 -        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent;
   1.160  
   1.161        NodeMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor)
   1.162          : Parent(adaptor) {}
   1.163 @@ -676,10 +678,11 @@
   1.164      class ArcMap 
   1.165        : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
   1.166            LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> {
   1.167 +      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
   1.168 +        LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
   1.169 +
   1.170      public:
   1.171        typedef V Value;
   1.172 -      typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>,
   1.173 -          LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent;
   1.174  
   1.175        ArcMap(const SubDigraphBase<DGR, NF, AF, false>& adaptor)
   1.176          : Parent(adaptor) {}
   1.177 @@ -863,13 +866,13 @@
   1.178  
   1.179    template <typename GR, typename NF, typename EF, bool ch = true>
   1.180    class SubGraphBase : public GraphAdaptorBase<GR> {
   1.181 +    typedef GraphAdaptorBase<GR> Parent;
   1.182    public:
   1.183      typedef GR Graph;
   1.184      typedef NF NodeFilterMap;
   1.185      typedef EF EdgeFilterMap;
   1.186  
   1.187      typedef SubGraphBase Adaptor;
   1.188 -    typedef GraphAdaptorBase<GR> Parent;
   1.189    protected:
   1.190  
   1.191      NF* _node_filter;
   1.192 @@ -1016,10 +1019,11 @@
   1.193      class NodeMap 
   1.194        : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
   1.195            LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
   1.196 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
   1.197 +        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
   1.198 +
   1.199      public:
   1.200        typedef V Value;
   1.201 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
   1.202 -        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
   1.203  
   1.204        NodeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
   1.205          : Parent(adaptor) {}
   1.206 @@ -1042,10 +1046,11 @@
   1.207      class ArcMap 
   1.208        : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
   1.209            LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
   1.210 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
   1.211 +        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
   1.212 +
   1.213      public:
   1.214        typedef V Value;
   1.215 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
   1.216 -        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
   1.217  
   1.218        ArcMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
   1.219          : Parent(adaptor) {}
   1.220 @@ -1068,10 +1073,11 @@
   1.221      class EdgeMap 
   1.222        : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>,
   1.223          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
   1.224 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
   1.225 +        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
   1.226 +
   1.227      public:
   1.228        typedef V Value;
   1.229 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 
   1.230 -        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
   1.231  
   1.232        EdgeMap(const SubGraphBase<GR, NF, EF, ch>& adaptor)
   1.233          : Parent(adaptor) {}
   1.234 @@ -1096,13 +1102,13 @@
   1.235    template <typename GR, typename NF, typename EF>
   1.236    class SubGraphBase<GR, NF, EF, false>
   1.237      : public GraphAdaptorBase<GR> {
   1.238 +    typedef GraphAdaptorBase<GR> Parent;
   1.239    public:
   1.240      typedef GR Graph;
   1.241      typedef NF NodeFilterMap;
   1.242      typedef EF EdgeFilterMap;
   1.243  
   1.244      typedef SubGraphBase Adaptor;
   1.245 -    typedef GraphAdaptorBase<GR> Parent;
   1.246    protected:
   1.247      NF* _node_filter;
   1.248      EF* _edge_filter;
   1.249 @@ -1211,10 +1217,11 @@
   1.250      class NodeMap 
   1.251        : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.252            LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> {
   1.253 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.254 +        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
   1.255 +
   1.256      public:
   1.257        typedef V Value;
   1.258 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.259 -        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent;
   1.260  
   1.261        NodeMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
   1.262          : Parent(adaptor) {}
   1.263 @@ -1237,10 +1244,11 @@
   1.264      class ArcMap 
   1.265        : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.266            LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> {
   1.267 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.268 +        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
   1.269 +
   1.270      public:
   1.271        typedef V Value;
   1.272 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.273 -        LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent;
   1.274  
   1.275        ArcMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
   1.276          : Parent(adaptor) {}
   1.277 @@ -1263,10 +1271,11 @@
   1.278      class EdgeMap 
   1.279        : public SubMapExtender<SubGraphBase<GR, NF, EF, false>,
   1.280          LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> {
   1.281 +      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.282 +	LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
   1.283 +
   1.284      public:
   1.285        typedef V Value;
   1.286 -      typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 
   1.287 -		  LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent;
   1.288  
   1.289        EdgeMap(const SubGraphBase<GR, NF, EF, false>& adaptor)
   1.290          : Parent(adaptor) {}
   1.291 @@ -1485,15 +1494,15 @@
   1.292        SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >,
   1.293                       true> > {
   1.294  #endif
   1.295 -  public:
   1.296 -
   1.297 -    typedef GR Digraph;
   1.298 -    typedef NF NodeFilterMap;
   1.299 -
   1.300      typedef DigraphAdaptorExtender<
   1.301        SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 
   1.302                       true> > Parent;
   1.303  
   1.304 +  public:
   1.305 +
   1.306 +    typedef GR Digraph;
   1.307 +    typedef NF NodeFilterMap;
   1.308 +
   1.309      typedef typename Parent::Node Node;
   1.310  
   1.311    protected:
   1.312 @@ -1548,14 +1557,17 @@
   1.313        SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
   1.314                     true> > {
   1.315  
   1.316 -  public:
   1.317 -    typedef GR Graph;
   1.318 -    typedef NF NodeFilterMap;
   1.319      typedef GraphAdaptorExtender<
   1.320        SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 
   1.321                     true> > Parent;
   1.322  
   1.323 +  public:
   1.324 +
   1.325 +    typedef GR Graph;
   1.326 +    typedef NF NodeFilterMap;
   1.327 +
   1.328      typedef typename Parent::Node Node;
   1.329 +
   1.330    protected:
   1.331      ConstMap<typename GR::Edge, Const<bool, true> > const_true_map;
   1.332  
   1.333 @@ -1629,16 +1641,17 @@
   1.334        SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >,
   1.335                       AF, false> > {
   1.336  #endif
   1.337 +    typedef DigraphAdaptorExtender<
   1.338 +      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
   1.339 +                     AF, false> > Parent;
   1.340 +
   1.341    public:
   1.342 +
   1.343      /// The type of the adapted digraph.
   1.344      typedef DGR Digraph;
   1.345      /// The type of the arc filter map.
   1.346      typedef AF ArcFilterMap;
   1.347  
   1.348 -    typedef DigraphAdaptorExtender<
   1.349 -      SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 
   1.350 -                     AF, false> > Parent;
   1.351 -
   1.352      typedef typename Parent::Arc Arc;
   1.353  
   1.354    protected:
   1.355 @@ -1738,16 +1751,17 @@
   1.356        SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 
   1.357                     EF, false> > {
   1.358  #endif
   1.359 +    typedef GraphAdaptorExtender<
   1.360 +      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
   1.361 +                   EF, false> > Parent;
   1.362 +
   1.363    public:
   1.364 +
   1.365      /// The type of the adapted graph.
   1.366      typedef GR Graph;
   1.367      /// The type of the edge filter map.
   1.368      typedef EF EdgeFilterMap;
   1.369  
   1.370 -    typedef GraphAdaptorExtender<
   1.371 -      SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 
   1.372 -                   EF, false> > Parent;
   1.373 -
   1.374      typedef typename Parent::Edge Edge;
   1.375  
   1.376    protected:
   1.377 @@ -2111,10 +2125,10 @@
   1.378  
   1.379      template <typename V>
   1.380      class NodeMap : public DGR::template NodeMap<V> {
   1.381 +      typedef typename DGR::template NodeMap<V> Parent;
   1.382 +
   1.383      public:
   1.384 -
   1.385        typedef V Value;
   1.386 -      typedef typename DGR::template NodeMap<Value> Parent;
   1.387  
   1.388        explicit NodeMap(const UndirectorBase<DGR>& adaptor)
   1.389          : Parent(*adaptor._digraph) {}
   1.390 @@ -2137,11 +2151,11 @@
   1.391  
   1.392      template <typename V>
   1.393      class ArcMap
   1.394 -      : public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> >
   1.395 -    {
   1.396 +      : public SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > {
   1.397 +      typedef SubMapExtender<UndirectorBase<DGR>, ArcMapBase<V> > Parent;
   1.398 +
   1.399      public:
   1.400        typedef V Value;
   1.401 -      typedef SubMapExtender<Adaptor, ArcMapBase<V> > Parent;
   1.402  
   1.403        explicit ArcMap(const UndirectorBase<DGR>& adaptor)
   1.404          : Parent(adaptor) {}
   1.405 @@ -2163,10 +2177,10 @@
   1.406  
   1.407      template <typename V>
   1.408      class EdgeMap : public Digraph::template ArcMap<V> {
   1.409 +      typedef typename Digraph::template ArcMap<V> Parent;
   1.410 +
   1.411      public:
   1.412 -
   1.413        typedef V Value;
   1.414 -      typedef typename Digraph::template ArcMap<V> Parent;
   1.415  
   1.416        explicit EdgeMap(const UndirectorBase<DGR>& adaptor)
   1.417          : Parent(*adaptor._digraph) {}
   1.418 @@ -2238,10 +2252,10 @@
   1.419    class Undirector :
   1.420      public GraphAdaptorExtender<UndirectorBase<DGR> > {
   1.421  #endif
   1.422 +    typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent;
   1.423    public:
   1.424      /// The type of the adapted digraph.
   1.425      typedef DGR Digraph;
   1.426 -    typedef GraphAdaptorExtender<UndirectorBase<DGR> > Parent;
   1.427    protected:
   1.428      Undirector() { }
   1.429    public:
   1.430 @@ -2449,10 +2463,10 @@
   1.431  
   1.432      template <typename V>
   1.433      class NodeMap : public GR::template NodeMap<V> {
   1.434 +      typedef typename GR::template NodeMap<V> Parent;
   1.435 +
   1.436      public:
   1.437  
   1.438 -      typedef typename GR::template NodeMap<V> Parent;
   1.439 -
   1.440        explicit NodeMap(const OrienterBase<GR, DM>& adapter)
   1.441          : Parent(*adapter._graph) {}
   1.442  
   1.443 @@ -2474,10 +2488,10 @@
   1.444  
   1.445      template <typename V>
   1.446      class ArcMap : public GR::template EdgeMap<V> {
   1.447 +      typedef typename Graph::template EdgeMap<V> Parent;
   1.448 +
   1.449      public:
   1.450  
   1.451 -      typedef typename Graph::template EdgeMap<V> Parent;
   1.452 -
   1.453        explicit ArcMap(const OrienterBase<GR, DM>& adapter)
   1.454          : Parent(*adapter._graph) { }
   1.455  
   1.456 @@ -2546,6 +2560,7 @@
   1.457    class Orienter :
   1.458      public DigraphAdaptorExtender<OrienterBase<GR, DM> > {
   1.459  #endif
   1.460 +    typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
   1.461    public:
   1.462  
   1.463      /// The type of the adapted graph.
   1.464 @@ -2553,10 +2568,11 @@
   1.465      /// The type of the direction edge map.
   1.466      typedef DM DirectionMap;
   1.467  
   1.468 -    typedef DigraphAdaptorExtender<OrienterBase<GR, DM> > Parent;
   1.469      typedef typename Parent::Arc Arc;
   1.470 +
   1.471    protected:
   1.472      Orienter() { }
   1.473 +
   1.474    public:
   1.475  
   1.476      /// \brief Constructor
   1.477 @@ -2866,10 +2882,11 @@
   1.478  
   1.479    template <typename DGR>
   1.480    class SplitNodesBase {
   1.481 +    typedef DigraphAdaptorBase<const DGR> Parent;
   1.482 +
   1.483    public:
   1.484  
   1.485      typedef DGR Digraph;
   1.486 -    typedef DigraphAdaptorBase<const DGR> Parent;
   1.487      typedef SplitNodesBase Adaptor;
   1.488  
   1.489      typedef typename DGR::Node DigraphNode;
   1.490 @@ -3228,11 +3245,11 @@
   1.491  
   1.492      template <typename V>
   1.493      class NodeMap
   1.494 -      : public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> >
   1.495 -    {
   1.496 +      : public SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > {
   1.497 +      typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<V> > Parent;
   1.498 +
   1.499      public:
   1.500        typedef V Value;
   1.501 -      typedef SubMapExtender<SplitNodesBase<DGR>, NodeMapBase<Value> > Parent;
   1.502  
   1.503        NodeMap(const SplitNodesBase<DGR>& adaptor)
   1.504          : Parent(adaptor) {}
   1.505 @@ -3254,11 +3271,11 @@
   1.506  
   1.507      template <typename V>
   1.508      class ArcMap
   1.509 -      : public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> >
   1.510 -    {
   1.511 +      : public SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > {
   1.512 +      typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<V> > Parent;
   1.513 +
   1.514      public:
   1.515        typedef V Value;
   1.516 -      typedef SubMapExtender<SplitNodesBase<DGR>, ArcMapBase<Value> > Parent;
   1.517  
   1.518        ArcMap(const SplitNodesBase<DGR>& adaptor)
   1.519          : Parent(adaptor) {}
   1.520 @@ -3324,9 +3341,10 @@
   1.521    class SplitNodes
   1.522      : public DigraphAdaptorExtender<SplitNodesBase<const DGR> > {
   1.523  #endif
   1.524 +    typedef DigraphAdaptorExtender<SplitNodesBase<const DGR> > Parent;
   1.525 +
   1.526    public:
   1.527      typedef DGR Digraph;
   1.528 -    typedef DigraphAdaptorExtender<SplitNodesBase<const DGR> > Parent;
   1.529  
   1.530      typedef typename DGR::Node DigraphNode;
   1.531      typedef typename DGR::Arc DigraphArc;
     2.1 --- a/lemon/bits/array_map.h	Fri Apr 24 10:15:33 2009 +0200
     2.2 +++ b/lemon/bits/array_map.h	Fri Apr 24 11:54:48 2009 +0200
     2.3 @@ -47,7 +47,7 @@
     2.4      : public ItemSetTraits<_Graph, _Item>::ItemNotifier::ObserverBase {
     2.5    public:
     2.6      // The graph type.
     2.7 -    typedef _Graph Graph;
     2.8 +    typedef _Graph GraphType;
     2.9      // The item type.
    2.10      typedef _Item Item;
    2.11      // The reference map tag.
    2.12 @@ -63,13 +63,17 @@
    2.13      // The reference type of the map.
    2.14      typedef _Value& Reference;
    2.15  
    2.16 +    // The map type.
    2.17 +    typedef ArrayMap Map;
    2.18 +
    2.19      // The notifier type.
    2.20      typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier;
    2.21  
    2.22 +  private:
    2.23 +  
    2.24      // The MapBase of the Map which imlements the core regisitry function.
    2.25      typedef typename Notifier::ObserverBase Parent;
    2.26  
    2.27 -  private:
    2.28      typedef std::allocator<Value> Allocator;
    2.29  
    2.30    public:
    2.31 @@ -77,7 +81,7 @@
    2.32      // \brief Graph initialized map constructor.
    2.33      //
    2.34      // Graph initialized map constructor.
    2.35 -    explicit ArrayMap(const Graph& graph) {
    2.36 +    explicit ArrayMap(const GraphType& graph) {
    2.37        Parent::attach(graph.notifier(Item()));
    2.38        allocate_memory();
    2.39        Notifier* nf = Parent::notifier();
    2.40 @@ -91,7 +95,7 @@
    2.41      // \brief Constructor to use default value to initialize the map.
    2.42      //
    2.43      // It constructs a map and initialize all of the the map.
    2.44 -    ArrayMap(const Graph& graph, const Value& value) {
    2.45 +    ArrayMap(const GraphType& graph, const Value& value) {
    2.46        Parent::attach(graph.notifier(Item()));
    2.47        allocate_memory();
    2.48        Notifier* nf = Parent::notifier();
     3.1 --- a/lemon/bits/base_extender.h	Fri Apr 24 10:15:33 2009 +0200
     3.2 +++ b/lemon/bits/base_extender.h	Fri Apr 24 11:54:48 2009 +0200
     3.3 @@ -38,10 +38,10 @@
     3.4    // \brief BaseDigraph to BaseGraph extender
     3.5    template <typename Base>
     3.6    class UndirDigraphExtender : public Base {
     3.7 +    typedef Base Parent;
     3.8  
     3.9    public:
    3.10  
    3.11 -    typedef Base Parent;
    3.12      typedef typename Parent::Arc Edge;
    3.13      typedef typename Parent::Node Node;
    3.14  
    3.15 @@ -280,8 +280,9 @@
    3.16  
    3.17    template <typename Base>
    3.18    class BidirBpGraphExtender : public Base {
    3.19 +    typedef Base Parent;
    3.20 +
    3.21    public:
    3.22 -    typedef Base Parent;
    3.23      typedef BidirBpGraphExtender Digraph;
    3.24  
    3.25      typedef typename Parent::Node Node;
     4.1 --- a/lemon/bits/default_map.h	Fri Apr 24 10:15:33 2009 +0200
     4.2 +++ b/lemon/bits/default_map.h	Fri Apr 24 11:54:48 2009 +0200
     4.3 @@ -153,15 +153,16 @@
     4.4    template <typename _Graph, typename _Item, typename _Value>
     4.5    class DefaultMap
     4.6      : public DefaultMapSelector<_Graph, _Item, _Value>::Map {
     4.7 +    typedef typename DefaultMapSelector<_Graph, _Item, _Value>::Map Parent;
     4.8 +
     4.9    public:
    4.10 -    typedef typename DefaultMapSelector<_Graph, _Item, _Value>::Map Parent;
    4.11      typedef DefaultMap<_Graph, _Item, _Value> Map;
    4.12 -
    4.13 -    typedef typename Parent::Graph Graph;
    4.14 +    
    4.15 +    typedef typename Parent::GraphType GraphType;
    4.16      typedef typename Parent::Value Value;
    4.17  
    4.18 -    explicit DefaultMap(const Graph& graph) : Parent(graph) {}
    4.19 -    DefaultMap(const Graph& graph, const Value& value)
    4.20 +    explicit DefaultMap(const GraphType& graph) : Parent(graph) {}
    4.21 +    DefaultMap(const GraphType& graph, const Value& value)
    4.22        : Parent(graph, value) {}
    4.23  
    4.24      DefaultMap& operator=(const DefaultMap& cmap) {
     5.1 --- a/lemon/bits/edge_set_extender.h	Fri Apr 24 10:15:33 2009 +0200
     5.2 +++ b/lemon/bits/edge_set_extender.h	Fri Apr 24 11:54:48 2009 +0200
     5.3 @@ -34,9 +34,10 @@
     5.4    // \brief Extender for the ArcSets
     5.5    template <typename Base>
     5.6    class ArcSetExtender : public Base {
     5.7 +    typedef Base Parent;
     5.8 +
     5.9    public:
    5.10  
    5.11 -    typedef Base Parent;
    5.12      typedef ArcSetExtender Digraph;
    5.13  
    5.14      // Base extensions
    5.15 @@ -218,10 +219,9 @@
    5.16      template <typename _Value>
    5.17      class ArcMap 
    5.18        : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
    5.19 -    public:
    5.20 -      typedef ArcSetExtender Digraph;
    5.21        typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
    5.22  
    5.23 +    public:
    5.24        explicit ArcMap(const Digraph& _g) 
    5.25  	: Parent(_g) {}
    5.26        ArcMap(const Digraph& _g, const _Value& _v) 
    5.27 @@ -274,17 +274,16 @@
    5.28    // \brief Extender for the EdgeSets
    5.29    template <typename Base>
    5.30    class EdgeSetExtender : public Base {
    5.31 +    typedef Base Parent;
    5.32  
    5.33    public:
    5.34  
    5.35 -    typedef Base Parent;
    5.36 -    typedef EdgeSetExtender Digraph;
    5.37 +    typedef EdgeSetExtender Graph;
    5.38  
    5.39      typedef typename Parent::Node Node;
    5.40      typedef typename Parent::Arc Arc;
    5.41      typedef typename Parent::Edge Edge;
    5.42  
    5.43 -
    5.44      int maxId(Node) const {
    5.45        return Parent::maxNodeId();
    5.46      }
    5.47 @@ -350,22 +349,22 @@
    5.48  
    5.49  
    5.50      class NodeIt : public Node { 
    5.51 -      const Digraph* digraph;
    5.52 +      const Graph* graph;
    5.53      public:
    5.54  
    5.55        NodeIt() {}
    5.56  
    5.57        NodeIt(Invalid i) : Node(i) { }
    5.58  
    5.59 -      explicit NodeIt(const Digraph& _graph) : digraph(&_graph) {
    5.60 +      explicit NodeIt(const Graph& _graph) : graph(&_graph) {
    5.61  	_graph.first(static_cast<Node&>(*this));
    5.62        }
    5.63  
    5.64 -      NodeIt(const Digraph& _graph, const Node& node) 
    5.65 -	: Node(node), digraph(&_graph) {}
    5.66 +      NodeIt(const Graph& _graph, const Node& node) 
    5.67 +	: Node(node), graph(&_graph) {}
    5.68  
    5.69        NodeIt& operator++() { 
    5.70 -	digraph->next(*this);
    5.71 +	graph->next(*this);
    5.72  	return *this; 
    5.73        }
    5.74  
    5.75 @@ -373,22 +372,22 @@
    5.76  
    5.77  
    5.78      class ArcIt : public Arc { 
    5.79 -      const Digraph* digraph;
    5.80 +      const Graph* graph;
    5.81      public:
    5.82  
    5.83        ArcIt() { }
    5.84  
    5.85        ArcIt(Invalid i) : Arc(i) { }
    5.86  
    5.87 -      explicit ArcIt(const Digraph& _graph) : digraph(&_graph) {
    5.88 +      explicit ArcIt(const Graph& _graph) : graph(&_graph) {
    5.89  	_graph.first(static_cast<Arc&>(*this));
    5.90        }
    5.91  
    5.92 -      ArcIt(const Digraph& _graph, const Arc& e) : 
    5.93 -	Arc(e), digraph(&_graph) { }
    5.94 +      ArcIt(const Graph& _graph, const Arc& e) : 
    5.95 +	Arc(e), graph(&_graph) { }
    5.96  
    5.97        ArcIt& operator++() { 
    5.98 -	digraph->next(*this);
    5.99 +	graph->next(*this);
   5.100  	return *this; 
   5.101        }
   5.102  
   5.103 @@ -396,23 +395,23 @@
   5.104  
   5.105  
   5.106      class OutArcIt : public Arc { 
   5.107 -      const Digraph* digraph;
   5.108 +      const Graph* graph;
   5.109      public:
   5.110  
   5.111        OutArcIt() { }
   5.112  
   5.113        OutArcIt(Invalid i) : Arc(i) { }
   5.114  
   5.115 -      OutArcIt(const Digraph& _graph, const Node& node) 
   5.116 -	: digraph(&_graph) {
   5.117 +      OutArcIt(const Graph& _graph, const Node& node) 
   5.118 +	: graph(&_graph) {
   5.119  	_graph.firstOut(*this, node);
   5.120        }
   5.121  
   5.122 -      OutArcIt(const Digraph& _graph, const Arc& arc) 
   5.123 -	: Arc(arc), digraph(&_graph) {}
   5.124 +      OutArcIt(const Graph& _graph, const Arc& arc) 
   5.125 +	: Arc(arc), graph(&_graph) {}
   5.126  
   5.127        OutArcIt& operator++() { 
   5.128 -	digraph->nextOut(*this);
   5.129 +	graph->nextOut(*this);
   5.130  	return *this; 
   5.131        }
   5.132  
   5.133 @@ -420,23 +419,23 @@
   5.134  
   5.135  
   5.136      class InArcIt : public Arc { 
   5.137 -      const Digraph* digraph;
   5.138 +      const Graph* graph;
   5.139      public:
   5.140  
   5.141        InArcIt() { }
   5.142  
   5.143        InArcIt(Invalid i) : Arc(i) { }
   5.144  
   5.145 -      InArcIt(const Digraph& _graph, const Node& node) 
   5.146 -	: digraph(&_graph) {
   5.147 +      InArcIt(const Graph& _graph, const Node& node) 
   5.148 +	: graph(&_graph) {
   5.149  	_graph.firstIn(*this, node);
   5.150        }
   5.151  
   5.152 -      InArcIt(const Digraph& _graph, const Arc& arc) : 
   5.153 -	Arc(arc), digraph(&_graph) {}
   5.154 +      InArcIt(const Graph& _graph, const Arc& arc) : 
   5.155 +	Arc(arc), graph(&_graph) {}
   5.156  
   5.157        InArcIt& operator++() { 
   5.158 -	digraph->nextIn(*this);
   5.159 +	graph->nextIn(*this);
   5.160  	return *this; 
   5.161        }
   5.162  
   5.163 @@ -444,22 +443,22 @@
   5.164  
   5.165  
   5.166      class EdgeIt : public Parent::Edge { 
   5.167 -      const Digraph* digraph;
   5.168 +      const Graph* graph;
   5.169      public:
   5.170  
   5.171        EdgeIt() { }
   5.172  
   5.173        EdgeIt(Invalid i) : Edge(i) { }
   5.174  
   5.175 -      explicit EdgeIt(const Digraph& _graph) : digraph(&_graph) {
   5.176 +      explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
   5.177  	_graph.first(static_cast<Edge&>(*this));
   5.178        }
   5.179  
   5.180 -      EdgeIt(const Digraph& _graph, const Edge& e) : 
   5.181 -	Edge(e), digraph(&_graph) { }
   5.182 +      EdgeIt(const Graph& _graph, const Edge& e) : 
   5.183 +	Edge(e), graph(&_graph) { }
   5.184  
   5.185        EdgeIt& operator++() { 
   5.186 -	digraph->next(*this);
   5.187 +	graph->next(*this);
   5.188  	return *this; 
   5.189        }
   5.190  
   5.191 @@ -467,7 +466,7 @@
   5.192  
   5.193      class IncEdgeIt : public Parent::Edge {
   5.194        friend class EdgeSetExtender;
   5.195 -      const Digraph* digraph;
   5.196 +      const Graph* graph;
   5.197        bool direction;
   5.198      public:
   5.199  
   5.200 @@ -475,17 +474,17 @@
   5.201  
   5.202        IncEdgeIt(Invalid i) : Edge(i), direction(false) { }
   5.203  
   5.204 -      IncEdgeIt(const Digraph& _graph, const Node &n) : digraph(&_graph) {
   5.205 +      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
   5.206  	_graph.firstInc(*this, direction, n);
   5.207        }
   5.208  
   5.209 -      IncEdgeIt(const Digraph& _graph, const Edge &ue, const Node &n)
   5.210 -	: digraph(&_graph), Edge(ue) {
   5.211 +      IncEdgeIt(const Graph& _graph, const Edge &ue, const Node &n)
   5.212 +	: graph(&_graph), Edge(ue) {
   5.213  	direction = (_graph.source(ue) == n);
   5.214        }
   5.215  
   5.216        IncEdgeIt& operator++() {
   5.217 -	digraph->nextInc(*this, direction);
   5.218 +	graph->nextInc(*this, direction);
   5.219  	return *this; 
   5.220        }
   5.221      };
   5.222 @@ -534,14 +533,13 @@
   5.223  
   5.224      template <typename _Value>
   5.225      class ArcMap 
   5.226 -      : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
   5.227 +      : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
   5.228 +      typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
   5.229 +
   5.230      public:
   5.231 -      typedef EdgeSetExtender Digraph;
   5.232 -      typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
   5.233 -
   5.234 -      ArcMap(const Digraph& _g) 
   5.235 +      ArcMap(const Graph& _g) 
   5.236  	: Parent(_g) {}
   5.237 -      ArcMap(const Digraph& _g, const _Value& _v) 
   5.238 +      ArcMap(const Graph& _g, const _Value& _v) 
   5.239  	: Parent(_g, _v) {}
   5.240  
   5.241        ArcMap& operator=(const ArcMap& cmap) {
   5.242 @@ -559,15 +557,14 @@
   5.243  
   5.244      template <typename _Value>
   5.245      class EdgeMap 
   5.246 -      : public MapExtender<DefaultMap<Digraph, Edge, _Value> > {
   5.247 +      : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
   5.248 +      typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
   5.249 +
   5.250      public:
   5.251 -      typedef EdgeSetExtender Digraph;
   5.252 -      typedef MapExtender<DefaultMap<Digraph, Edge, _Value> > Parent;
   5.253 -
   5.254 -      EdgeMap(const Digraph& _g) 
   5.255 +      EdgeMap(const Graph& _g) 
   5.256  	: Parent(_g) {}
   5.257  
   5.258 -      EdgeMap(const Digraph& _g, const _Value& _v) 
   5.259 +      EdgeMap(const Graph& _g, const _Value& _v) 
   5.260  	: Parent(_g, _v) {}
   5.261  
   5.262        EdgeMap& operator=(const EdgeMap& cmap) {
     6.1 --- a/lemon/bits/graph_adaptor_extender.h	Fri Apr 24 10:15:33 2009 +0200
     6.2 +++ b/lemon/bits/graph_adaptor_extender.h	Fri Apr 24 11:54:48 2009 +0200
     6.3 @@ -26,9 +26,10 @@
     6.4  
     6.5    template <typename _Digraph>
     6.6    class DigraphAdaptorExtender : public _Digraph {
     6.7 +    typedef _Digraph Parent;
     6.8 +
     6.9    public:
    6.10  
    6.11 -    typedef _Digraph Parent;
    6.12      typedef _Digraph Digraph;
    6.13      typedef DigraphAdaptorExtender Adaptor;
    6.14  
    6.15 @@ -173,9 +174,10 @@
    6.16  
    6.17    template <typename _Graph>
    6.18    class GraphAdaptorExtender : public _Graph {
    6.19 +    typedef _Graph Parent;
    6.20 +
    6.21    public:
    6.22  
    6.23 -    typedef _Graph Parent;
    6.24      typedef _Graph Graph;
    6.25      typedef GraphAdaptorExtender Adaptor;
    6.26  
     7.1 --- a/lemon/bits/graph_extender.h	Fri Apr 24 10:15:33 2009 +0200
     7.2 +++ b/lemon/bits/graph_extender.h	Fri Apr 24 11:54:48 2009 +0200
     7.3 @@ -37,9 +37,10 @@
     7.4    // \brief Extender for the digraph implementations
     7.5    template <typename Base>
     7.6    class DigraphExtender : public Base {
     7.7 +    typedef Base Parent;
     7.8 +
     7.9    public:
    7.10  
    7.11 -    typedef Base Parent;
    7.12      typedef DigraphExtender Digraph;
    7.13  
    7.14      // Base extensions
    7.15 @@ -218,10 +219,9 @@
    7.16      template <typename _Value>
    7.17      class NodeMap
    7.18        : public MapExtender<DefaultMap<Digraph, Node, _Value> > {
    7.19 -    public:
    7.20 -      typedef DigraphExtender Digraph;
    7.21        typedef MapExtender<DefaultMap<Digraph, Node, _Value> > Parent;
    7.22  
    7.23 +    public:
    7.24        explicit NodeMap(const Digraph& digraph)
    7.25          : Parent(digraph) {}
    7.26        NodeMap(const Digraph& digraph, const _Value& value)
    7.27 @@ -243,10 +243,9 @@
    7.28      template <typename _Value>
    7.29      class ArcMap
    7.30        : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
    7.31 -    public:
    7.32 -      typedef DigraphExtender Digraph;
    7.33        typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
    7.34  
    7.35 +    public:
    7.36        explicit ArcMap(const Digraph& digraph)
    7.37          : Parent(digraph) {}
    7.38        ArcMap(const Digraph& digraph, const _Value& value)
    7.39 @@ -330,9 +329,10 @@
    7.40    // \brief Extender for the Graphs
    7.41    template <typename Base>
    7.42    class GraphExtender : public Base {
    7.43 +    typedef Base Parent;
    7.44 +
    7.45    public:
    7.46  
    7.47 -    typedef Base Parent;
    7.48      typedef GraphExtender Graph;
    7.49  
    7.50      typedef True UndirectedTag;
    7.51 @@ -601,10 +601,9 @@
    7.52      template <typename _Value>
    7.53      class NodeMap
    7.54        : public MapExtender<DefaultMap<Graph, Node, _Value> > {
    7.55 -    public:
    7.56 -      typedef GraphExtender Graph;
    7.57        typedef MapExtender<DefaultMap<Graph, Node, _Value> > Parent;
    7.58  
    7.59 +    public:
    7.60        NodeMap(const Graph& graph)
    7.61          : Parent(graph) {}
    7.62        NodeMap(const Graph& graph, const _Value& value)
    7.63 @@ -626,10 +625,9 @@
    7.64      template <typename _Value>
    7.65      class ArcMap
    7.66        : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
    7.67 -    public:
    7.68 -      typedef GraphExtender Graph;
    7.69        typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
    7.70  
    7.71 +    public:
    7.72        ArcMap(const Graph& graph)
    7.73          : Parent(graph) {}
    7.74        ArcMap(const Graph& graph, const _Value& value)
    7.75 @@ -651,10 +649,9 @@
    7.76      template <typename _Value>
    7.77      class EdgeMap
    7.78        : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
    7.79 -    public:
    7.80 -      typedef GraphExtender Graph;
    7.81        typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
    7.82  
    7.83 +    public:
    7.84        EdgeMap(const Graph& graph)
    7.85          : Parent(graph) {}
    7.86  
     8.1 --- a/lemon/bits/map_extender.h	Fri Apr 24 10:15:33 2009 +0200
     8.2 +++ b/lemon/bits/map_extender.h	Fri Apr 24 11:54:48 2009 +0200
     8.3 @@ -36,13 +36,12 @@
     8.4    // \brief Extender for maps
     8.5    template <typename _Map>
     8.6    class MapExtender : public _Map {
     8.7 +    typedef _Map Parent;
     8.8 +    typedef typename Parent::GraphType GraphType;
     8.9 +
    8.10    public:
    8.11  
    8.12 -    typedef _Map Parent;
    8.13      typedef MapExtender Map;
    8.14 -
    8.15 -
    8.16 -    typedef typename Parent::Graph Graph;
    8.17      typedef typename Parent::Key Item;
    8.18  
    8.19      typedef typename Parent::Key Key;
    8.20 @@ -58,10 +57,10 @@
    8.21  
    8.22    public:
    8.23  
    8.24 -    MapExtender(const Graph& graph)
    8.25 +    MapExtender(const GraphType& graph)
    8.26        : Parent(graph) {}
    8.27  
    8.28 -    MapExtender(const Graph& graph, const Value& value)
    8.29 +    MapExtender(const GraphType& graph, const Value& value)
    8.30        : Parent(graph, value) {}
    8.31  
    8.32    private:
    8.33 @@ -77,9 +76,10 @@
    8.34  
    8.35    public:
    8.36      class MapIt : public Item {
    8.37 +      typedef Item Parent;
    8.38 +
    8.39      public:
    8.40  
    8.41 -      typedef Item Parent;
    8.42        typedef typename Map::Value Value;
    8.43  
    8.44        MapIt() {}
    8.45 @@ -116,10 +116,10 @@
    8.46      };
    8.47  
    8.48      class ConstMapIt : public Item {
    8.49 +      typedef Item Parent;
    8.50 +
    8.51      public:
    8.52  
    8.53 -      typedef Item Parent;
    8.54 -
    8.55        typedef typename Map::Value Value;
    8.56  
    8.57        ConstMapIt() {}
    8.58 @@ -147,10 +147,10 @@
    8.59      };
    8.60  
    8.61      class ItemIt : public Item {
    8.62 +      typedef Item Parent;
    8.63 +
    8.64      public:
    8.65  
    8.66 -      typedef Item Parent;
    8.67 -
    8.68        ItemIt() {}
    8.69  
    8.70        ItemIt(Invalid i) : Parent(i) { }
    8.71 @@ -178,13 +178,12 @@
    8.72    // \brief Extender for maps which use a subset of the items.
    8.73    template <typename _Graph, typename _Map>
    8.74    class SubMapExtender : public _Map {
    8.75 +    typedef _Map Parent;
    8.76 +    typedef _Graph GraphType;
    8.77 +
    8.78    public:
    8.79  
    8.80 -    typedef _Map Parent;
    8.81      typedef SubMapExtender Map;
    8.82 -
    8.83 -    typedef _Graph Graph;
    8.84 -
    8.85      typedef typename Parent::Key Item;
    8.86  
    8.87      typedef typename Parent::Key Key;
    8.88 @@ -200,10 +199,10 @@
    8.89  
    8.90    public:
    8.91  
    8.92 -    SubMapExtender(const Graph& _graph)
    8.93 +    SubMapExtender(const GraphType& _graph)
    8.94        : Parent(_graph), graph(_graph) {}
    8.95  
    8.96 -    SubMapExtender(const Graph& _graph, const Value& _value)
    8.97 +    SubMapExtender(const GraphType& _graph, const Value& _value)
    8.98        : Parent(_graph, _value), graph(_graph) {}
    8.99  
   8.100    private:
   8.101 @@ -223,9 +222,9 @@
   8.102  
   8.103    public:
   8.104      class MapIt : public Item {
   8.105 +      typedef Item Parent;
   8.106 +
   8.107      public:
   8.108 -
   8.109 -      typedef Item Parent;
   8.110        typedef typename Map::Value Value;
   8.111  
   8.112        MapIt() {}
   8.113 @@ -262,10 +261,10 @@
   8.114      };
   8.115  
   8.116      class ConstMapIt : public Item {
   8.117 +      typedef Item Parent;
   8.118 +
   8.119      public:
   8.120  
   8.121 -      typedef Item Parent;
   8.122 -
   8.123        typedef typename Map::Value Value;
   8.124  
   8.125        ConstMapIt() {}
   8.126 @@ -293,10 +292,10 @@
   8.127      };
   8.128  
   8.129      class ItemIt : public Item {
   8.130 +      typedef Item Parent;
   8.131 +
   8.132      public:
   8.133  
   8.134 -      typedef Item Parent;
   8.135 -
   8.136        ItemIt() {}
   8.137  
   8.138        ItemIt(Invalid i) : Parent(i) { }
   8.139 @@ -320,7 +319,7 @@
   8.140  
   8.141    private:
   8.142  
   8.143 -    const Graph& graph;
   8.144 +    const GraphType& graph;
   8.145  
   8.146    };
   8.147  
     9.1 --- a/lemon/bits/vector_map.h	Fri Apr 24 10:15:33 2009 +0200
     9.2 +++ b/lemon/bits/vector_map.h	Fri Apr 24 11:54:48 2009 +0200
     9.3 @@ -56,7 +56,7 @@
     9.4    public:
     9.5  
     9.6      // The graph type of the map.
     9.7 -    typedef _Graph Graph;
     9.8 +    typedef _Graph GraphType;
     9.9      // The item type of the map.
    9.10      typedef _Item Item;
    9.11      // The reference map tag.
    9.12 @@ -72,20 +72,24 @@
    9.13  
    9.14      // The map type.
    9.15      typedef VectorMap Map;
    9.16 -    // The base class of the map.
    9.17 -    typedef typename Notifier::ObserverBase Parent;
    9.18  
    9.19      // The reference type of the map;
    9.20      typedef typename Container::reference Reference;
    9.21      // The const reference type of the map;
    9.22      typedef typename Container::const_reference ConstReference;
    9.23  
    9.24 +  private:
    9.25 +
    9.26 +    // The base class of the map.
    9.27 +    typedef typename Notifier::ObserverBase Parent;
    9.28 +
    9.29 +  public:
    9.30  
    9.31      // \brief Constructor to attach the new map into the notifier.
    9.32      //
    9.33      // It constructs a map and attachs it into the notifier.
    9.34      // It adds all the items of the graph to the map.
    9.35 -    VectorMap(const Graph& graph) {
    9.36 +    VectorMap(const GraphType& graph) {
    9.37        Parent::attach(graph.notifier(Item()));
    9.38        container.resize(Parent::notifier()->maxId() + 1);
    9.39      }
    9.40 @@ -94,7 +98,7 @@
    9.41      //
    9.42      // It constructs a map uses a given value to initialize the map.
    9.43      // It adds all the items of the graph to the map.
    9.44 -    VectorMap(const Graph& graph, const Value& value) {
    9.45 +    VectorMap(const GraphType& graph, const Value& value) {
    9.46        Parent::attach(graph.notifier(Item()));
    9.47        container.resize(Parent::notifier()->maxId() + 1, value);
    9.48      }
    10.1 --- a/lemon/concepts/graph_components.h	Fri Apr 24 10:15:33 2009 +0200
    10.2 +++ b/lemon/concepts/graph_components.h	Fri Apr 24 11:54:48 2009 +0200
    10.3 @@ -180,6 +180,9 @@
    10.4      /// to convert from arcs to edges and to get both direction of edges.
    10.5      class BaseGraphComponent : public BaseDigraphComponent {
    10.6      public:
    10.7 +
    10.8 +      typedef BaseGraphComponent Graph;
    10.9 +
   10.10        typedef BaseDigraphComponent::Node Node;
   10.11        typedef BaseDigraphComponent::Arc Arc;
   10.12  
   10.13 @@ -189,9 +192,9 @@
   10.14        /// Undirected graphs can be used as directed graphs, each edge is
   10.15        /// represented by two opposite directed arcs.
   10.16        class Edge : public GraphItem<'e'> {
   10.17 -      public:
   10.18          typedef GraphItem<'e'> Parent;
   10.19  
   10.20 +      public:
   10.21          /// \brief Default constructor.
   10.22          ///
   10.23          /// Default constructor.
   10.24 @@ -991,12 +994,10 @@
   10.25      /// The standard graph maps must conform to the ReferenceMap concept.
   10.26      template <typename GR, typename K, typename V>
   10.27      class GraphMap : public ReferenceMap<K, V, V&, const V&> {
   10.28 +      typedef ReferenceMap<K, V, V&, const V&> Parent;
   10.29 +
   10.30      public:
   10.31  
   10.32 -      typedef ReadWriteMap<K, V> Parent;
   10.33 -
   10.34 -      /// The graph type of the map.
   10.35 -      typedef GR Graph;
   10.36        /// The key type of the map.
   10.37        typedef K Key;
   10.38        /// The value type of the map.
   10.39 @@ -1012,11 +1013,11 @@
   10.40        /// \brief Construct a new map.
   10.41        ///
   10.42        /// Construct a new map for the graph.
   10.43 -      explicit GraphMap(const Graph&) {}
   10.44 +      explicit GraphMap(const GR&) {}
   10.45        /// \brief Construct a new map with default value.
   10.46        ///
   10.47        /// Construct a new map for the graph and initalize the values.
   10.48 -      GraphMap(const Graph&, const Value&) {}
   10.49 +      GraphMap(const GR&, const Value&) {}
   10.50  
   10.51      private:
   10.52        /// \brief Copy constructor.
   10.53 @@ -1057,7 +1058,7 @@
   10.54          }
   10.55  
   10.56          const _Map &m;
   10.57 -        const Graph &g;
   10.58 +        const GR &g;
   10.59          const typename GraphMap::Value &t;
   10.60        };
   10.61  
   10.62 @@ -1085,9 +1086,9 @@
   10.63        /// It conforms to the ReferenceMap concept.
   10.64        template <typename V>
   10.65        class NodeMap : public GraphMap<MappableDigraphComponent, Node, V> {
   10.66 -      public:
   10.67          typedef GraphMap<MappableDigraphComponent, Node, V> Parent;
   10.68  
   10.69 +      public:
   10.70          /// \brief Construct a new map.
   10.71          ///
   10.72          /// Construct a new map for the digraph.
   10.73 @@ -1123,9 +1124,9 @@
   10.74        /// It conforms to the ReferenceMap concept.
   10.75        template <typename V>
   10.76        class ArcMap : public GraphMap<MappableDigraphComponent, Arc, V> {
   10.77 -      public:
   10.78          typedef GraphMap<MappableDigraphComponent, Arc, V> Parent;
   10.79  
   10.80 +      public:
   10.81          /// \brief Construct a new map.
   10.82          ///
   10.83          /// Construct a new map for the digraph.
   10.84 @@ -1221,9 +1222,9 @@
   10.85        /// It conforms to the ReferenceMap concept.
   10.86        template <typename V>
   10.87        class EdgeMap : public GraphMap<MappableGraphComponent, Edge, V> {
   10.88 -      public:
   10.89          typedef GraphMap<MappableGraphComponent, Edge, V> Parent;
   10.90  
   10.91 +      public:
   10.92          /// \brief Construct a new map.
   10.93          ///
   10.94          /// Construct a new map for the graph.
    11.1 --- a/lemon/core.h	Fri Apr 24 10:15:33 2009 +0200
    11.2 +++ b/lemon/core.h	Fri Apr 24 11:54:48 2009 +0200
    11.3 @@ -1036,26 +1036,25 @@
    11.4    ///\sa ArcLookUp, AllArcLookUp, DynArcLookUp
    11.5    template <typename GR>
    11.6    class ConArcIt : public GR::Arc {
    11.7 +    typedef typename GR::Arc Parent;
    11.8 +
    11.9    public:
   11.10  
   11.11 -    typedef GR Graph;
   11.12 -    typedef typename Graph::Arc Parent;
   11.13 -
   11.14 -    typedef typename Graph::Arc Arc;
   11.15 -    typedef typename Graph::Node Node;
   11.16 +    typedef typename GR::Arc Arc;
   11.17 +    typedef typename GR::Node Node;
   11.18  
   11.19      /// \brief Constructor.
   11.20      ///
   11.21      /// Construct a new ConArcIt iterating on the arcs that
   11.22      /// connects nodes \c u and \c v.
   11.23 -    ConArcIt(const Graph& g, Node u, Node v) : _graph(g) {
   11.24 +    ConArcIt(const GR& g, Node u, Node v) : _graph(g) {
   11.25        Parent::operator=(findArc(_graph, u, v));
   11.26      }
   11.27  
   11.28      /// \brief Constructor.
   11.29      ///
   11.30      /// Construct a new ConArcIt that continues the iterating from arc \c a.
   11.31 -    ConArcIt(const Graph& g, Arc a) : Parent(a), _graph(g) {}
   11.32 +    ConArcIt(const GR& g, Arc a) : Parent(a), _graph(g) {}
   11.33  
   11.34      /// \brief Increment operator.
   11.35      ///
   11.36 @@ -1066,7 +1065,7 @@
   11.37        return *this;
   11.38      }
   11.39    private:
   11.40 -    const Graph& _graph;
   11.41 +    const GR& _graph;
   11.42    };
   11.43  
   11.44    namespace _core_bits {
   11.45 @@ -1159,26 +1158,25 @@
   11.46    ///\sa findEdge()
   11.47    template <typename GR>
   11.48    class ConEdgeIt : public GR::Edge {
   11.49 +    typedef typename GR::Edge Parent;
   11.50 +
   11.51    public:
   11.52  
   11.53 -    typedef GR Graph;
   11.54 -    typedef typename Graph::Edge Parent;
   11.55 -
   11.56 -    typedef typename Graph::Edge Edge;
   11.57 -    typedef typename Graph::Node Node;
   11.58 +    typedef typename GR::Edge Edge;
   11.59 +    typedef typename GR::Node Node;
   11.60  
   11.61      /// \brief Constructor.
   11.62      ///
   11.63      /// Construct a new ConEdgeIt iterating on the edges that
   11.64      /// connects nodes \c u and \c v.
   11.65 -    ConEdgeIt(const Graph& g, Node u, Node v) : _graph(g), _u(u), _v(v) {
   11.66 +    ConEdgeIt(const GR& g, Node u, Node v) : _graph(g), _u(u), _v(v) {
   11.67        Parent::operator=(findEdge(_graph, _u, _v));
   11.68      }
   11.69  
   11.70      /// \brief Constructor.
   11.71      ///
   11.72      /// Construct a new ConEdgeIt that continues iterating from edge \c e.
   11.73 -    ConEdgeIt(const Graph& g, Edge e) : Parent(e), _graph(g) {}
   11.74 +    ConEdgeIt(const GR& g, Edge e) : Parent(e), _graph(g) {}
   11.75  
   11.76      /// \brief Increment operator.
   11.77      ///
   11.78 @@ -1188,7 +1186,7 @@
   11.79        return *this;
   11.80      }
   11.81    private:
   11.82 -    const Graph& _graph;
   11.83 +    const GR& _graph;
   11.84      Node _u, _v;
   11.85    };
   11.86  
   11.87 @@ -1219,20 +1217,23 @@
   11.88    class DynArcLookUp
   11.89      : protected ItemSetTraits<GR, typename GR::Arc>::ItemNotifier::ObserverBase
   11.90    {
   11.91 -  public:
   11.92      typedef typename ItemSetTraits<GR, typename GR::Arc>
   11.93      ::ItemNotifier::ObserverBase Parent;
   11.94  
   11.95      TEMPLATE_DIGRAPH_TYPEDEFS(GR);
   11.96 +
   11.97 +  public:
   11.98 +
   11.99 +    /// The Digraph type
  11.100      typedef GR Digraph;
  11.101  
  11.102    protected:
  11.103  
  11.104      class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type {
  11.105 +      typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent;
  11.106 +
  11.107      public:
  11.108  
  11.109 -      typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent;
  11.110 -
  11.111        AutoNodeMap(const GR& digraph) : Parent(digraph, INVALID) {}
  11.112  
  11.113        virtual void add(const Node& node) {
  11.114 @@ -1257,12 +1258,6 @@
  11.115        }
  11.116      };
  11.117  
  11.118 -    const Digraph &_g;
  11.119 -    AutoNodeMap _head;
  11.120 -    typename Digraph::template ArcMap<Arc> _parent;
  11.121 -    typename Digraph::template ArcMap<Arc> _left;
  11.122 -    typename Digraph::template ArcMap<Arc> _right;
  11.123 -
  11.124      class ArcLess {
  11.125        const Digraph &g;
  11.126      public:
  11.127 @@ -1273,6 +1268,14 @@
  11.128        }
  11.129      };
  11.130  
  11.131 +  protected: 
  11.132 +
  11.133 +    const Digraph &_g;
  11.134 +    AutoNodeMap _head;
  11.135 +    typename Digraph::template ArcMap<Arc> _parent;
  11.136 +    typename Digraph::template ArcMap<Arc> _left;
  11.137 +    typename Digraph::template ArcMap<Arc> _right;
  11.138 +
  11.139    public:
  11.140  
  11.141      ///Constructor
  11.142 @@ -1630,8 +1633,11 @@
  11.143    template<class GR>
  11.144    class ArcLookUp
  11.145    {
  11.146 +    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
  11.147 +
  11.148    public:
  11.149 -    TEMPLATE_DIGRAPH_TYPEDEFS(GR);
  11.150 +
  11.151 +    /// The Digraph type
  11.152      typedef GR Digraph;
  11.153  
  11.154    protected:
  11.155 @@ -1746,9 +1752,8 @@
  11.156      using ArcLookUp<GR>::_head;
  11.157  
  11.158      TEMPLATE_DIGRAPH_TYPEDEFS(GR);
  11.159 -    typedef GR Digraph;
  11.160  
  11.161 -    typename Digraph::template ArcMap<Arc> _next;
  11.162 +    typename GR::template ArcMap<Arc> _next;
  11.163  
  11.164      Arc refreshNext(Arc head,Arc next=INVALID)
  11.165      {
  11.166 @@ -1767,6 +1772,10 @@
  11.167      }
  11.168  
  11.169    public:
  11.170 +
  11.171 +    /// The Digraph type
  11.172 +    typedef GR Digraph;
  11.173 +
  11.174      ///Constructor
  11.175  
  11.176      ///Constructor.
    12.1 --- a/lemon/edge_set.h	Fri Apr 24 10:15:33 2009 +0200
    12.2 +++ b/lemon/edge_set.h	Fri Apr 24 11:54:48 2009 +0200
    12.3 @@ -33,7 +33,6 @@
    12.4    class ListArcSetBase {
    12.5    public:
    12.6  
    12.7 -    typedef GR Graph;
    12.8      typedef typename GR::Node Node;
    12.9      typedef typename GR::NodeIt NodeIt;
   12.10  
   12.11 @@ -208,10 +207,10 @@
   12.12  
   12.13      template <typename V>
   12.14      class NodeMap : public GR::template NodeMap<V> {
   12.15 +      typedef typename GR::template NodeMap<V> Parent;
   12.16 +
   12.17      public:
   12.18  
   12.19 -      typedef typename GR::template NodeMap<V> Parent;
   12.20 -
   12.21        explicit NodeMap(const ListArcSetBase<GR>& arcset)
   12.22          : Parent(*arcset._graph) {}
   12.23  
   12.24 @@ -259,17 +258,13 @@
   12.25    /// "Digraph" concept.
   12.26    template <typename GR>
   12.27    class ListArcSet : public ArcSetExtender<ListArcSetBase<GR> > {
   12.28 +    typedef ArcSetExtender<ListArcSetBase<GR> > Parent;
   12.29  
   12.30    public:
   12.31  
   12.32 -    typedef ArcSetExtender<ListArcSetBase<GR> > Parent;
   12.33 -
   12.34      typedef typename Parent::Node Node;
   12.35      typedef typename Parent::Arc Arc;
   12.36  
   12.37 -    typedef GR Graph;
   12.38 -
   12.39 -
   12.40      typedef typename Parent::NodesImplBase NodesImplBase;
   12.41  
   12.42      void eraseNode(const Node& node) {
   12.43 @@ -292,9 +287,9 @@
   12.44      }
   12.45  
   12.46      class NodesImpl : public NodesImplBase {
   12.47 -    public:
   12.48        typedef NodesImplBase Parent;
   12.49  
   12.50 +    public:
   12.51        NodesImpl(const GR& graph, ListArcSet& arcset)
   12.52          : Parent(graph), _arcset(arcset) {}
   12.53  
   12.54 @@ -354,7 +349,6 @@
   12.55    class ListEdgeSetBase {
   12.56    public:
   12.57  
   12.58 -    typedef GR Graph;
   12.59      typedef typename GR::Node Node;
   12.60      typedef typename GR::NodeIt NodeIt;
   12.61  
   12.62 @@ -637,10 +631,10 @@
   12.63  
   12.64      template <typename V>
   12.65      class NodeMap : public GR::template NodeMap<V> {
   12.66 +      typedef typename GR::template NodeMap<V> Parent;
   12.67 +
   12.68      public:
   12.69  
   12.70 -      typedef typename GR::template NodeMap<V> Parent;
   12.71 -
   12.72        explicit NodeMap(const ListEdgeSetBase<GR>& arcset)
   12.73          : Parent(*arcset._graph) {}
   12.74  
   12.75 @@ -688,18 +682,14 @@
   12.76    /// concept.
   12.77    template <typename GR>
   12.78    class ListEdgeSet : public EdgeSetExtender<ListEdgeSetBase<GR> > {
   12.79 +    typedef EdgeSetExtender<ListEdgeSetBase<GR> > Parent;
   12.80  
   12.81    public:
   12.82  
   12.83 -    typedef EdgeSetExtender<ListEdgeSetBase<GR> > Parent;
   12.84 -
   12.85      typedef typename Parent::Node Node;
   12.86      typedef typename Parent::Arc Arc;
   12.87      typedef typename Parent::Edge Edge;
   12.88  
   12.89 -    typedef GR Graph;
   12.90 -
   12.91 -
   12.92      typedef typename Parent::NodesImplBase NodesImplBase;
   12.93  
   12.94      void eraseNode(const Node& node) {
   12.95 @@ -717,9 +707,9 @@
   12.96      }
   12.97  
   12.98      class NodesImpl : public NodesImplBase {
   12.99 -    public:
  12.100        typedef NodesImplBase Parent;
  12.101  
  12.102 +    public:
  12.103        NodesImpl(const GR& graph, ListEdgeSet& arcset)
  12.104          : Parent(graph), _arcset(arcset) {}
  12.105  
  12.106 @@ -779,9 +769,8 @@
  12.107    class SmartArcSetBase {
  12.108    public:
  12.109  
  12.110 -    typedef GR Graph;
  12.111 -    typedef typename Graph::Node Node;
  12.112 -    typedef typename Graph::NodeIt NodeIt;
  12.113 +    typedef typename GR::Node Node;
  12.114 +    typedef typename GR::NodeIt NodeIt;
  12.115  
  12.116    protected:
  12.117  
  12.118 @@ -900,10 +889,10 @@
  12.119  
  12.120      template <typename V>
  12.121      class NodeMap : public GR::template NodeMap<V> {
  12.122 +      typedef typename GR::template NodeMap<V> Parent;
  12.123 +
  12.124      public:
  12.125  
  12.126 -      typedef typename GR::template NodeMap<V> Parent;
  12.127 -
  12.128        explicit NodeMap(const SmartArcSetBase<GR>& arcset)
  12.129          : Parent(*arcset._graph) { }
  12.130  
  12.131 @@ -956,16 +945,13 @@
  12.132    /// "Digraph" concept.
  12.133    template <typename GR>
  12.134    class SmartArcSet : public ArcSetExtender<SmartArcSetBase<GR> > {
  12.135 +    typedef ArcSetExtender<SmartArcSetBase<GR> > Parent;
  12.136  
  12.137    public:
  12.138  
  12.139 -    typedef ArcSetExtender<SmartArcSetBase<GR> > Parent;
  12.140 -
  12.141      typedef typename Parent::Node Node;
  12.142      typedef typename Parent::Arc Arc;
  12.143  
  12.144 -    typedef GR Graph;
  12.145 -
  12.146    protected:
  12.147  
  12.148      typedef typename Parent::NodesImplBase NodesImplBase;
  12.149 @@ -983,9 +969,9 @@
  12.150      }
  12.151  
  12.152      class NodesImpl : public NodesImplBase {
  12.153 -    public:
  12.154        typedef NodesImplBase Parent;
  12.155  
  12.156 +    public:
  12.157        NodesImpl(const GR& graph, SmartArcSet& arcset)
  12.158          : Parent(graph), _arcset(arcset) {}
  12.159  
  12.160 @@ -1062,7 +1048,6 @@
  12.161    class SmartEdgeSetBase {
  12.162    public:
  12.163  
  12.164 -    typedef GR Graph;
  12.165      typedef typename GR::Node Node;
  12.166      typedef typename GR::NodeIt NodeIt;
  12.167  
  12.168 @@ -1249,10 +1234,10 @@
  12.169  
  12.170      template <typename V>
  12.171      class NodeMap : public GR::template NodeMap<V> {
  12.172 +      typedef typename GR::template NodeMap<V> Parent;
  12.173 +
  12.174      public:
  12.175  
  12.176 -      typedef typename GR::template NodeMap<V> Parent;
  12.177 -
  12.178        explicit NodeMap(const SmartEdgeSetBase<GR>& arcset)
  12.179          : Parent(*arcset._graph) { }
  12.180  
  12.181 @@ -1304,17 +1289,14 @@
  12.182    /// "Graph" concept.
  12.183    template <typename GR>
  12.184    class SmartEdgeSet : public EdgeSetExtender<SmartEdgeSetBase<GR> > {
  12.185 +    typedef EdgeSetExtender<SmartEdgeSetBase<GR> > Parent;
  12.186  
  12.187    public:
  12.188  
  12.189 -    typedef EdgeSetExtender<SmartEdgeSetBase<GR> > Parent;
  12.190 -
  12.191      typedef typename Parent::Node Node;
  12.192      typedef typename Parent::Arc Arc;
  12.193      typedef typename Parent::Edge Edge;
  12.194  
  12.195 -    typedef GR Graph;
  12.196 -
  12.197    protected:
  12.198  
  12.199      typedef typename Parent::NodesImplBase NodesImplBase;
  12.200 @@ -1331,9 +1313,9 @@
  12.201      }
  12.202  
  12.203      class NodesImpl : public NodesImplBase {
  12.204 -    public:
  12.205        typedef NodesImplBase Parent;
  12.206  
  12.207 +    public:
  12.208        NodesImpl(const GR& graph, SmartEdgeSet& arcset)
  12.209          : Parent(graph), _arcset(arcset) {}
  12.210  
    13.1 --- a/lemon/full_graph.h	Fri Apr 24 10:15:33 2009 +0200
    13.2 +++ b/lemon/full_graph.h	Fri Apr 24 11:54:48 2009 +0200
    13.3 @@ -31,7 +31,7 @@
    13.4    class FullDigraphBase {
    13.5    public:
    13.6  
    13.7 -    typedef FullDigraphBase Graph;
    13.8 +    typedef FullDigraphBase Digraph;
    13.9  
   13.10      class Node;
   13.11      class Arc;
   13.12 @@ -169,10 +169,10 @@
   13.13    ///
   13.14    /// \sa FullGraph
   13.15    class FullDigraph : public ExtendedFullDigraphBase {
   13.16 +    typedef ExtendedFullDigraphBase Parent;
   13.17 +
   13.18    public:
   13.19  
   13.20 -    typedef ExtendedFullDigraphBase Parent;
   13.21 -
   13.22      /// \brief Constructor
   13.23      FullDigraph() { construct(0); }
   13.24  
   13.25 @@ -226,8 +226,6 @@
   13.26  
   13.27  
   13.28    class FullGraphBase {
   13.29 -    int _node_num;
   13.30 -    int _edge_num;
   13.31    public:
   13.32  
   13.33      typedef FullGraphBase Graph;
   13.34 @@ -238,6 +236,9 @@
   13.35  
   13.36    protected:
   13.37  
   13.38 +    int _node_num;
   13.39 +    int _edge_num;
   13.40 +
   13.41      FullGraphBase() {}
   13.42  
   13.43      void construct(int n) { _node_num = n; _edge_num = n * (n - 1) / 2; }
   13.44 @@ -537,10 +538,10 @@
   13.45    ///
   13.46    /// \sa FullDigraph
   13.47    class FullGraph : public ExtendedFullGraphBase {
   13.48 +    typedef ExtendedFullGraphBase Parent;
   13.49 +
   13.50    public:
   13.51  
   13.52 -    typedef ExtendedFullGraphBase Parent;
   13.53 -
   13.54      /// \brief Constructor
   13.55      FullGraph() { construct(0); }
   13.56  
    14.1 --- a/lemon/graph_to_eps.h	Fri Apr 24 10:15:33 2009 +0200
    14.2 +++ b/lemon/graph_to_eps.h	Fri Apr 24 11:54:48 2009 +0200
    14.3 @@ -69,6 +69,7 @@
    14.4  struct DefaultGraphToEpsTraits
    14.5  {
    14.6    typedef GR Graph;
    14.7 +  typedef GR Digraph;
    14.8    typedef typename Graph::Node Node;
    14.9    typedef typename Graph::NodeIt NodeIt;
   14.10    typedef typename Graph::Arc Arc;
   14.11 @@ -241,6 +242,7 @@
   14.12    // dradnats ++C eht yb deriuqer si ti eveileb t'naC
   14.13  
   14.14    typedef typename T::Graph Graph;
   14.15 +  typedef typename T::Digraph Digraph;
   14.16    typedef typename Graph::Node Node;
   14.17    typedef typename Graph::NodeIt NodeIt;
   14.18    typedef typename Graph::Arc Arc;
    15.1 --- a/lemon/grid_graph.h	Fri Apr 24 10:15:33 2009 +0200
    15.2 +++ b/lemon/grid_graph.h	Fri Apr 24 11:54:48 2009 +0200
    15.3 @@ -499,10 +499,10 @@
    15.4    /// This graph type fully conforms to the \ref concepts::Graph
    15.5    /// "Graph concept".
    15.6    class GridGraph : public ExtendedGridGraphBase {
    15.7 +    typedef ExtendedGridGraphBase Parent;
    15.8 +
    15.9    public:
   15.10  
   15.11 -    typedef ExtendedGridGraphBase Parent;
   15.12 -
   15.13      /// \brief Map to get the indices of the nodes as dim2::Point<int>.
   15.14      ///
   15.15      /// Map to get the indices of the nodes as dim2::Point<int>.
    16.1 --- a/lemon/hypercube_graph.h	Fri Apr 24 10:15:33 2009 +0200
    16.2 +++ b/lemon/hypercube_graph.h	Fri Apr 24 11:54:48 2009 +0200
    16.3 @@ -294,10 +294,10 @@
    16.4    /// This graph type fully conforms to the \ref concepts::Graph
    16.5    /// "Graph concept".
    16.6    class HypercubeGraph : public ExtendedHypercubeGraphBase {
    16.7 +    typedef ExtendedHypercubeGraphBase Parent;
    16.8 +
    16.9    public:
   16.10  
   16.11 -    typedef ExtendedHypercubeGraphBase Parent;
   16.12 -
   16.13      /// \brief Constructs a hypercube graph with \c dim dimensions.
   16.14      ///
   16.15      /// Constructs a hypercube graph with \c dim dimensions.
    17.1 --- a/lemon/list_graph.h	Fri Apr 24 10:15:33 2009 +0200
    17.2 +++ b/lemon/list_graph.h	Fri Apr 24 11:54:48 2009 +0200
    17.3 @@ -323,6 +323,8 @@
    17.4    ///\sa concepts::Digraph
    17.5  
    17.6    class ListDigraph : public ExtendedListDigraphBase {
    17.7 +    typedef ExtendedListDigraphBase Parent;
    17.8 +
    17.9    private:
   17.10      ///ListDigraph is \e not copy constructible. Use copyDigraph() instead.
   17.11  
   17.12 @@ -337,8 +339,6 @@
   17.13      void operator=(const ListDigraph &) {}
   17.14    public:
   17.15  
   17.16 -    typedef ExtendedListDigraphBase Parent;
   17.17 -
   17.18      /// Constructor
   17.19  
   17.20      /// Constructor.
   17.21 @@ -793,7 +793,7 @@
   17.22  
   17.23    public:
   17.24  
   17.25 -    typedef ListGraphBase Digraph;
   17.26 +    typedef ListGraphBase Graph;
   17.27  
   17.28      class Node;
   17.29      class Arc;
   17.30 @@ -1176,6 +1176,8 @@
   17.31    ///\sa concepts::Graph
   17.32  
   17.33    class ListGraph : public ExtendedListGraphBase {
   17.34 +    typedef ExtendedListGraphBase Parent;
   17.35 +
   17.36    private:
   17.37      ///ListGraph is \e not copy constructible. Use copyGraph() instead.
   17.38  
   17.39 @@ -1195,8 +1197,6 @@
   17.40      ///
   17.41      ListGraph() {}
   17.42  
   17.43 -    typedef ExtendedListGraphBase Parent;
   17.44 -
   17.45      typedef Parent::OutArcIt IncEdgeIt;
   17.46  
   17.47      /// \brief Add a new node to the graph.
    18.1 --- a/lemon/maps.h	Fri Apr 24 10:15:33 2009 +0200
    18.2 +++ b/lemon/maps.h	Fri Apr 24 11:54:48 2009 +0200
    18.3 @@ -1838,6 +1838,7 @@
    18.4    public:
    18.5      /// The graph type of IdMap.
    18.6      typedef GR Graph;
    18.7 +    typedef GR Digraph;
    18.8      /// The key type of IdMap (\c Node, \c Arc or \c Edge).
    18.9      typedef K Item;
   18.10      /// The key type of IdMap (\c Node, \c Arc or \c Edge).
   18.11 @@ -1929,6 +1930,7 @@
   18.12  
   18.13      /// The graph type of CrossRefMap.
   18.14      typedef GR Graph;
   18.15 +    typedef GR Digraph;
   18.16      /// The key type of CrossRefMap (\c Node, \c Arc or \c Edge).
   18.17      typedef K Item;
   18.18      /// The key type of CrossRefMap (\c Node, \c Arc or \c Edge).
   18.19 @@ -2132,6 +2134,7 @@
   18.20    public:
   18.21      /// The graph type of RangeIdMap.
   18.22      typedef GR Graph;
   18.23 +    typedef GR Digraph;
   18.24      /// The key type of RangeIdMap (\c Node, \c Arc or \c Edge).
   18.25      typedef K Item;
   18.26      /// The key type of RangeIdMap (\c Node, \c Arc or \c Edge).
   18.27 @@ -2494,7 +2497,8 @@
   18.28  
   18.29    public:
   18.30      
   18.31 -    /// The digraph type
   18.32 +    /// The graph type of InDegMap
   18.33 +    typedef GR Graph;
   18.34      typedef GR Digraph;
   18.35      /// The key type
   18.36      typedef typename Digraph::Node Key;
   18.37 @@ -2623,7 +2627,8 @@
   18.38  
   18.39    public:
   18.40  
   18.41 -    /// The digraph type
   18.42 +    /// The graph type of OutDegMap
   18.43 +    typedef GR Graph;
   18.44      typedef GR Digraph;
   18.45      /// The key type
   18.46      typedef typename Digraph::Node Key;
    19.1 --- a/lemon/smart_graph.h	Fri Apr 24 10:15:33 2009 +0200
    19.2 +++ b/lemon/smart_graph.h	Fri Apr 24 11:54:48 2009 +0200
    19.3 @@ -55,7 +55,7 @@
    19.4  
    19.5    public:
    19.6  
    19.7 -    typedef SmartDigraphBase Graph;
    19.8 +    typedef SmartDigraphBase Digraph;
    19.9  
   19.10      class Node;
   19.11      class Arc;
   19.12 @@ -195,8 +195,6 @@
   19.13    ///
   19.14    ///\sa concepts::Digraph.
   19.15    class SmartDigraph : public ExtendedSmartDigraphBase {
   19.16 -  public:
   19.17 -
   19.18      typedef ExtendedSmartDigraphBase Parent;
   19.19  
   19.20    private:
   19.21 @@ -420,7 +418,7 @@
   19.22  
   19.23    public:
   19.24  
   19.25 -    typedef SmartGraphBase Digraph;
   19.26 +    typedef SmartGraphBase Graph;
   19.27  
   19.28      class Node;
   19.29      class Arc;
   19.30 @@ -631,6 +629,8 @@
   19.31    ///
   19.32    /// \sa concepts::Graph.
   19.33    class SmartGraph : public ExtendedSmartGraphBase {
   19.34 +    typedef ExtendedSmartGraphBase Parent;
   19.35 +
   19.36    private:
   19.37  
   19.38      ///SmartGraph is \e not copy constructible. Use GraphCopy() instead.
   19.39 @@ -648,8 +648,6 @@
   19.40  
   19.41    public:
   19.42  
   19.43 -    typedef ExtendedSmartGraphBase Parent;
   19.44 -
   19.45      /// Constructor
   19.46  
   19.47      /// Constructor.