Changeset 798:6d1abeb62dd3 in lemon-0.x for src/hugo/vector_map_factory.h
- Timestamp:
- 09/03/04 17:11:17 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1092
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/vector_map_factory.h
r786 r798 18 18 /** The VectorMapFactory template class is a factory class 19 19 * to create maps for the edge and nodes. This map factory 20 * use the std::vector to implement the container function.20 * uses the std::vector to implement the container function. 21 21 * 22 22 * The template parameter is the MapRegistry that the maps … … 43 43 template <typename V> 44 44 class Map : public MapBase { 45 46 typedef std::vector<V> Container; 47 45 48 public: 49 50 /// The value type of the map. 51 typedef V ValueType; 46 52 47 53 /// The value type of the map. 48 54 typedef V Value; 49 50 typedef std::vector<Value> Container; 55 /// The reference type of the map; 56 typedef typename Container::reference Reference; 57 /// The pointer type of the map; 58 typedef typename Container::pointer Pointer; 59 60 /// The const value type of the map. 61 typedef const Value ConstValue; 62 /// The const reference type of the map; 63 typedef typename Container::const_reference ConstReference; 64 /// The pointer type of the map; 65 typedef typename Container::const_pointer ConstPointer; 51 66 52 67 /** Default constructor for the map. … … 65 80 for (KeyIt it(*getGraph()); it != INVALID; ++it) { 66 81 int id = getGraph()->id(it); 67 if (id >= container.size()) {82 if (id >= (int)container.size()) { 68 83 container.resize(id + 1); 69 84 } … … 78 93 for (KeyIt it(*getGraph()); it != INVALID; ++it) { 79 94 int id = getGraph()->id(it); 80 if (id >= container.size()) {95 if (id >= (int)container.size()) { 81 96 container.resize(id + 1); 82 97 } … … 96 111 for (KeyIt it(*getGraph()); it != INVALID; ++it) { 97 112 int id = getGraph()->id(it); 98 if (id >= container.size()) {113 if (id >= (int)container.size()) { 99 114 container.resize(id + 1); 100 115 } … … 102 117 } 103 118 } 119 return *this; 104 120 } 105 121 … … 113 129 * actual keys of the graph. 114 130 */ 131 <<<<<<< .mine 132 Reference operator[](const Key& key) { 133 ======= 115 134 typename Container::reference operator[](const KeyType& key) { 135 >>>>>>> .r1091 116 136 int id = getGraph()->id(key); 117 137 return container[id]; … … 122 142 * actual keys of the graph. 123 143 */ 144 <<<<<<< .mine 145 ConstReference operator[](const Key& key) const { 146 ======= 124 147 typename Container::const_reference operator[](const KeyType& key) const { 148 >>>>>>> .r1091 125 149 int id = getGraph()->id(key); 126 150 return container[id]; … … 139 163 void add(const KeyType& key) { 140 164 int id = getGraph()->id(key); 141 if (id >= container.size()) {165 if (id >= (int)container.size()) { 142 166 container.resize(id + 1); 143 167 } … … 174 198 175 199 typedef extended_pair<const KeyType&, const KeyType&, 176 Value&, Value&> Reference;200 Map::Reference, Map::Reference> Reference; 177 201 178 202 /** Dereference operator for map. … … 264 288 265 289 typedef extended_pair<const KeyType&, const KeyType&, 266 const Value&, const Value&> Reference;290 Map::ConstReference, Map::ConstReference> Reference; 267 291 268 292 /** Dereference operator for map.
Note: See TracChangeset
for help on using the changeset viewer.