Changeset 844:9bf990cb066d in lemon-0.x for src/hugo/sym_map.h
- Timestamp:
- 09/13/04 22:05:13 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1143
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/sym_map.h
r822 r844 18 18 */ 19 19 20 20 21 template <typename Graph, typename Edge, typename EdgeIt> 21 22 class SymEdgeIt : public EdgeIt { … … 31 32 SymEdgeIt(const Graph& graph) 32 33 : EdgeIt(graph) { 33 while ( ( n & 1) &&n != -1) {34 while ( (EdgeIt::n & 1) && EdgeIt::n != -1) { 34 35 EdgeIt::operator++(); 35 36 } … … 45 46 SymEdgeIt(const Graph& graph, const Edge& edge) 46 47 : EdgeIt(graph, edge) { 47 while ( ( n & 1) &&n != -1) {48 while ( (EdgeIt::n & 1) && EdgeIt::n != -1) { 48 49 EdgeIt::operator++(); 49 50 } … … 54 55 SymEdgeIt& operator++() { 55 56 EdgeIt::operator++(); 56 while ( ( n & 1) &&n != -1) {57 while ( (EdgeIt::n & 1) && EdgeIt::n != -1) { 57 58 EdgeIt::operator++(); 58 59 } … … 122 123 } 123 124 124 /**125 * The subscript operator. The map can be subscripted by the126 * actual keys of the graph.127 */128 typename MapImpl::ReferenceType operator[](const KeyType& key) {129 int id = MapImpl::getGraph()->id(key);130 return MapImpl::operator[](id >> 1);131 }132 133 /**134 * The const subscript operator. The map can be subscripted by the135 * actual keys of the graph.136 */137 typename MapImpl::ConstReferenceType operator[](const KeyType& key) const {138 int id = MapImpl::getGraph()->id(key);139 return MapImpl::operator[](id >> 1);140 }141 142 /** Setter function of the map. Equivalent with map[key] = val.143 * This is a compatibility feature with the not dereferable maps.144 */145 void set(const KeyType& key, const typename MapImpl::ValueType& val) {146 int id = MapImpl::getGraph()->id(key);147 MapImpl::operator[](id >> 1) = val;148 }149 150 125 /** Add a new key to the map. It called by the map registry. 151 126 */
Note: See TracChangeset
for help on using the changeset viewer.