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

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/deba/node_map_registry.h
r340 r377 4 4 #include <vector> 5 5 6 template <typename G, typename K> 7 class NodeMapRegistry; 8 6 9 #include "node_map_base.h" 7 10 8 template <typename G, typename E>11 template <typename G, typename K> 9 12 class NodeMapRegistry { 10 13 public: 11 14 typedef G Graph; 12 typedef E Node15 typedef K Node; 13 16 14 typedef NodeMapBase<Graph, Node> NodeMapBase; 17 typedef NodeMapBase<Graph, Node> MapBase; 18 friend class MapBase; 15 19 16 20 protected: 17 typedef std::vector<NodeMapBase*> Container; 21 22 Graph* graph; 23 24 typedef std::vector<MapBase*> Container; 18 25 19 26 Container container; 20 21 void add(NodeMapBase& map_base) { 27 28 public: 29 30 NodeMapRegistry(Graph g) : graph(&g) {} 31 32 void add(MapBase& map_base) { 22 33 if (map_base.graph) { 23 34 map_base.graph>node_maps.erase(map_base); 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 void erase(NodeMapBase& map_base) { 31 if (map_base.graph != this) return; 41 void erase(MapBase& map_base) { 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(Node& node) { … … 50 61 } 51 62 52 friend class NodeMapBase;53 63 }; 54 64
Note: See TracChangeset
for help on using the changeset viewer.