Index: src/lemon/array_map.h
===================================================================
--- src/lemon/array_map.h	(revision 979)
+++ src/lemon/array_map.h	(revision 980)
@@ -45,5 +45,4 @@
 	    typename _Item,
 	    typename _ItemIt,
-	    typename _IdMap,
 	    typename _Value>
   class ArrayMap : public AlterationObserverRegistry<_Item>::ObserverBase {
@@ -61,6 +60,4 @@
     /// The iterator to iterate on the keys.
     typedef _ItemIt KeyIt;
-
-    typedef _IdMap IdMap;
 
     typedef _Value Value;
@@ -95,9 +92,9 @@
     /** Graph and Registry initialized map constructor.
      */
-    ArrayMap(const Graph& _g, Registry& _r) : graph(&_g) {
-      attach(_r);
+    ArrayMap(const Graph& _g) : graph(&_g) {
+      attach(_g.getObserverRegistry(_Item()));
       allocate_memory();
       for (KeyIt it(*graph); it != INVALID; ++it) {
-	int id = IdMap(*graph)[it];
+	int id = graph->id(it);;
 	allocator.construct(&(values[id]), Value());
       }								
@@ -108,9 +105,9 @@
     /// It constrates a map and initialize all of the the map. 
 
-    ArrayMap(const Graph& _g, Registry& _r, const Value& _v) : graph(&_g) {
-      attach(_r);
+    ArrayMap(const Graph& _g, const Value& _v) : graph(&_g) {
+      attach(_g.getObserverRegistry(_Item()));
       allocate_memory();
       for (KeyIt it(*graph); it != INVALID; ++it) {
-	int id = IdMap(*graph)[it];
+	int id = graph->id(it);;
 	allocator.construct(&(values[id]), _v);
       }								
@@ -127,5 +124,5 @@
       values = allocator.allocate(capacity);
       for (KeyIt it(*graph); it != INVALID; ++it) {
-	int id = IdMap(*graph)[it];
+	int id = graph->id(it);;
 	allocator.construct(&(values[id]), copy.values[id]);
       }
@@ -155,5 +152,5 @@
 
       for (KeyIt it(*graph); it != INVALID; ++it) {
-	int id = IdMap(*graph)[it];
+	int id = graph->id(it);;
 	allocator.construct(&(values[id]), copy.values[id]);
       }
@@ -177,5 +174,5 @@
      */
     ReferenceType operator[](const KeyType& key) {
-      int id = IdMap(*graph)[key];
+      int id = graph->id(key);
       return values[id];
     } 
@@ -186,5 +183,5 @@
      */
     ConstReferenceType operator[](const KeyType& key) const {
-      int id = IdMap(*graph)[key];
+      int id = graph->id(key);
       return values[id];
     }
@@ -200,5 +197,5 @@
      */
     void add(const KeyType& key) {
-      int id = IdMap(*graph)[key];
+      int id = graph->id(key);
       if (id >= capacity) {
 	int new_capacity = (capacity == 0 ? 1 : capacity);
@@ -208,5 +205,5 @@
 	Value* new_values = allocator.allocate(new_capacity);
 	for (KeyIt it(*graph); it != INVALID; ++it) {
-	  int jd = IdMap(*graph)[it];
+	  int jd = graph->id(it);;
 	  if (id != jd) {
 	    allocator.construct(&(new_values[jd]), values[jd]);
@@ -224,5 +221,5 @@
      */
     void erase(const KeyType& key) {
-      int id = IdMap(*graph)[key];
+      int id = graph->id(key);
       allocator.destroy(&(values[id]));
     }
@@ -231,5 +228,5 @@
       allocate_memory();
       for (KeyIt it(*graph); it != INVALID; ++it) {
-	int id = IdMap(*graph)[it];
+	int id = graph->id(it);;
 	allocator.construct(&(values[id]), Value());
       }								
@@ -239,5 +236,5 @@
       if (capacity != 0) {
 	for (KeyIt it(*graph); it != INVALID; ++it) {
-	  int id = IdMap(*graph)[it];
+	  int id = graph->id(it);;
 	  allocator.destroy(&(values[id]));
 	}								
@@ -303,5 +300,5 @@
       
     void allocate_memory() {
-      int max_id = IdMap(*graph).maxId();
+      int max_id = graph->maxId(_Item());
       if (max_id == -1) {
 	capacity = 0;
@@ -344,10 +341,8 @@
     typedef typename Parent::Node Node;
     typedef typename Parent::NodeIt NodeIt;
-    typedef typename Parent::NodeIdMap NodeIdMap;
     typedef typename Parent::NodeObserverRegistry NodeObserverRegistry;
 
     typedef typename Parent::Edge Edge;
     typedef typename Parent::EdgeIt EdgeIt;
-    typedef typename Parent::EdgeIdMap EdgeIdMap;
     typedef typename Parent::EdgeObserverRegistry EdgeObserverRegistry;
 
@@ -355,5 +350,5 @@
 
     template <typename _Value>
-    class NodeMap : public ArrayMap<Graph, Node, NodeIt, NodeIdMap, _Value> {
+    class NodeMap : public ArrayMap<Graph, Node, NodeIt, _Value> {
     public:
       typedef ArrayMappableGraphExtender<_Base> Graph;
@@ -361,7 +356,6 @@
       typedef typename Graph::Node Node;
       typedef typename Graph::NodeIt NodeIt;
-      typedef typename Graph::NodeIdMap NodeIdMap;
-
-      typedef ArrayMap<Graph, Node, NodeIt, NodeIdMap, _Value> Parent;
+
+      typedef ArrayMap<Graph, Node, NodeIt, _Value> Parent;
 
       //typedef typename Parent::Graph Graph;
@@ -369,12 +363,12 @@
 
       NodeMap(const Graph& g) 
-	: Parent(g, g.getNodeObserverRegistry()) {}
+	: Parent(g) {}
       NodeMap(const Graph& g, const Value& v) 
-	: Parent(g, g.getNodeObserverRegistry(), v) {}
+	: Parent(g, v) {}
 
     };
 
     template <typename _Value>
-    class EdgeMap : public ArrayMap<Graph, Edge, EdgeIt, EdgeIdMap, _Value> {
+    class EdgeMap : public ArrayMap<Graph, Edge, EdgeIt, _Value> {
     public:
       typedef ArrayMappableGraphExtender<_Base> Graph;
@@ -382,7 +376,6 @@
       typedef typename Graph::Edge Edge;
       typedef typename Graph::EdgeIt EdgeIt;
-      typedef typename Graph::EdgeIdMap EdgeIdMap;
-
-      typedef ArrayMap<Graph, Edge, EdgeIt, EdgeIdMap, _Value> Parent;
+
+      typedef ArrayMap<Graph, Edge, EdgeIt, _Value> Parent;
 
       //typedef typename Parent::Graph Graph;
@@ -390,7 +383,7 @@
 
       EdgeMap(const Graph& g) 
-	: Parent(g, g.getEdgeObserverRegistry()) {}
+	: Parent(g) {}
       EdgeMap(const Graph& g, const Value& v) 
-	: Parent(g, g.getEdgeObserverRegistry(), v) {}
+	: Parent(g, v) {}
 
     };
