Changeset 786:d7b3b13b9df6 in lemon-0.x for src/hugo/vector_map_factory.h
- Timestamp:
- 09/02/04 17:21:13 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1079
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/vector_map_factory.h
r785 r786 31 31 typedef typename MapRegistry::Graph Graph; 32 32 /// The key type of the maps. 33 typedef typename MapRegistry::Key Key;33 typedef typename MapRegistry::KeyType KeyType; 34 34 /// The iterator to iterate on the keys. 35 35 typedef typename MapRegistry::KeyIt KeyIt; … … 113 113 * actual keys of the graph. 114 114 */ 115 typename Container::reference operator[](const Key & key) {115 typename Container::reference operator[](const KeyType& key) { 116 116 int id = getGraph()->id(key); 117 117 return container[id]; … … 122 122 * actual keys of the graph. 123 123 */ 124 typename Container::const_reference operator[](const Key & key) const {124 typename Container::const_reference operator[](const KeyType& key) const { 125 125 int id = getGraph()->id(key); 126 126 return container[id]; … … 130 130 * This is a compatibility feature with the not dereferable maps. 131 131 */ 132 void set(const Key & key, const Value& val) {132 void set(const KeyType& key, const Value& val) { 133 133 int id = getGraph()->id(key); 134 134 container[id] = val; … … 137 137 /** Add a new key to the map. It called by the map registry. 138 138 */ 139 void add(const Key & key) {139 void add(const KeyType& key) { 140 140 int id = getGraph()->id(key); 141 141 if (id >= container.size()) { … … 146 146 /** Erase a key from the map. It called by the map registry. 147 147 */ 148 void erase(const Key & key) {}148 void erase(const KeyType& key) {} 149 149 150 150 /** Clear the data structure. … … 173 173 iterator() {} 174 174 175 typedef extended_pair<const Key &, const Key&,175 typedef extended_pair<const KeyType&, const KeyType&, 176 176 Value&, Value&> Reference; 177 177 … … 186 186 private: 187 187 Reference data; 188 Pointer(const Key & key, Value& val) : data(key, val) {}188 Pointer(const KeyType& key, Value& val) : data(key, val) {} 189 189 public: 190 190 Reference* operator->() {return &data;} … … 263 263 const_iterator(iterator p_it) : map(p_it.map), it(p_it.it) {} 264 264 265 typedef extended_pair<const Key &, const Key&,265 typedef extended_pair<const KeyType&, const KeyType&, 266 266 const Value&, const Value&> Reference; 267 267 … … 277 277 private: 278 278 Reference data; 279 Pointer(const Key & key, const Value& val) : data(key, val) {}279 Pointer(const KeyType& key, const Value& val) : data(key, val) {} 280 280 public: 281 281 Reference* operator->() {return &data;}
Note: See TracChangeset
for help on using the changeset viewer.