Changeset 377:33fe0ee01dc5 in lemon0.x for src/work/deba/edge_map_registry.h
 Timestamp:
 04/22/04 18:36:57 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@507
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/deba/edge_map_registry.h
r340 r377 4 4 #include <vector> 5 5 6 template <typename G, typename K> 7 class EdgeMapRegistry; 8 6 9 #include "edge_map_base.h" 7 10 8 template <typename G, typename E>11 template <typename G, typename K> 9 12 class EdgeMapRegistry { 10 13 public: 11 14 typedef G Graph; 12 typedef E Edge15 typedef K Edge; 13 16 14 17 typedef EdgeMapBase<Graph, Edge> MapBase; 18 friend class MapBase; 15 19 16 20 protected: 17 typedef std::vector<EdgeMapBase*> Container; 21 22 Graph* graph; 23 24 typedef std::vector<MapBase*> Container; 18 25 19 26 Container container; 20 27 28 public: 29 30 EdgeMapRegistry(Graph g) : graph(&g) {} 31 21 32 void add(MapBase& map_base) { 22 33 if (map_base.graph) { … … 24 35 } 25 36 container.push_back(&map_base); 26 map_base.graph = this;37 map_base.graph = graph; 27 38 map_base.graph_index = container.size()1; 28 39 } 29 40 30 41 void erase(MapBase& map_base) { 31 if (map_base.graph != this) return;32 42 container.back()>graph_index = map_base.graph_index; 33 43 container[map_base.graph_index] = container.back(); … … 35 45 map_base.graph = 0; 36 46 } 47 37 48 38 49 void add(Edge& edge) { … … 50 61 } 51 62 52 friend class MapBase;53 63 }; 54 64
Note: See TracChangeset
for help on using the changeset viewer.