lemon/bits/erasable_graph_extender.h
changeset 1842 8abf74160dc4
parent 1627 3fd1ba6e9872
child 1909 2d806130e700
     1.1 --- a/lemon/bits/erasable_graph_extender.h	Wed Nov 30 17:49:01 2005 +0000
     1.2 +++ b/lemon/bits/erasable_graph_extender.h	Thu Dec 01 15:08:46 2005 +0000
     1.3 @@ -46,6 +46,22 @@
     1.4    };
     1.5  
     1.6    template <typename _Base> 
     1.7 +  class ErasableEdgeSetExtender : public _Base {
     1.8 +  public:
     1.9 +
    1.10 +    typedef ErasableEdgeSetExtender Graph;
    1.11 +    typedef _Base Parent;
    1.12 +
    1.13 +    typedef typename Parent::Edge Edge;
    1.14 +
    1.15 +    void erase(const Edge& edge) {
    1.16 +      Parent::getNotifier(Edge()).erase(edge);
    1.17 +      Parent::erase(edge);
    1.18 +    }
    1.19 +
    1.20 +  };
    1.21 +
    1.22 +  template <typename _Base> 
    1.23    class ErasableUndirGraphExtender : public _Base {
    1.24    public:
    1.25  
    1.26 @@ -79,6 +95,28 @@
    1.27  
    1.28    };
    1.29  
    1.30 +  template <typename _Base> 
    1.31 +  class ErasableUndirEdgeSetExtender : public _Base {
    1.32 +  public:
    1.33 +
    1.34 +    typedef ErasableUndirEdgeSetExtender Graph;
    1.35 +    typedef _Base Parent;
    1.36 +
    1.37 +    typedef typename Parent::Node Node;
    1.38 +    typedef typename Parent::UndirEdge UndirEdge;
    1.39 +    typedef typename Parent::Edge Edge;
    1.40 +
    1.41 +    void erase(const UndirEdge& uedge) {
    1.42 +      std::vector<Edge> edges;
    1.43 +      edges.push_back(Parent::direct(uedge,true));
    1.44 +      edges.push_back(Parent::direct(uedge,false));
    1.45 +      Parent::getNotifier(Edge()).erase(edges);
    1.46 +      Parent::getNotifier(UndirEdge()).erase(uedge);
    1.47 +      Parent::erase(uedge);
    1.48 +    }
    1.49 +
    1.50 +  };
    1.51 +
    1.52  }
    1.53  
    1.54  #endif