lemon/bits/graph_adaptor_extender.h
changeset 1130 0759d974de81
parent 1092 dceba191c00d
child 1131 4add05447ca0
equal deleted inserted replaced
8:6c08cb3220c9 9:544d34b64245
    83         return *this;
    83         return *this;
    84       }
    84       }
    85 
    85 
    86     };
    86     };
    87 
    87 
       
    88     LemonRangeWrapper1<NodeIt, Adaptor> nodes() {
       
    89       return LemonRangeWrapper1<NodeIt, Adaptor>(*this);
       
    90     }
    88 
    91 
    89     class ArcIt : public Arc {
    92     class ArcIt : public Arc {
    90       const Adaptor* _adaptor;
    93       const Adaptor* _adaptor;
    91     public:
    94     public:
    92 
    95 
   105         _adaptor->next(*this);
   108         _adaptor->next(*this);
   106         return *this;
   109         return *this;
   107       }
   110       }
   108 
   111 
   109     };
   112     };
       
   113 
       
   114     LemonRangeWrapper1<ArcIt, Adaptor> arcs() {
       
   115       return LemonRangeWrapper1<ArcIt, Adaptor>(*this);
       
   116     }
   110 
   117 
   111 
   118 
   112     class OutArcIt : public Arc {
   119     class OutArcIt : public Arc {
   113       const Adaptor* _adaptor;
   120       const Adaptor* _adaptor;
   114     public:
   121     public:
   130         return *this;
   137         return *this;
   131       }
   138       }
   132 
   139 
   133     };
   140     };
   134 
   141 
       
   142     LemonRangeWrapper2<OutArcIt, Adaptor, Node> outArcs(const Node& u) const {
       
   143       return LemonRangeWrapper2<OutArcIt, Adaptor, Node>(*this, u);
       
   144     }
       
   145 
   135 
   146 
   136     class InArcIt : public Arc {
   147     class InArcIt : public Arc {
   137       const Adaptor* _adaptor;
   148       const Adaptor* _adaptor;
   138     public:
   149     public:
   139 
   150 
   153         _adaptor->nextIn(*this);
   164         _adaptor->nextIn(*this);
   154         return *this;
   165         return *this;
   155       }
   166       }
   156 
   167 
   157     };
   168     };
       
   169 
       
   170     LemonRangeWrapper2<InArcIt, Adaptor, Node> inArcs(const Node& u) const {
       
   171       return LemonRangeWrapper2<InArcIt, Adaptor, Node>(*this, u);
       
   172     }
   158 
   173 
   159     Node baseNode(const OutArcIt &e) const {
   174     Node baseNode(const OutArcIt &e) const {
   160       return Parent::source(e);
   175       return Parent::source(e);
   161     }
   176     }
   162     Node runningNode(const OutArcIt &e) const {
   177     Node runningNode(const OutArcIt &e) const {
   252         return *this;
   267         return *this;
   253       }
   268       }
   254 
   269 
   255     };
   270     };
   256 
   271 
       
   272     LemonRangeWrapper1<NodeIt, Adaptor> nodes() {
       
   273       return LemonRangeWrapper1<NodeIt, Adaptor>(*this);
       
   274     }
       
   275 
   257 
   276 
   258     class ArcIt : public Arc {
   277     class ArcIt : public Arc {
   259       const Adaptor* _adaptor;
   278       const Adaptor* _adaptor;
   260     public:
   279     public:
   261 
   280 
   274         _adaptor->next(*this);
   293         _adaptor->next(*this);
   275         return *this;
   294         return *this;
   276       }
   295       }
   277 
   296 
   278     };
   297     };
       
   298 
       
   299     LemonRangeWrapper1<ArcIt, Adaptor> arcs() {
       
   300       return LemonRangeWrapper1<ArcIt, Adaptor>(*this);
       
   301     }
   279 
   302 
   280 
   303 
   281     class OutArcIt : public Arc {
   304     class OutArcIt : public Arc {
   282       const Adaptor* _adaptor;
   305       const Adaptor* _adaptor;
   283     public:
   306     public:
   299         return *this;
   322         return *this;
   300       }
   323       }
   301 
   324 
   302     };
   325     };
   303 
   326 
       
   327     LemonRangeWrapper2<OutArcIt, Adaptor, Node> outArcs(const Node& u) const {
       
   328       return LemonRangeWrapper2<OutArcIt, Adaptor, Node>(*this, u);
       
   329     }
       
   330 
   304 
   331 
   305     class InArcIt : public Arc {
   332     class InArcIt : public Arc {
   306       const Adaptor* _adaptor;
   333       const Adaptor* _adaptor;
   307     public:
   334     public:
   308 
   335 
   323         return *this;
   350         return *this;
   324       }
   351       }
   325 
   352 
   326     };
   353     };
   327 
   354 
       
   355     LemonRangeWrapper2<InArcIt, Adaptor, Node> inArcs(const Node& u) const {
       
   356       return LemonRangeWrapper2<InArcIt, Adaptor, Node>(*this, u);
       
   357     }
       
   358 
   328     class EdgeIt : public Parent::Edge {
   359     class EdgeIt : public Parent::Edge {
   329       const Adaptor* _adaptor;
   360       const Adaptor* _adaptor;
   330     public:
   361     public:
   331 
   362 
   332       EdgeIt() { }
   363       EdgeIt() { }
   344         _adaptor->next(*this);
   375         _adaptor->next(*this);
   345         return *this;
   376         return *this;
   346       }
   377       }
   347 
   378 
   348     };
   379     };
       
   380 
       
   381     LemonRangeWrapper1<EdgeIt, Adaptor> edges() {
       
   382       return LemonRangeWrapper1<EdgeIt, Adaptor>(*this);
       
   383     }
       
   384 
   349 
   385 
   350     class IncEdgeIt : public Edge {
   386     class IncEdgeIt : public Edge {
   351       friend class GraphAdaptorExtender;
   387       friend class GraphAdaptorExtender;
   352       const Adaptor* _adaptor;
   388       const Adaptor* _adaptor;
   353       bool direction;
   389       bool direction;
   370         _adaptor->nextInc(*this, direction);
   406         _adaptor->nextInc(*this, direction);
   371         return *this;
   407         return *this;
   372       }
   408       }
   373     };
   409     };
   374 
   410 
       
   411     LemonRangeWrapper2<IncEdgeIt, Adaptor, Node> incEdges(const Node& u) const {
       
   412       return LemonRangeWrapper2<IncEdgeIt, Adaptor, Node>(*this, u);
       
   413     }
       
   414 
       
   415 
   375     Node baseNode(const OutArcIt &a) const {
   416     Node baseNode(const OutArcIt &a) const {
   376       return Parent::source(a);
   417       return Parent::source(a);
   377     }
   418     }
   378     Node runningNode(const OutArcIt &a) const {
   419     Node runningNode(const OutArcIt &a) const {
   379       return Parent::target(a);
   420       return Parent::target(a);