Changeset 798:6d1abeb62dd3 in lemon-0.x for src/hugo
- Timestamp:
- 09/03/04 17:11:17 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1092
- Location:
- src/hugo
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/full_graph.h
r782 r798 14 14 15 15 #include <hugo/map_registry.h> 16 #include <hugo/ array_map_factory.h>16 #include <hugo/default_map_factory.h> 17 17 18 18 namespace hugo { … … 49 49 50 50 CREATE_MAP_REGISTRIES; 51 CREATE_MAPS( ArrayMapFactory);51 CREATE_MAPS(DefaultMapFactory); 52 52 53 53 public: -
src/hugo/list_graph.h
r782 r798 14 14 15 15 #include <hugo/map_registry.h> 16 #include <hugo/ array_map_factory.h>16 #include <hugo/default_map_factory.h> 17 17 18 18 #include <hugo/sym_map_factory.h> … … 81 81 82 82 CREATE_MAP_REGISTRIES; 83 CREATE_MAPS( ArrayMapFactory);83 CREATE_MAPS(DefaultMapFactory); 84 84 85 85 public: … … 426 426 427 427 CREATE_SYM_EDGE_MAP_REGISTRY; 428 CREATE_SYM_EDGE_MAP_FACTORY( ArrayMapFactory);428 CREATE_SYM_EDGE_MAP_FACTORY(DefaultMapFactory); 429 429 IMPORT_SYM_EDGE_MAP(SymEdgeMapFactory); 430 430 … … 509 509 510 510 CREATE_MAP_REGISTRIES; 511 CREATE_MAPS( ArrayMapFactory);511 CREATE_MAPS(DefaultMapFactory); 512 512 513 513 public: … … 806 806 807 807 CREATE_EDGE_MAP_REGISTRY; 808 CREATE_EDGE_MAP_FACTORY( ArrayMapFactory);808 CREATE_EDGE_MAP_FACTORY(DefaultMapFactory); 809 809 IMPORT_EDGE_MAP(EdgeMapFactory); 810 810 -
src/hugo/smart_graph.h
r782 r798 13 13 #include <hugo/invalid.h> 14 14 15 #include <hugo/ array_map_factory.h>15 #include <hugo/default_map_factory.h> 16 16 #include <hugo/sym_map_factory.h> 17 17 #include <hugo/map_registry.h> … … 74 74 75 75 CREATE_MAP_REGISTRIES; 76 CREATE_MAPS( ArrayMapFactory);76 CREATE_MAPS(DefaultMapFactory); 77 77 78 78 public: … … 297 297 298 298 CREATE_SYM_EDGE_MAP_REGISTRY; 299 CREATE_SYM_EDGE_MAP_FACTORY( ArrayMapFactory);299 CREATE_SYM_EDGE_MAP_FACTORY(DefaultMapFactory); 300 300 IMPORT_SYM_EDGE_MAP(SymEdgeMapFactory); 301 301 … … 306 306 { 307 307 Edge e = SmartGraph::addEdge(u,v); 308 SmartGraph::addEdge(v,u); 308 Edge f = SmartGraph::addEdge(v,u); 309 sym_edge_maps.add(e); 310 sym_edge_maps.add(f); 309 311 return e; 310 312 } -
src/hugo/sym_map_factory.h
r786 r798 13 13 14 14 SymEdgeIt(const Graph& graph) 15 : EdgeIt(graph) {} 15 : EdgeIt(graph) { 16 while ( n != -1 && (n & 1)) { 17 EdgeIt::operator++(); 18 } 19 } 16 20 17 21 SymEdgeIt(Invalid invalid) … … 53 57 Map(const Graph& g, MapRegistry& r) : MapImpl(g, r) {} 54 58 55 Map(const Graph& g, MapRegistry& r, const Value& v) : MapImpl(g, r, v) {} 59 Map(const Graph& g, MapRegistry& r, const Value& v) 60 : MapImpl(g, r, v) {} 56 61 57 62 Map(const Map& copy) : MapImpl(static_cast<const MapImpl&>(copy)) {} -
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.