Changeset 595:e10b5e9419ef in lemon-0.x for src/work/deba/map_base.h
- Timestamp:
- 05/10/04 15:49:35 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@775
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/deba/map_base.h
r571 r595 2 2 #define MAP_BASE_H 3 3 4 using namespace std; 5 4 6 /** 5 Template base class for implementing mapping on nodes .6 \param The first template parameter is the Graph class. The Graph7 must have an \emp node_maps member with \emp MapRegistry class.8 \param The second template parameter is the type of the class.9 7 Template base class for implementing mapping on nodes and edges. 8 \param The first template parameter is the Graph class. 9 \param The second template parameter is the key type. 10 \param The third template parameter is an iterator on 11 the keys. 10 12 */ 11 13 … … 25 27 typedef G Graph; 26 28 typedef MapRegistry<G, K, KIt> Registry; 27 typedef K Key Type;29 typedef K Key; 28 30 typedef KIt KeyIt; 29 31 … … 34 36 */ 35 37 36 MapBase() : registry(0) {}38 MapBase() : graph(0), registry(0) {} 37 39 38 40 /** … … 41 43 42 44 MapBase(Graph& g, Registry& r) : graph(&g), registry(0) { 43 r egistry->attach(*this);45 r.attach(*this); 44 46 } 45 47 … … 81 83 protected: 82 84 85 Graph* graph; 83 86 Registry* registry; 84 Graph* graph;85 87 86 88 int registry_index; 87 89 88 90 /** 89 Helper function to implement the default constructorin the subclasses.91 Helper function to implement constructors in the subclasses. 90 92 */ 91 93 92 94 virtual void init() { 93 94 95 for (KeyIt it(*graph); graph->valid(it); graph->next(it)) { 95 96 add(it); … … 112 113 */ 113 114 114 virtual void add(const KeyType&) = 0; 115 115 virtual void add(const Key&) = 0; 116 116 /** 117 117 The erase member function should be overloaded in the subclasses. … … 119 119 */ 120 120 121 virtual void erase(const Key Type&) = 0;121 virtual void erase(const Key&) = 0; 122 122 123 123 /**
Note: See TracChangeset
for help on using the changeset viewer.