klao@946: // -*- c++ -*- klao@946: klao@946: #ifndef LEMON_CLEARABLE_GRAPH_EXTENDER_H klao@946: #define LEMON_CLEARABLE_GRAPH_EXTENDER_H klao@946: klao@946: #include klao@946: klao@946: klao@946: namespace lemon { klao@946: klao@946: template klao@946: class ClearableGraphExtender : public _Base { klao@946: public: klao@946: klao@946: typedef ClearableGraphExtender Graph; klao@946: typedef _Base Parent; deba@980: typedef typename Parent::Node Node; deba@980: typedef typename Parent::Edge Edge; klao@946: klao@946: void clear() { deba@980: Parent::getObserverRegistry(Node()).clear(); deba@980: Parent::getObserverRegistry(Edge()).clear(); klao@946: Parent::clear(); klao@946: } klao@946: klao@946: }; klao@946: klao@1022: template klao@1022: class ClearableUndirGraphExtender : public _Base { klao@1022: public: klao@1022: klao@1022: typedef ClearableUndirGraphExtender Graph; klao@1022: typedef _Base Parent; klao@1022: typedef typename Parent::Node Node; klao@1022: typedef typename Parent::UndirEdge UndirEdge; klao@1022: typedef typename Parent::Edge Edge; klao@1022: klao@1022: void clear() { klao@1022: Parent::getObserverRegistry(Node()).clear(); klao@1022: Parent::getObserverRegistry(UndirEdge()).clear(); klao@1022: Parent::getObserverRegistry(Edge()).clear(); klao@1022: Parent::clear(); klao@1022: } klao@1022: klao@1022: }; klao@1022: klao@946: } klao@946: klao@946: #endif