alpar@1956: /* -*- C++ -*- alpar@1956: * alpar@1956: * This file is a part of LEMON, a generic C++ optimization library alpar@1956: * alpar@1956: * Copyright (C) 2003-2006 alpar@1956: * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport alpar@1956: * (Egervary Research Group on Combinatorial Optimization, EGRES). alpar@1956: * alpar@1956: * Permission to use, modify and distribute this software is granted alpar@1956: * provided that this copyright notice appears in all copies. For alpar@1956: * precise terms see the accompanying LICENSE file. alpar@1956: * alpar@1956: * This software is provided "AS IS" with no warranty of any kind, alpar@1956: * express or implied, and with no claim as to its suitability for any alpar@1956: * purpose. alpar@1956: * alpar@1956: */ 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@1039: Parent::getNotifier(Node()).clear(); deba@1039: Parent::getNotifier(Edge()).clear(); klao@946: Parent::clear(); klao@946: } klao@946: klao@946: }; klao@946: klao@1022: template deba@1842: class ClearableEdgeSetExtender : public _Base { deba@1842: public: deba@1842: deba@1842: typedef ClearableEdgeSetExtender Graph; deba@1842: typedef _Base Parent; deba@1842: typedef typename Parent::Node Node; deba@1842: typedef typename Parent::Edge Edge; deba@1842: deba@1842: void clear() { deba@1842: Parent::getNotifier(Edge()).clear(); deba@1842: Parent::clear(); deba@1842: } deba@1842: deba@1842: }; deba@1842: deba@1842: template klao@1909: class ClearableUGraphExtender : public _Base { klao@1022: public: klao@1022: klao@1909: typedef ClearableUGraphExtender Graph; klao@1022: typedef _Base Parent; klao@1022: typedef typename Parent::Node Node; klao@1909: typedef typename Parent::UEdge UEdge; klao@1022: typedef typename Parent::Edge Edge; klao@1022: klao@1022: void clear() { deba@1039: Parent::getNotifier(Node()).clear(); klao@1909: Parent::getNotifier(UEdge()).clear(); deba@1039: Parent::getNotifier(Edge()).clear(); klao@1022: Parent::clear(); klao@1022: } deba@1842: }; deba@1842: deba@1842: template klao@1909: class ClearableUEdgeSetExtender : public _Base { deba@1842: public: deba@1842: klao@1909: typedef ClearableUEdgeSetExtender Graph; deba@1842: typedef _Base Parent; deba@1842: typedef typename Parent::Node Node; klao@1909: typedef typename Parent::UEdge UEdge; deba@1842: typedef typename Parent::Edge Edge; deba@1842: deba@1842: void clear() { klao@1909: Parent::getNotifier(UEdge()).clear(); deba@1842: Parent::getNotifier(Edge()).clear(); deba@1842: Parent::clear(); deba@1842: } klao@1022: klao@1022: }; klao@1022: deba@1820: deba@1820: template deba@1910: class ClearableBpUGraphExtender : public _Base { deba@1820: public: deba@1820: deba@1820: typedef _Base Parent; deba@1910: typedef ClearableBpUGraphExtender Graph; deba@1820: deba@1820: typedef typename Parent::Node Node; deba@1910: typedef typename Parent::BNode BNode; deba@1910: typedef typename Parent::ANode ANode; deba@1820: typedef typename Parent::Edge Edge; klao@1909: typedef typename Parent::UEdge UEdge; deba@1820: deba@1820: void clear() { deba@1820: Parent::getNotifier(Edge()).clear(); klao@1909: Parent::getNotifier(UEdge()).clear(); deba@1820: Parent::getNotifier(Node()).clear(); deba@1910: Parent::getNotifier(BNode()).clear(); deba@1910: Parent::getNotifier(ANode()).clear(); deba@1820: Parent::clear(); deba@1820: } deba@1820: deba@1820: }; deba@1820: klao@946: } klao@946: klao@946: #endif