lemon/bits/clearable_graph_extender.h
changeset 1435 8e85e6bbefdf
parent 1307 d4acebef7276
child 1820 22099ef840d7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lemon/bits/clearable_graph_extender.h	Mon May 23 04:48:14 2005 +0000
     1.3 @@ -0,0 +1,49 @@
     1.4 +// -*- c++ -*-
     1.5 +
     1.6 +#ifndef LEMON_CLEARABLE_GRAPH_EXTENDER_H
     1.7 +#define LEMON_CLEARABLE_GRAPH_EXTENDER_H
     1.8 +
     1.9 +#include <lemon/invalid.h>
    1.10 +
    1.11 +
    1.12 +namespace lemon {
    1.13 +
    1.14 +  template <typename _Base> 
    1.15 +  class ClearableGraphExtender : public _Base {
    1.16 +  public:
    1.17 +
    1.18 +    typedef ClearableGraphExtender Graph;
    1.19 +    typedef _Base Parent;
    1.20 +    typedef typename Parent::Node Node;
    1.21 +    typedef typename Parent::Edge Edge;
    1.22 +
    1.23 +    void clear() {
    1.24 +      Parent::getNotifier(Node()).clear();
    1.25 +      Parent::getNotifier(Edge()).clear();
    1.26 +      Parent::clear();
    1.27 +    }
    1.28 +
    1.29 +  };
    1.30 +
    1.31 +  template <typename _Base> 
    1.32 +  class ClearableUndirGraphExtender : public _Base {
    1.33 +  public:
    1.34 +
    1.35 +    typedef ClearableUndirGraphExtender Graph;
    1.36 +    typedef _Base Parent;
    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 clear() {
    1.42 +      Parent::getNotifier(Node()).clear();
    1.43 +      Parent::getNotifier(UndirEdge()).clear();
    1.44 +      Parent::getNotifier(Edge()).clear();
    1.45 +      Parent::clear();
    1.46 +    }
    1.47 +
    1.48 +  };
    1.49 +
    1.50 +}
    1.51 +
    1.52 +#endif