diff -r a76d8d52b25c -r 6d1abeb62dd3 src/hugo/vector_map_factory.h --- a/src/hugo/vector_map_factory.h Fri Sep 03 14:26:03 2004 +0000 +++ b/src/hugo/vector_map_factory.h Fri Sep 03 15:11:17 2004 +0000 @@ -17,7 +17,7 @@ /** The VectorMapFactory template class is a factory class * to create maps for the edge and nodes. This map factory - * use the std::vector to implement the container function. + * uses the std::vector to implement the container function. * * The template parameter is the MapRegistry that the maps * will belong to. @@ -42,12 +42,27 @@ */ template class Map : public MapBase { + + typedef std::vector Container; + public: /// The value type of the map. + typedef V ValueType; + + /// The value type of the map. typedef V Value; + /// The reference type of the map; + typedef typename Container::reference Reference; + /// The pointer type of the map; + typedef typename Container::pointer Pointer; - typedef std::vector Container; + /// The const value type of the map. + typedef const Value ConstValue; + /// The const reference type of the map; + typedef typename Container::const_reference ConstReference; + /// The pointer type of the map; + typedef typename Container::const_pointer ConstPointer; /** Default constructor for the map. */ @@ -64,7 +79,7 @@ Map(const Graph& g, MapRegistry& r, const Value& v) : MapBase(g, r) { for (KeyIt it(*getGraph()); it != INVALID; ++it) { int id = getGraph()->id(it); - if (id >= container.size()) { + if (id >= (int)container.size()) { container.resize(id + 1); } set(it, v); @@ -77,7 +92,7 @@ if (getGraph()) { for (KeyIt it(*getGraph()); it != INVALID; ++it) { int id = getGraph()->id(it); - if (id >= container.size()) { + if (id >= (int)container.size()) { container.resize(id + 1); } set(it, copy[it]); @@ -95,12 +110,13 @@ if (getGraph()) { for (KeyIt it(*getGraph()); it != INVALID; ++it) { int id = getGraph()->id(it); - if (id >= container.size()) { + if (id >= (int)container.size()) { container.resize(id + 1); } set(it, copy[it]); } } + return *this; } /** The destructor of the map. @@ -112,7 +128,11 @@ * The subscript operator. The map can be subscripted by the * actual keys of the graph. */ +<<<<<<< .mine + Reference operator[](const Key& key) { +======= typename Container::reference operator[](const KeyType& key) { +>>>>>>> .r1091 int id = getGraph()->id(key); return container[id]; } @@ -121,7 +141,11 @@ * The const subscript operator. The map can be subscripted by the * actual keys of the graph. */ +<<<<<<< .mine + ConstReference operator[](const Key& key) const { +======= typename Container::const_reference operator[](const KeyType& key) const { +>>>>>>> .r1091 int id = getGraph()->id(key); return container[id]; } @@ -138,7 +162,7 @@ */ void add(const KeyType& key) { int id = getGraph()->id(key); - if (id >= container.size()) { + if (id >= (int)container.size()) { container.resize(id + 1); } } @@ -173,7 +197,7 @@ iterator() {} typedef extended_pair Reference; + Map::Reference, Map::Reference> Reference; /** Dereference operator for map. */ @@ -263,7 +287,7 @@ const_iterator(iterator p_it) : map(p_it.map), it(p_it.it) {} typedef extended_pair Reference; + Map::ConstReference, Map::ConstReference> Reference; /** Dereference operator for map. */