src/lemon/erasable_graph_extender.h
changeset 1037 3eaff8d04171
parent 980 0f1044b7a3af
child 1039 bd01c5a3f989
equal deleted inserted replaced
1:48ccbb1f1e0c 2:7812a346db45
    41       Parent::erase(edge);
    41       Parent::erase(edge);
    42     }
    42     }
    43 
    43 
    44   };
    44   };
    45 
    45 
       
    46   template <typename _Base> 
       
    47   class ErasableUndirGraphExtender : public _Base {
       
    48   public:
       
    49 
       
    50     typedef ErasableUndirGraphExtender Graph;
       
    51     typedef _Base Parent;
       
    52 
       
    53     typedef typename Parent::Node Node;
       
    54     typedef typename Parent::UndirEdge UndirEdge;
       
    55     typedef typename Parent::Edge Edge;
       
    56 
       
    57     void erase(const Node& node) {
       
    58       Edge edge;
       
    59       Parent::firstOut(edge, node);
       
    60       while (edge != INVALID ) {
       
    61 	erase(edge);
       
    62 	Parent::firstOut(edge, node);
       
    63       } 
       
    64 
       
    65       Parent::getObserverRegistry(Node()).erase(node);
       
    66       Parent::erase(node);
       
    67     }
       
    68     
       
    69     void erase(const UndirEdge& uedge) {
       
    70       Parent::getObserverRegistry(Edge()).erase(Edge(uedge,true));
       
    71       Parent::getObserverRegistry(Edge()).erase(Edge(uedge,false));
       
    72       Parent::getObserverRegistry(UndirEdge()).erase(uedge);
       
    73       Parent::erase(uedge);
       
    74     }
       
    75 
       
    76   };
       
    77 
    46 }
    78 }
    47 
    79 
    48 #endif
    80 #endif