Changeset 987:87f7c54892df in lemon-0.x for src/lemon/vector_map.h
- Timestamp:
- 11/13/04 18:07:10 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/vector_map.h
r980 r987 54 54 typedef _Graph Graph; 55 55 /// The key type of the map. 56 typedef _Item Key Type;56 typedef _Item Key; 57 57 /// The id map type of the map. 58 58 typedef AlterationObserverRegistry<_Item> Registry; … … 72 72 public: 73 73 74 /// The value type of the map.75 typedef Value ValueType;76 74 /// The reference type of the map; 77 typedef typename Container::reference Reference Type;75 typedef typename Container::reference Reference; 78 76 /// The pointer type of the map; 79 typedef typename Container::pointer Pointer Type;77 typedef typename Container::pointer Pointer; 80 78 81 79 /// The const value type of the map. 82 typedef const Value ConstValue Type;80 typedef const Value ConstValue; 83 81 /// The const reference type of the map; 84 typedef typename Container::const_reference ConstReference Type;82 typedef typename Container::const_reference ConstReference; 85 83 /// The pointer type of the map; 86 typedef typename Container::const_pointer ConstPointer Type;84 typedef typename Container::const_pointer ConstPointer; 87 85 88 86 /// Constructor to attach the new map into the registry. … … 151 149 /// actual items of the graph. 152 150 153 Reference Type operator[](const KeyType& key) {151 Reference operator[](const Key& key) { 154 152 return container[graph->id(key)]; 155 153 } … … 160 158 /// actual items of the graph. 161 159 162 ConstReference Type operator[](const KeyType& key) const {160 ConstReference operator[](const Key& key) const { 163 161 return container[graph->id(key)]; 164 162 } … … 170 168 /// 171 169 172 void set(const Key Type& key, const ValueType& value) {170 void set(const Key& key, const Value& value) { 173 171 (*this)[key] = value; 174 172 } … … 179 177 /// and it overrides the add() member function of the observer base. 180 178 181 void add(const Key Type& key) {179 void add(const Key& key) { 182 180 int id = graph->id(key); 183 181 if (id >= (int)container.size()) { … … 190 188 /// Erase a key from the map. It called by the observer registry 191 189 /// and it overrides the erase() member function of the observer base. 192 void erase(const Key Type&) {}190 void erase(const Key&) {} 193 191 194 192 /// Buildes the map.
Note: See TracChangeset
for help on using the changeset viewer.