Index: src/lemon/array_map.h
===================================================================
--- src/lemon/array_map.h	(revision 1164)
+++ src/lemon/array_map.h	(revision 1267)
@@ -19,4 +19,5 @@
 
 #include <memory>
+#include <lemon/map_iterator.h>
 
 ///\ingroup graphmaps
@@ -36,5 +37,5 @@
    *  the container functionality.
    *
-   *  The template parameter is the MapRegistry that the maps
+   *  The template parameter is the AlterationNotifier that the maps
    *  will belong to and the Value.
    */
@@ -42,8 +43,8 @@
   template <typename _Graph, 
 	    typename _Item,
-	    typename _ItemIt,
 	    typename _Value>
   class ArrayMap : public AlterationNotifier<_Item>::ObserverBase {
 
+    typedef _Item Item;
   public:
 		
@@ -55,27 +56,9 @@
     typedef AlterationNotifier<_Item> Registry;
 
-  private:
-    /// The iterator to iterate on the keys.
-    typedef _ItemIt KeyIt;
-
     /// The MapBase of the Map which imlements the core regisitry function.
     typedef typename Registry::ObserverBase Parent;
 		
-    
-  public:
-
     /// The value type of the map.
     typedef _Value Value;
-    /// The reference type of the map;
-    typedef Value& Reference;
-    /// The pointer type of the map;
-    typedef Value* Pointer;
-
-    /// The const value type of the map.
-    typedef const Value ConstValue;
-    /// The const reference type of the map;
-    typedef const Value& ConstReference;
-    /// The pointer type of the map;
-    typedef const Value* ConstPointer;
 
 
@@ -89,20 +72,22 @@
      */
     ArrayMap(const Graph& _g) : graph(&_g) {
+      Item it;
+      attach(_g.getNotifier(Item()));
+      allocate_memory();
+      for (graph->first(it); it != INVALID; graph->next(it)) {
+	int id = graph->id(it);;
+	allocator.construct(&(values[id]), Value());
+      }								
+    }
+
+    /// Constructor to use default value to initialize the map. 
+
+    /// It constrates a map and initialize all of the the map. 
+
+    ArrayMap(const Graph& _g, const Value& _v) : graph(&_g) {
+      Item it;
       attach(_g.getNotifier(_Item()));
       allocate_memory();
-      for (KeyIt it(*graph); it != INVALID; ++it) {
-	int id = graph->id(it);;
-	allocator.construct(&(values[id]), Value());
-      }								
-    }
-
-    /// Constructor to use default value to initialize the map. 
-
-    /// It constrates a map and initialize all of the the map. 
-
-    ArrayMap(const Graph& _g, const Value& _v) : graph(&_g) {
-      attach(_g.getNotifier(_Item()));
-      allocate_memory();
-      for (KeyIt it(*graph); it != INVALID; ++it) {
+      for (graph->first(it); it != INVALID; graph->next(it)) {
 	int id = graph->id(it);;
 	allocator.construct(&(values[id]), _v);
@@ -119,5 +104,6 @@
       if (capacity == 0) return;
       values = allocator.allocate(capacity);
-      for (KeyIt it(*graph); it != INVALID; ++it) {
+      Item it;
+      for (graph->first(it); it != INVALID; graph->next(it)) {
 	int id = graph->id(it);;
 	allocator.construct(&(values[id]), copy.values[id]);
@@ -147,5 +133,6 @@
       }
 
-      for (KeyIt it(*graph); it != INVALID; ++it) {
+      Item it;
+      for (graph->first(it); it != INVALID; graph->next(it)) {
 	int id = graph->id(it);;
 	allocator.construct(&(values[id]), copy.values[id]);
@@ -169,5 +156,5 @@
      * actual keys of the graph. 
      */
-    Reference operator[](const Key& key) {
+    Value& operator[](const Key& key) {
       int id = graph->id(key);
       return values[id];
@@ -178,5 +165,5 @@
      * actual keys of the graph. 
      */
-    ConstReference operator[](const Key& key) const {
+    const Value& operator[](const Key& key) const {
       int id = graph->id(key);
       return values[id];
@@ -200,5 +187,6 @@
 	}
 	Value* new_values = allocator.allocate(new_capacity);
-	for (KeyIt it(*graph); it != INVALID; ++it) {
+	Item it;
+	for (graph->first(it); it != INVALID; graph->next(it)) {
 	  int jd = graph->id(it);;
 	  if (id != jd) {
@@ -223,5 +211,6 @@
     void build() {
       allocate_memory();
-      for (KeyIt it(*graph); it != INVALID; ++it) {
+      Item it;
+      for (graph->first(it); it != INVALID; graph->next(it)) {
 	int id = graph->id(it);;
 	allocator.construct(&(values[id]), Value());
@@ -231,5 +220,6 @@
     void clear() {	
       if (capacity != 0) {
-	for (KeyIt it(*graph); it != INVALID; ++it) {
+	Item it;
+	for (graph->first(it); it != INVALID; graph->next(it)) {
 	  int id = graph->id(it);;
 	  allocator.destroy(&(values[id]));
@@ -314,16 +304,4 @@
     Allocator allocator;
 
-  public:
-//     // STL  compatibility typedefs.
-//     typedef Iterator iterator;
-//     typedef ConstIterator const_iterator;
-//     typedef typename Iterator::PairValue value_type;
-//     typedef typename Iterator::Key key_type;
-//     typedef typename Iterator::Value data_type;
-//     typedef typename Iterator::PairReference reference;
-//     typedef typename Iterator::PairPointer pointer;
-//     typedef typename ConstIterator::PairReference const_reference;
-//     typedef typename ConstIterator::PairPointer const_pointer;
-//     typedef int difference_type;		
   };		
 
@@ -346,5 +324,6 @@
 
     template <typename _Value>
-    class NodeMap : public ArrayMap<Graph, Node, NodeIt, _Value> {
+    class NodeMap 
+      : public IterableMapExtender<ArrayMap<Graph, Node, _Value> > {
     public:
       typedef ArrayMappableGraphExtender<_Base> Graph;
@@ -353,5 +332,5 @@
       typedef typename Graph::NodeIt NodeIt;
 
-      typedef ArrayMap<Graph, Node, NodeIt, _Value> Parent;
+      typedef IterableMapExtender<ArrayMap<Graph, Node, _Value> > Parent;
 
       //typedef typename Parent::Graph Graph;
@@ -366,5 +345,6 @@
 
     template <typename _Value>
-    class EdgeMap : public ArrayMap<Graph, Edge, EdgeIt, _Value> {
+    class EdgeMap 
+      : public IterableMapExtender<ArrayMap<Graph, Edge, _Value> > {
     public:
       typedef ArrayMappableGraphExtender<_Base> Graph;
@@ -373,5 +353,5 @@
       typedef typename Graph::EdgeIt EdgeIt;
 
-      typedef ArrayMap<Graph, Edge, EdgeIt, _Value> Parent;
+      typedef IterableMapExtender<ArrayMap<Graph, Edge, _Value> > Parent;
 
       //typedef typename Parent::Graph Graph;
