lemon/edge_set.h
changeset 1953 d4f411003580
parent 1875 98698b69a902
child 1956 a055123339d5
equal deleted inserted replaced
2:28cc85bb2527 3:1f97c929b494
   292   };
   292   };
   293 
   293 
   294   /// \ingroup semi_adaptors
   294   /// \ingroup semi_adaptors
   295   ///
   295   ///
   296   /// \brief Graph using a node set of another graph and an
   296   /// \brief Graph using a node set of another graph and an
   297   /// own undir edge set.
   297   /// own uedge set.
   298   ///
   298   ///
   299   /// This structure can be used to establish another graph over a node set
   299   /// This structure can be used to establish another graph over a node set
   300   /// of an existing one. The node iterator will go through the nodes of the
   300   /// of an existing one. The node iterator will go through the nodes of the
   301   /// original graph.
   301   /// original graph.
   302   ///
   302   ///
   305   /// "StaticGraph" concept.
   305   /// "StaticGraph" concept.
   306   ///
   306   ///
   307   /// In the edge extension and removing it conforms to the 
   307   /// In the edge extension and removing it conforms to the 
   308   /// \ref concept::ExtendableGraph "ExtendableGraph" concept.
   308   /// \ref concept::ExtendableGraph "ExtendableGraph" concept.
   309   template <typename _Graph>
   309   template <typename _Graph>
   310   class ListUndirEdgeSet :
   310   class ListUEdgeSet :
   311     public ErasableUndirEdgeSetExtender<
   311     public ErasableUEdgeSetExtender<
   312     ClearableUndirEdgeSetExtender<
   312     ClearableUEdgeSetExtender<
   313     ExtendableUndirEdgeSetExtender<
   313     ExtendableUEdgeSetExtender<
   314     MappableUndirEdgeSetExtender<
   314     MappableUEdgeSetExtender<
   315     IterableUndirGraphExtender<
   315     IterableUGraphExtender<
   316     AlterableUndirEdgeSetExtender<
   316     AlterableUEdgeSetExtender<
   317     UndirGraphExtender<
   317     UGraphExtender<
   318     ListEdgeSetBase<_Graph> > > > > > > > {
   318     ListEdgeSetBase<_Graph> > > > > > > > {
   319 
   319 
   320   public:
   320   public:
   321 
   321 
   322     typedef ErasableUndirEdgeSetExtender<
   322     typedef ErasableUEdgeSetExtender<
   323       ClearableUndirEdgeSetExtender<
   323       ClearableUEdgeSetExtender<
   324       ExtendableUndirEdgeSetExtender<
   324       ExtendableUEdgeSetExtender<
   325       MappableUndirEdgeSetExtender<
   325       MappableUEdgeSetExtender<
   326       IterableUndirGraphExtender<
   326       IterableUGraphExtender<
   327       AlterableUndirEdgeSetExtender<
   327       AlterableUEdgeSetExtender<
   328       UndirGraphExtender<
   328       UGraphExtender<
   329       ListEdgeSetBase<_Graph> > > > > > > > Parent;
   329       ListEdgeSetBase<_Graph> > > > > > > > Parent;
   330     
   330     
   331     typedef typename Parent::Node Node;
   331     typedef typename Parent::Node Node;
   332     typedef typename Parent::Edge Edge;
   332     typedef typename Parent::Edge Edge;
   333     
   333     
   352 
   352 
   353     class NodesImpl : public NodesImplBase {
   353     class NodesImpl : public NodesImplBase {
   354     public:
   354     public:
   355       typedef NodesImplBase Parent;
   355       typedef NodesImplBase Parent;
   356       
   356       
   357       NodesImpl(const Graph& graph, ListUndirEdgeSet& edgeset) 
   357       NodesImpl(const Graph& graph, ListUEdgeSet& edgeset) 
   358 	: Parent(graph), _edgeset(edgeset) {}
   358 	: Parent(graph), _edgeset(edgeset) {}
   359       
   359       
   360     protected:
   360     protected:
   361 
   361 
   362       virtual void erase(const Node& node) {
   362       virtual void erase(const Node& node) {
   373 	_edgeset.clearNodes();
   373 	_edgeset.clearNodes();
   374 	Parent::clear();
   374 	Parent::clear();
   375       }
   375       }
   376 
   376 
   377     private:
   377     private:
   378       ListUndirEdgeSet& _edgeset;
   378       ListUEdgeSet& _edgeset;
   379     };
   379     };
   380 
   380 
   381     NodesImpl nodes;
   381     NodesImpl nodes;
   382     
   382     
   383   public:
   383   public:
   384 
   384 
   385     /// \brief Constructor of the adaptor.
   385     /// \brief Constructor of the adaptor.
   386     /// 
   386     /// 
   387     /// Constructor of the adaptor.
   387     /// Constructor of the adaptor.
   388     ListUndirEdgeSet(const Graph& graph) : nodes(graph, *this) {
   388     ListUEdgeSet(const Graph& graph) : nodes(graph, *this) {
   389       Parent::initalize(graph, nodes);
   389       Parent::initalize(graph, nodes);
   390     }
   390     }
   391     
   391     
   392   };
   392   };
   393 
   393