Changeset 937:d4e911acef3d in lemon-0.x for src/lemon/vector_map.h
- Timestamp:
- 10/04/04 19:13:21 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1264
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/vector_map.h
r921 r937 32 32 /// @{ 33 33 34 /** The ArrayMap template class is graph map structure what34 /** The VectorMap template class is graph map structure what 35 35 * automatically updates the map when a key is added to or erased from 36 36 * the map. This map factory uses the allocators to implement … … 38 38 * uses the std::vector to implement the container function. 39 39 * 40 * The template parameter is the MapRegistry that the maps41 * will belong to and the ValueType.40 * \param MapRegistry The MapRegistry that the maps will belong to. 41 * \param Value The value type of the map. 42 42 * 43 * \todo It should use a faster initialization using the maxNodeId() or 44 * maxEdgeId() function of the graph instead of iterating through each 45 * edge/node. 43 * \author Balazs Dezso 46 44 */ 47 45 … … 85 83 typedef typename Container::const_pointer ConstPointerType; 86 84 87 /** Graph and Registry initialized map constructor. 85 /// Constructor to attach the new map into a registry. 86 87 /** Constructor to attach the new map into a registry. 88 * It adds all the nodes or edges of the graph to the map. 88 89 */ 89 90 VectorMap(const Graph& g, MapRegistry& r) 90 91 : MapBase(g, r), container(KeyInfo<Graph, KeyIt>::maxId(g)+1) {} 91 92 92 /** Constructor to use default value to initialize the map. 93 /// Constructor uses given value to initialize the map. 94 95 /** Constructor uses given value to initialize the map. 96 * It adds all the nodes or edges of the graph to the map. 93 97 */ 94 98 VectorMap(const Graph& g, MapRegistry& r, const Value& v) 95 99 : MapBase(g, r), container(KeyInfo<Graph, KeyIt>::maxId(g)+1, v) {} 96 100 101 /// Assign operator to copy a map of an other map type. 102 97 103 /** Assign operator to copy a map of an other map type. 104 * This map's value type must be assignable by the other 105 * map type's value type. 98 106 */ 99 107 template <typename TT> … … 106 114 } 107 115 116 /// Assign operator to copy a map of an other map type. 117 108 118 /** Assign operator to copy a map of an other map type. 119 * This map's value type must be assignable by the other 120 * map type's value type. 109 121 */ 110 122 template <typename TT> … … 120 132 return *this; 121 133 } 134 135 /// The subcript operator. 136 122 137 /** 123 138 * The subscript operator. The map can be subscripted by the … … 129 144 } 130 145 146 /// The const subcript operator. 147 131 148 /** 132 149 * The const subscript operator. The map can be subscripted by the … … 138 155 } 139 156 157 ///Setter function of the map. 158 140 159 /** Setter function of the map. Equivalent with map[key] = val. 141 160 * This is a compatibility feature with the not dereferable maps. … … 145 164 container[id] = val; 146 165 } 147 148 /** Add a new key to the map. It called by the map registry. 166 /// Adds a new key to the map. 167 168 /** Adds a new key to the map. It called by the map registry 169 * and it overrides the \ref MapRegistry::MapBase MapBase's 170 * add() member function. 149 171 */ 150 172 void add(const KeyType& key) { … … 154 176 } 155 177 } 156 157 /** Erase a key from the map. It called by the map registry. 178 179 /// Erases a key from the map. 180 181 /** Erase a key from the map. It called by the map registry 182 * and it overrides the \ref MapRegistry::MapBase MapBase's 183 * erase() member function. 158 184 */ 159 185 void erase(const KeyType& key) {} 160 186 161 /** Clear the data structure. 162 */ 187 /// Makes empty the map. 188 189 /** Makes empty the map. It called by the map registry 190 * and it overrides the \ref MapRegistry::MapBase MapBase's 191 * clear() member function. 192 */ 193 163 194 void clear() { 164 195 container.clear();
Note: See TracChangeset
for help on using the changeset viewer.