lemon/bits/alteration_notifier.h
changeset 1846 6b4e38acef1c
parent 1832 d0c28d9c9141
child 1875 98698b69a902
equal deleted inserted replaced
7:e59d56f4c378 8:fae55868d8ac
   396       edge_notifier.clear();
   396       edge_notifier.clear();
   397     }
   397     }
   398     
   398     
   399   };
   399   };
   400 
   400 
       
   401 
       
   402   template <typename _Base> 
       
   403   class AlterableEdgeSetExtender : public _Base {
       
   404   public:
       
   405 
       
   406     typedef AlterableEdgeSetExtender Graph;
       
   407     typedef _Base Parent;
       
   408 
       
   409     typedef typename Parent::Edge Edge;
       
   410 
       
   411     /// The edge observer registry.
       
   412     typedef AlterationNotifier<Edge> EdgeNotifier;
       
   413 
       
   414   protected:
       
   415 
       
   416     mutable EdgeNotifier edge_notifier;
       
   417 
       
   418   public:
       
   419 
       
   420     /// \brief Gives back the edge alteration notifier.
       
   421     ///
       
   422     /// Gives back the edge alteration notifier.
       
   423     EdgeNotifier& getNotifier(Edge) const {
       
   424       return edge_notifier;
       
   425     }
       
   426 
       
   427     ~AlterableEdgeSetExtender() {
       
   428       edge_notifier.clear();
       
   429     }
       
   430     
       
   431   };
       
   432 
   401   /// \brief Class to extend an undirected graph with the functionality of
   433   /// \brief Class to extend an undirected graph with the functionality of
   402   /// alteration observing.
   434   /// alteration observing.
   403   ///
   435   ///
   404   /// \todo Document.
   436   /// \todo Document.
   405   ///
   437   ///
   435 
   467 
   436     ~AlterableUndirGraphExtender() {
   468     ~AlterableUndirGraphExtender() {
   437       undir_edge_notifier.clear();
   469       undir_edge_notifier.clear();
   438     }
   470     }
   439   };
   471   };
       
   472 
       
   473   template <typename _Base> 
       
   474   class AlterableUndirEdgeSetExtender
       
   475     : public AlterableEdgeSetExtender<_Base> {
       
   476   public:
       
   477 
       
   478     typedef AlterableUndirEdgeSetExtender Graph;
       
   479     typedef AlterableEdgeSetExtender<_Base> Parent;
       
   480 
       
   481     typedef typename Parent::UndirEdge UndirEdge;
       
   482 
       
   483     typedef AlterationNotifier<UndirEdge> UndirEdgeNotifier;
       
   484 
       
   485   protected:
       
   486 
       
   487     mutable UndirEdgeNotifier undir_edge_notifier;
       
   488 
       
   489   public:
       
   490 
       
   491     using Parent::getNotifier;
       
   492     UndirEdgeNotifier& getNotifier(UndirEdge) const {
       
   493       return undir_edge_notifier;
       
   494     }
       
   495 
       
   496     ~AlterableUndirEdgeSetExtender() {
       
   497       undir_edge_notifier.clear();
       
   498     }
       
   499   };
       
   500 
   440 
   501 
   441 
   502 
   442   template <typename _Base>
   503   template <typename _Base>
   443   class AlterableUndirBipartiteGraphExtender : public _Base {
   504   class AlterableUndirBipartiteGraphExtender : public _Base {
   444   public:
   505   public: