lemon/edge_set.h
changeset 617 4137ef9aacc6
parent 559 c5fd2d996909
child 660 d9cf3b5858ae
     1.1 --- a/lemon/edge_set.h	Fri Apr 24 10:15:33 2009 +0200
     1.2 +++ b/lemon/edge_set.h	Fri Apr 24 11:54:48 2009 +0200
     1.3 @@ -33,7 +33,6 @@
     1.4    class ListArcSetBase {
     1.5    public:
     1.6  
     1.7 -    typedef GR Graph;
     1.8      typedef typename GR::Node Node;
     1.9      typedef typename GR::NodeIt NodeIt;
    1.10  
    1.11 @@ -208,10 +207,10 @@
    1.12  
    1.13      template <typename V>
    1.14      class NodeMap : public GR::template NodeMap<V> {
    1.15 +      typedef typename GR::template NodeMap<V> Parent;
    1.16 +
    1.17      public:
    1.18  
    1.19 -      typedef typename GR::template NodeMap<V> Parent;
    1.20 -
    1.21        explicit NodeMap(const ListArcSetBase<GR>& arcset)
    1.22          : Parent(*arcset._graph) {}
    1.23  
    1.24 @@ -259,17 +258,13 @@
    1.25    /// "Digraph" concept.
    1.26    template <typename GR>
    1.27    class ListArcSet : public ArcSetExtender<ListArcSetBase<GR> > {
    1.28 +    typedef ArcSetExtender<ListArcSetBase<GR> > Parent;
    1.29  
    1.30    public:
    1.31  
    1.32 -    typedef ArcSetExtender<ListArcSetBase<GR> > Parent;
    1.33 -
    1.34      typedef typename Parent::Node Node;
    1.35      typedef typename Parent::Arc Arc;
    1.36  
    1.37 -    typedef GR Graph;
    1.38 -
    1.39 -
    1.40      typedef typename Parent::NodesImplBase NodesImplBase;
    1.41  
    1.42      void eraseNode(const Node& node) {
    1.43 @@ -292,9 +287,9 @@
    1.44      }
    1.45  
    1.46      class NodesImpl : public NodesImplBase {
    1.47 -    public:
    1.48        typedef NodesImplBase Parent;
    1.49  
    1.50 +    public:
    1.51        NodesImpl(const GR& graph, ListArcSet& arcset)
    1.52          : Parent(graph), _arcset(arcset) {}
    1.53  
    1.54 @@ -354,7 +349,6 @@
    1.55    class ListEdgeSetBase {
    1.56    public:
    1.57  
    1.58 -    typedef GR Graph;
    1.59      typedef typename GR::Node Node;
    1.60      typedef typename GR::NodeIt NodeIt;
    1.61  
    1.62 @@ -637,10 +631,10 @@
    1.63  
    1.64      template <typename V>
    1.65      class NodeMap : public GR::template NodeMap<V> {
    1.66 +      typedef typename GR::template NodeMap<V> Parent;
    1.67 +
    1.68      public:
    1.69  
    1.70 -      typedef typename GR::template NodeMap<V> Parent;
    1.71 -
    1.72        explicit NodeMap(const ListEdgeSetBase<GR>& arcset)
    1.73          : Parent(*arcset._graph) {}
    1.74  
    1.75 @@ -688,18 +682,14 @@
    1.76    /// concept.
    1.77    template <typename GR>
    1.78    class ListEdgeSet : public EdgeSetExtender<ListEdgeSetBase<GR> > {
    1.79 +    typedef EdgeSetExtender<ListEdgeSetBase<GR> > Parent;
    1.80  
    1.81    public:
    1.82  
    1.83 -    typedef EdgeSetExtender<ListEdgeSetBase<GR> > Parent;
    1.84 -
    1.85      typedef typename Parent::Node Node;
    1.86      typedef typename Parent::Arc Arc;
    1.87      typedef typename Parent::Edge Edge;
    1.88  
    1.89 -    typedef GR Graph;
    1.90 -
    1.91 -
    1.92      typedef typename Parent::NodesImplBase NodesImplBase;
    1.93  
    1.94      void eraseNode(const Node& node) {
    1.95 @@ -717,9 +707,9 @@
    1.96      }
    1.97  
    1.98      class NodesImpl : public NodesImplBase {
    1.99 -    public:
   1.100        typedef NodesImplBase Parent;
   1.101  
   1.102 +    public:
   1.103        NodesImpl(const GR& graph, ListEdgeSet& arcset)
   1.104          : Parent(graph), _arcset(arcset) {}
   1.105  
   1.106 @@ -779,9 +769,8 @@
   1.107    class SmartArcSetBase {
   1.108    public:
   1.109  
   1.110 -    typedef GR Graph;
   1.111 -    typedef typename Graph::Node Node;
   1.112 -    typedef typename Graph::NodeIt NodeIt;
   1.113 +    typedef typename GR::Node Node;
   1.114 +    typedef typename GR::NodeIt NodeIt;
   1.115  
   1.116    protected:
   1.117  
   1.118 @@ -900,10 +889,10 @@
   1.119  
   1.120      template <typename V>
   1.121      class NodeMap : public GR::template NodeMap<V> {
   1.122 +      typedef typename GR::template NodeMap<V> Parent;
   1.123 +
   1.124      public:
   1.125  
   1.126 -      typedef typename GR::template NodeMap<V> Parent;
   1.127 -
   1.128        explicit NodeMap(const SmartArcSetBase<GR>& arcset)
   1.129          : Parent(*arcset._graph) { }
   1.130  
   1.131 @@ -956,16 +945,13 @@
   1.132    /// "Digraph" concept.
   1.133    template <typename GR>
   1.134    class SmartArcSet : public ArcSetExtender<SmartArcSetBase<GR> > {
   1.135 +    typedef ArcSetExtender<SmartArcSetBase<GR> > Parent;
   1.136  
   1.137    public:
   1.138  
   1.139 -    typedef ArcSetExtender<SmartArcSetBase<GR> > Parent;
   1.140 -
   1.141      typedef typename Parent::Node Node;
   1.142      typedef typename Parent::Arc Arc;
   1.143  
   1.144 -    typedef GR Graph;
   1.145 -
   1.146    protected:
   1.147  
   1.148      typedef typename Parent::NodesImplBase NodesImplBase;
   1.149 @@ -983,9 +969,9 @@
   1.150      }
   1.151  
   1.152      class NodesImpl : public NodesImplBase {
   1.153 -    public:
   1.154        typedef NodesImplBase Parent;
   1.155  
   1.156 +    public:
   1.157        NodesImpl(const GR& graph, SmartArcSet& arcset)
   1.158          : Parent(graph), _arcset(arcset) {}
   1.159  
   1.160 @@ -1062,7 +1048,6 @@
   1.161    class SmartEdgeSetBase {
   1.162    public:
   1.163  
   1.164 -    typedef GR Graph;
   1.165      typedef typename GR::Node Node;
   1.166      typedef typename GR::NodeIt NodeIt;
   1.167  
   1.168 @@ -1249,10 +1234,10 @@
   1.169  
   1.170      template <typename V>
   1.171      class NodeMap : public GR::template NodeMap<V> {
   1.172 +      typedef typename GR::template NodeMap<V> Parent;
   1.173 +
   1.174      public:
   1.175  
   1.176 -      typedef typename GR::template NodeMap<V> Parent;
   1.177 -
   1.178        explicit NodeMap(const SmartEdgeSetBase<GR>& arcset)
   1.179          : Parent(*arcset._graph) { }
   1.180  
   1.181 @@ -1304,17 +1289,14 @@
   1.182    /// "Graph" concept.
   1.183    template <typename GR>
   1.184    class SmartEdgeSet : public EdgeSetExtender<SmartEdgeSetBase<GR> > {
   1.185 +    typedef EdgeSetExtender<SmartEdgeSetBase<GR> > Parent;
   1.186  
   1.187    public:
   1.188  
   1.189 -    typedef EdgeSetExtender<SmartEdgeSetBase<GR> > Parent;
   1.190 -
   1.191      typedef typename Parent::Node Node;
   1.192      typedef typename Parent::Arc Arc;
   1.193      typedef typename Parent::Edge Edge;
   1.194  
   1.195 -    typedef GR Graph;
   1.196 -
   1.197    protected:
   1.198  
   1.199      typedef typename Parent::NodesImplBase NodesImplBase;
   1.200 @@ -1331,9 +1313,9 @@
   1.201      }
   1.202  
   1.203      class NodesImpl : public NodesImplBase {
   1.204 -    public:
   1.205        typedef NodesImplBase Parent;
   1.206  
   1.207 +    public:
   1.208        NodesImpl(const GR& graph, SmartEdgeSet& arcset)
   1.209          : Parent(graph), _arcset(arcset) {}
   1.210