lemon/bits/erasable_graph_extender.h
changeset 1849 a4d1362397fe
parent 1627 3fd1ba6e9872
child 1909 2d806130e700
equal deleted inserted replaced
1:ffd28b1facb1 2:bca8ae6cc40d
    44     }
    44     }
    45 
    45 
    46   };
    46   };
    47 
    47 
    48   template <typename _Base> 
    48   template <typename _Base> 
       
    49   class ErasableEdgeSetExtender : public _Base {
       
    50   public:
       
    51 
       
    52     typedef ErasableEdgeSetExtender Graph;
       
    53     typedef _Base Parent;
       
    54 
       
    55     typedef typename Parent::Edge Edge;
       
    56 
       
    57     void erase(const Edge& edge) {
       
    58       Parent::getNotifier(Edge()).erase(edge);
       
    59       Parent::erase(edge);
       
    60     }
       
    61 
       
    62   };
       
    63 
       
    64   template <typename _Base> 
    49   class ErasableUndirGraphExtender : public _Base {
    65   class ErasableUndirGraphExtender : public _Base {
    50   public:
    66   public:
    51 
    67 
    52     typedef ErasableUndirGraphExtender Graph;
    68     typedef ErasableUndirGraphExtender Graph;
    53     typedef _Base Parent;
    69     typedef _Base Parent;
    77       Parent::erase(uedge);
    93       Parent::erase(uedge);
    78     }
    94     }
    79 
    95 
    80   };
    96   };
    81 
    97 
       
    98   template <typename _Base> 
       
    99   class ErasableUndirEdgeSetExtender : public _Base {
       
   100   public:
       
   101 
       
   102     typedef ErasableUndirEdgeSetExtender Graph;
       
   103     typedef _Base Parent;
       
   104 
       
   105     typedef typename Parent::Node Node;
       
   106     typedef typename Parent::UndirEdge UndirEdge;
       
   107     typedef typename Parent::Edge Edge;
       
   108 
       
   109     void erase(const UndirEdge& uedge) {
       
   110       std::vector<Edge> edges;
       
   111       edges.push_back(Parent::direct(uedge,true));
       
   112       edges.push_back(Parent::direct(uedge,false));
       
   113       Parent::getNotifier(Edge()).erase(edges);
       
   114       Parent::getNotifier(UndirEdge()).erase(uedge);
       
   115       Parent::erase(uedge);
       
   116     }
       
   117 
       
   118   };
       
   119 
    82 }
   120 }
    83 
   121 
    84 #endif
   122 #endif