COIN-OR::LEMON - Graph Library

source: lemon-0.x/lemon/bits/clearable_graph_extender.h @ 1909:2d806130e700

Last change on this file since 1909:2d806130e700 was 1909:2d806130e700, checked in by Mihaly Barasz, 14 years ago

Undir -> U transition

File size: 2.4 KB
Line 
1// -*- c++ -*-
2
3#ifndef LEMON_CLEARABLE_GRAPH_EXTENDER_H
4#define LEMON_CLEARABLE_GRAPH_EXTENDER_H
5
6#include <lemon/invalid.h>
7
8
9namespace lemon {
10
11  template <typename _Base>
12  class ClearableGraphExtender : public _Base {
13  public:
14
15    typedef ClearableGraphExtender Graph;
16    typedef _Base Parent;
17    typedef typename Parent::Node Node;
18    typedef typename Parent::Edge Edge;
19
20    void clear() {
21      Parent::getNotifier(Node()).clear();
22      Parent::getNotifier(Edge()).clear();
23      Parent::clear();
24    }
25
26  };
27
28  template <typename _Base>
29  class ClearableEdgeSetExtender : public _Base {
30  public:
31
32    typedef ClearableEdgeSetExtender Graph;
33    typedef _Base Parent;
34    typedef typename Parent::Node Node;
35    typedef typename Parent::Edge Edge;
36
37    void clear() {
38      Parent::getNotifier(Edge()).clear();
39      Parent::clear();
40    }
41
42  };
43
44  template <typename _Base>
45  class ClearableUGraphExtender : public _Base {
46  public:
47
48    typedef ClearableUGraphExtender Graph;
49    typedef _Base Parent;
50    typedef typename Parent::Node Node;
51    typedef typename Parent::UEdge UEdge;
52    typedef typename Parent::Edge Edge;
53
54    void clear() {
55      Parent::getNotifier(Node()).clear();
56      Parent::getNotifier(UEdge()).clear();
57      Parent::getNotifier(Edge()).clear();
58      Parent::clear();
59    }
60  };
61
62  template <typename _Base>
63  class ClearableUEdgeSetExtender : public _Base {
64  public:
65
66    typedef ClearableUEdgeSetExtender Graph;
67    typedef _Base Parent;
68    typedef typename Parent::Node Node;
69    typedef typename Parent::UEdge UEdge;
70    typedef typename Parent::Edge Edge;
71
72    void clear() {
73      Parent::getNotifier(UEdge()).clear();
74      Parent::getNotifier(Edge()).clear();
75      Parent::clear();
76    }
77
78  };
79
80
81  template <typename _Base>
82  class ClearableUBipartiteGraphExtender : public _Base {
83  public:
84
85    typedef _Base Parent;
86    typedef ClearableUBipartiteGraphExtender Graph;
87
88    typedef typename Parent::Node Node;
89    typedef typename Parent::LowerNode LowerNode;
90    typedef typename Parent::UpperNode UpperNode;
91    typedef typename Parent::Edge Edge;
92    typedef typename Parent::UEdge UEdge;
93
94    void clear() {
95      Parent::getNotifier(Edge()).clear();
96      Parent::getNotifier(UEdge()).clear();
97      Parent::getNotifier(Node()).clear();
98      Parent::getNotifier(LowerNode()).clear();
99      Parent::getNotifier(UpperNode()).clear();
100      Parent::clear();
101    }
102
103  };
104
105}
106
107#endif
Note: See TracBrowser for help on using the repository browser.