Changeset 336:8ff3b3e05478 in lemon-0.x
- Timestamp:
- 04/16/04 14:13:07 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@455
- Location:
- src/work/deba
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/deba/edge_map_base.h
r262 r336 6 6 public: 7 7 typedef G Graph; 8 8 9 typedef K KeyType; 9 10 11 EdgeMapBase() : graph(0) {} 12 EdgeMapBase(Graph& g) : graph(&g) { 13 graph->edge_maps.add(*this); 14 } 10 15 11 MapBase() : graph(0) {} 12 MapBase(Graph& g) : graph(&g) {graph.edge_maps.add(*this);} 13 14 virtual ~MapBase() {graph.edge_maps.erase(*this);} 15 16 virtual ~EdgeMapBase() { 17 if (graph) { 18 graph.edge_maps.erase(*this); 19 } 20 } 21 16 22 protected: 17 23 … … 20 26 int graph_index; 21 27 28 void init() { 29 for (Graph::EdgeIt it(g); g.valid(it); g.next(it)) { 30 add(it); 31 } 32 } 33 34 void destroy() { 35 for (Graph::EdgeIt it(g); g.valid(it); g.next(it)) { 36 erase(it); 37 } 38 } 22 39 23 40 virtual void add(const KeyType&) = 0; -
src/work/deba/node_map_base.h
r262 r336 9 9 typedef K KeyType; 10 10 11 NodeMapBase() : graph(0) {} 12 NodeMapBase(Graph& g) : graph(&g) { 13 graph->node_maps.add(*this); 14 } 11 15 12 MapBase() : graph(0) {} 13 MapBase(Graph& g) : graph(&g) {graph.node_maps.add(*this);} 14 15 virtual ~MapBase() {graph.node_maps.erase(*this);} 16 16 virtual ~NodeMapBase() { 17 if (graph) { 18 graph.node_maps.erase(*this); 19 } 20 } 21 17 22 protected: 18 23 … … 21 26 int graph_index; 22 27 28 void init() { 29 for (Graph::NodeIt it(g); g.valid(it); g.next(it)) { 30 add(it); 31 } 32 } 33 34 void destroy() { 35 for (Graph::NodeIt it(g); g.valid(it); g.next(it)) { 36 erase(it); 37 } 38 } 23 39 24 40 virtual void add(const KeyType&) = 0;
Note: See TracChangeset
for help on using the changeset viewer.