Index: src/lemon/map_registry.h
===================================================================
--- src/lemon/map_registry.h	(revision 921)
+++ src/lemon/map_registry.h	(revision 937)
@@ -28,13 +28,22 @@
 namespace lemon {
 
-/// \addtogroup graphmapfactory
-/// @{
-
-/** 
- * Registry class to register edge or node maps into the graph. The
- * registry helps you to implement an observer pattern. If you add
- * or erase an edge or node you must notify all the maps about the
- * event.
-*/
+  /// \addtogroup graphmapfactory
+  /// @{
+
+  /// Map registry for graph maps.
+
+  /** 
+   * Registry class to register edge or node maps into the graph. The
+   * registry helps you to implement an observer pattern. If you add
+   * or erase an edge or node you must notify all the maps about the
+   * event.
+   *
+   * \param G The graph type to register maps.
+   * \param K The key type of the maps registered into the registry.
+   * \param KIt The key iterator type iterates on the keys.
+   *
+   * \author Balazs Dezso
+   */
+
   template <typename G, typename K, typename KIt>
   class MapRegistry {
@@ -43,7 +52,9 @@
     typedef K KeyType;
     typedef KIt KeyIt;
-	
-    /**
-     * MapBase is the base class of the registered maps.
+
+    /// MapBase is the base class of the dynamic maps.
+	
+    /**
+     * MapBase is the base class of the dynamic maps.
      * It defines the core modification operations on the maps and
      * implements some helper functions. 
@@ -59,4 +70,6 @@
       friend class MapRegistry<G, K, KIt>;
 
+      /// Default constructor.
+
       /**
        * Default constructor for MapBase.
@@ -64,7 +77,9 @@
 
       MapBase() : graph(0), registry(0) {}
-		
-      /** 
-       * Simple constructor to register into a graph registry.
+
+      /// Constructor to register map into a graph registry.
+		
+      /** 
+       * Simple constructor to register dynamic map into a graph registry.
       */
 	
@@ -73,6 +88,10 @@
       }
 
+      /// Copy constructor.
+
       /** 
        * Copy constructor to register into the registry.
+       * If the copiable map is registered into a registry
+       * the construated map will be registered to the same registry.
       */	
 	
@@ -82,7 +101,11 @@
 	}
       } 
-	
-      /** 
-       * Assign operator.
+
+      /// Assign operator.
+	
+      /** 
+       * Assign operator. This member detach first the map
+       * from the current registry and then it attach to the
+       * copiable map's registry if it exists.
       */	
       const MapBase& operator=(const MapBase& copy) {
@@ -97,7 +120,9 @@
       }
 	
-
-      /** 
-       * Destructor. 
+      /// Destructor
+
+      /** 
+       * This member detach the map from the its registry if the
+       * registry exists.
       */		
 
@@ -108,4 +133,6 @@
       }
 
+      /// The graph of the map.
+
       /*
        * Returns the graph that the map belongs to.
@@ -122,7 +149,12 @@
 
     protected:
-	
-      /**
-	 Helper function to implement constructors in the subclasses.
+
+      /// Helper function to implement constructors in the subclasses.
+	
+      /**
+       * Helper function to implement constructors in the subclasses.
+       * It adds all of the nodes or edges to the map via the 
+       * \ref MapRegistry::MapBase::add add
+       * member function.
       */
 	
@@ -133,6 +165,12 @@
       }
 	
-      /**
-	 Helper function to implement the destructor in the subclasses.
+
+      /// Helper function to implement destructors in the subclasses.
+	
+      /**
+       * Helper function to implement destructors in the subclasses.
+       * It erases all of the nodes or edges of the map via the 
+       * \ref MapRegistry::MapBase::erase erase
+       * member function. It can be used by the clear function also.
       */
 	
@@ -142,14 +180,20 @@
 	}
       }
+
+      /// The member function to add new node or edge to the map.
 	
       /** 
 	  The add member function should be overloaded in the subclasses.
-	  \e Add extends the map with the new node.
+	  \e Add extends the map with the new node or edge.
       */
 	
       virtual void add(const KeyType&) = 0;	
+
+
+      /// The member function to erase a node or edge from the map.
+
       /** 
 	  The erase member function should be overloaded in the subclasses.
-	  \e Erase removes the node from the map.
+	  \e Erase removes the node or edge from the map.
       */
 	
@@ -162,7 +206,11 @@
 
       virtual void clear() = 0;
-	
-      /**
-	 Exception class to throw at unsupported operation.
+
+      /// Exception class to throw at unsupported operation.
+	
+      /**
+       * Exception class to throw at unsupported operation.
+       * If the map does not support erasing or adding new
+       * node or key it must be throwed.
       */
 	
@@ -173,48 +221,56 @@
   protected:
 	
-    /** 
-     * The container type of the maps.
-     */
+
     typedef std::vector<MapBase*> Container; 
 
-    /**
-     * The container of the registered maps.
-     */
     Container container;
 
 		
   public:
-	
-    /**
-     * Default Constructor of the MapRegistry. It creates an empty registry.
+
+    /// Default constructor.
+	
+    /**
+     * Default constructor of the \e MapRegistry. 
+     * It creates an empty registry.
      */
     MapRegistry() {}
-	
-    /**
-     * Copy Constructor of the MapRegistry. The new registry does not steal
-     * the maps from the right value. The new registry will be an empty.
+
+    /// Copy Constructor of the MapRegistry. 
+	
+    /**
+     * Copy constructor of the \e MapRegistry. 
+     * The new registry does not steal
+     * the maps from the copiable registry. 
+     * The new registry will be empty.
      */
     MapRegistry(const MapRegistry&) {}
-		
-    /**
-     * Assign operator. The left value does not steal the maps 
-     * from the right value. The left value will be an empty registry.
+
+    /// Assign operator.
+		
+    /**
+     * Assign operator. This registry does not steal the maps 
+     * from the copiable registry. This registry will be an empty registry.
+     * This operator will be called when a graph is assigned.
      */
     MapRegistry& operator=(const MapRegistry&) {
       typename Container::iterator it;
       for (it = container.begin(); it != container.end(); ++it) {
-	(*it)->destroy();
+	(*it)->clear();
 	(*it)->graph = 0;
 	(*it)->registry = 0;
       }
     }
+
+    /// Destructor.
 				
     /**
-     * Destructor of the MapRegistry.
+     * Destructor of the MapRegistry. It makes empty the attached map
+     * first then detachs them.
      */
     ~MapRegistry() {
       typename Container::iterator it;
       for (it = container.begin(); it != container.end(); ++it) {
-	(*it)->destroy();
+	(*it)->clear();
 	(*it)->registry = 0;
 	(*it)->graph = 0;
@@ -224,7 +280,9 @@
 	
     public:
-	
-    /**
-     * Attach a map into thr registry. If the map has been attached
+
+    /// Attachs a map to the \e MapRegistry.
+	
+    /**
+     * Attachs a map into thr registry. If the map has been attached
      * into an other registry it is detached from that automaticly.
      */
@@ -237,7 +295,9 @@
       map.registry_index = container.size()-1;
     } 
-	
-    /**
-     * Detach the map from the registry.
+
+    /// Detachs a map from the \e MapRegistry.
+	
+    /**
+     * Detachs a map from the \e MapRegistry.
      */
     void detach(MapBase& map) {
@@ -249,9 +309,12 @@
     }
 	
+    /// Notify all the registered maps about a Key added.
 		
     /**
      * Notify all the registered maps about a Key added.
-     */
-    void add(KeyType& key) {
+     * This member should be called whenever a node or edge
+     * is added to the graph.
+     */
+    void add(const KeyType& key) {
       typename Container::iterator it;
       for (it = container.begin(); it != container.end(); ++it) {
@@ -259,9 +322,13 @@
       }
     }	
+
+    /// Notify all the registered maps about a Key erased.
 		
     /**
      * Notify all the registered maps about a Key erased.
+     * This member should be called whenever a node or edge
+     * is erased from the graph.
      */ 
-    void erase(KeyType& key) {
+    void erase(const KeyType& key) {
       typename Container::iterator it;
       for (it = container.begin(); it != container.end(); ++it) {
@@ -270,6 +337,11 @@
     }
 
+
+    /// Notify all the registered maps about all the Keys are erased.
+
     /**
      * Notify all the registered maps about the map should be cleared.
+     * This member should be called whenever all of the nodes or edges
+     * are erased from the graph.
      */ 
     void clear() {
