author | alpar |
Tue, 11 Jan 2005 09:15:25 +0000 | |
changeset 1073 | bedab8bd915f |
parent 1022 | 567f392d1d2e |
permissions | -rw-r--r-- |
klao@946 | 1 |
// -*- c++ -*- |
klao@946 | 2 |
|
klao@946 | 3 |
#ifndef LEMON_CLEARABLE_GRAPH_EXTENDER_H |
klao@946 | 4 |
#define LEMON_CLEARABLE_GRAPH_EXTENDER_H |
klao@946 | 5 |
|
klao@946 | 6 |
#include <lemon/invalid.h> |
klao@946 | 7 |
|
klao@946 | 8 |
|
klao@946 | 9 |
namespace lemon { |
klao@946 | 10 |
|
klao@946 | 11 |
template <typename _Base> |
klao@946 | 12 |
class ClearableGraphExtender : public _Base { |
klao@946 | 13 |
public: |
klao@946 | 14 |
|
klao@946 | 15 |
typedef ClearableGraphExtender Graph; |
klao@946 | 16 |
typedef _Base Parent; |
deba@980 | 17 |
typedef typename Parent::Node Node; |
deba@980 | 18 |
typedef typename Parent::Edge Edge; |
klao@946 | 19 |
|
klao@946 | 20 |
void clear() { |
deba@1039 | 21 |
Parent::getNotifier(Node()).clear(); |
deba@1039 | 22 |
Parent::getNotifier(Edge()).clear(); |
klao@946 | 23 |
Parent::clear(); |
klao@946 | 24 |
} |
klao@946 | 25 |
|
klao@946 | 26 |
}; |
klao@946 | 27 |
|
klao@1022 | 28 |
template <typename _Base> |
klao@1022 | 29 |
class ClearableUndirGraphExtender : public _Base { |
klao@1022 | 30 |
public: |
klao@1022 | 31 |
|
klao@1022 | 32 |
typedef ClearableUndirGraphExtender Graph; |
klao@1022 | 33 |
typedef _Base Parent; |
klao@1022 | 34 |
typedef typename Parent::Node Node; |
klao@1022 | 35 |
typedef typename Parent::UndirEdge UndirEdge; |
klao@1022 | 36 |
typedef typename Parent::Edge Edge; |
klao@1022 | 37 |
|
klao@1022 | 38 |
void clear() { |
deba@1039 | 39 |
Parent::getNotifier(Node()).clear(); |
deba@1039 | 40 |
Parent::getNotifier(UndirEdge()).clear(); |
deba@1039 | 41 |
Parent::getNotifier(Edge()).clear(); |
klao@1022 | 42 |
Parent::clear(); |
klao@1022 | 43 |
} |
klao@1022 | 44 |
|
klao@1022 | 45 |
}; |
klao@1022 | 46 |
|
klao@946 | 47 |
} |
klao@946 | 48 |
|
klao@946 | 49 |
#endif |