1.1 --- a/src/lemon/array_map.h Sat Nov 13 12:53:28 2004 +0000
1.2 +++ b/src/lemon/array_map.h Sat Nov 13 17:07:10 2004 +0000
1.3 @@ -38,7 +38,7 @@
1.4 * the container functionality.
1.5 *
1.6 * The template parameter is the MapRegistry that the maps
1.7 - * will belong to and the ValueType.
1.8 + * will belong to and the Value.
1.9 */
1.10
1.11 template <typename _Graph,
1.12 @@ -52,7 +52,7 @@
1.13 /// The graph type of the maps.
1.14 typedef _Graph Graph;
1.15 /// The key type of the maps.
1.16 - typedef _Item KeyType;
1.17 + typedef _Item Key;
1.18
1.19 typedef AlterationObserverRegistry<_Item> Registry;
1.20
1.21 @@ -60,8 +60,6 @@
1.22 /// The iterator to iterate on the keys.
1.23 typedef _ItemIt KeyIt;
1.24
1.25 - typedef _Value Value;
1.26 -
1.27 /// The MapBase of the Map which imlements the core regisitry function.
1.28 typedef typename Registry::ObserverBase Parent;
1.29
1.30 @@ -69,18 +67,18 @@
1.31 public:
1.32
1.33 /// The value type of the map.
1.34 - typedef Value ValueType;
1.35 + typedef _Value Value;
1.36 /// The reference type of the map;
1.37 - typedef Value& ReferenceType;
1.38 + typedef Value& Reference;
1.39 /// The pointer type of the map;
1.40 - typedef Value* PointerType;
1.41 + typedef Value* Pointer;
1.42
1.43 /// The const value type of the map.
1.44 - typedef const Value ConstValueType;
1.45 + typedef const Value ConstValue;
1.46 /// The const reference type of the map;
1.47 - typedef const Value& ConstReferenceType;
1.48 + typedef const Value& ConstReference;
1.49 /// The pointer type of the map;
1.50 - typedef const Value* ConstPointerType;
1.51 + typedef const Value* ConstPointer;
1.52
1.53
1.54 private:
1.55 @@ -172,7 +170,7 @@
1.56 * The subscript operator. The map can be subscripted by the
1.57 * actual keys of the graph.
1.58 */
1.59 - ReferenceType operator[](const KeyType& key) {
1.60 + Reference operator[](const Key& key) {
1.61 int id = graph->id(key);
1.62 return values[id];
1.63 }
1.64 @@ -181,7 +179,7 @@
1.65 * The const subscript operator. The map can be subscripted by the
1.66 * actual keys of the graph.
1.67 */
1.68 - ConstReferenceType operator[](const KeyType& key) const {
1.69 + ConstReference operator[](const Key& key) const {
1.70 int id = graph->id(key);
1.71 return values[id];
1.72 }
1.73 @@ -189,13 +187,13 @@
1.74 /** Setter function of the map. Equivalent with map[key] = val.
1.75 * This is a compatibility feature with the not dereferable maps.
1.76 */
1.77 - void set(const KeyType& key, const ValueType& val) {
1.78 + void set(const Key& key, const Value& val) {
1.79 (*this)[key] = val;
1.80 }
1.81
1.82 /** Add a new key to the map. It called by the map registry.
1.83 */
1.84 - void add(const KeyType& key) {
1.85 + void add(const Key& key) {
1.86 int id = graph->id(key);
1.87 if (id >= capacity) {
1.88 int new_capacity = (capacity == 0 ? 1 : capacity);
1.89 @@ -219,7 +217,7 @@
1.90
1.91 /** Erase a key from the map. It called by the map registry.
1.92 */
1.93 - void erase(const KeyType& key) {
1.94 + void erase(const Key& key) {
1.95 int id = graph->id(key);
1.96 allocator.destroy(&(values[id]));
1.97 }
1.98 @@ -321,13 +319,13 @@
1.99 // // STL compatibility typedefs.
1.100 // typedef Iterator iterator;
1.101 // typedef ConstIterator const_iterator;
1.102 -// typedef typename Iterator::PairValueType value_type;
1.103 -// typedef typename Iterator::KeyType key_type;
1.104 -// typedef typename Iterator::ValueType data_type;
1.105 -// typedef typename Iterator::PairReferenceType reference;
1.106 -// typedef typename Iterator::PairPointerType pointer;
1.107 -// typedef typename ConstIterator::PairReferenceType const_reference;
1.108 -// typedef typename ConstIterator::PairPointerType const_pointer;
1.109 +// typedef typename Iterator::PairValue value_type;
1.110 +// typedef typename Iterator::Key key_type;
1.111 +// typedef typename Iterator::Value data_type;
1.112 +// typedef typename Iterator::PairReference reference;
1.113 +// typedef typename Iterator::PairPointer pointer;
1.114 +// typedef typename ConstIterator::PairReference const_reference;
1.115 +// typedef typename ConstIterator::PairPointer const_pointer;
1.116 // typedef int difference_type;
1.117 };
1.118