[Lemon-commits] [lemon_svn] deba: r1604 - hugo/trunk/src/lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:46:31 CET 2006


Author: deba
Date: Fri Mar  4 18:16:01 2005
New Revision: 1604

Modified:
   hugo/trunk/src/lemon/graph_utils.h

Log:
Adding GraphEdgeSet and GraphNodeSet classes to graph_utils.h.


Modified: hugo/trunk/src/lemon/graph_utils.h
==============================================================================
--- hugo/trunk/src/lemon/graph_utils.h	(original)
+++ hugo/trunk/src/lemon/graph_utils.h	Fri Mar  4 18:16:01 2005
@@ -21,6 +21,7 @@
 
 #include <lemon/invalid.h>
 #include <lemon/utility.h>
+#include <lemon/map_utils.h>
 
 ///\ingroup gutils
 ///\file
@@ -261,8 +262,61 @@
      }
      
    };
+  
+  template <typename _Graph>
+  class GraphNodeSet {
+  public:
+    
+    typedef _Graph Graph;
+
+    typedef typename Graph::Node Item;
+    typedef typename Graph::NodeIt ItemIt;
+
+    template <typename _Value>
+    class Map : public Graph::template NodeMap<_Value> {
+    public:
+      typedef typename Graph::template NodeMap<_Value> Parent; 
+      typedef typename Parent::Value Value;
+
+      Map(const Graph& _graph) : Parent(_graph) {}
+      Map(const Graph& _graph, const Value& _value) 
+	: Parent(_graph, _value) {}
+    };
+
+    typedef IdMap<Graph, Item> IdMap;
+    
+  private:
+    Graph* graph;
+  };
+
+  template <typename _Graph>
+  class GraphEdgeSet {
+  public:
+    
+    typedef _Graph Graph;
+
+    typedef typename Graph::Edge Item;
+    typedef typename Graph::EdgeIt ItemIt;
+
+    template <typename _Value>
+    class Map : public Graph::template EdgeMap<_Value> {
+    public:
+      typedef typename Graph::template EdgeMap<_Value> Parent; 
+      typedef typename Parent::Value Value;
+
+      Map(const Graph& _graph) : Parent(_graph) {}
+      Map(const Graph& _graph, const Value& _value) 
+	: Parent(_graph, _value) {}
+    };
+
+    typedef IdMap<Graph, Item> IdMap;
+    
+  private:
+    Graph* graph;
+  };
+
 
-/// @}
+  /// @}
   
 } //END OF NAMESPACE LEMON
 



More information about the Lemon-commits mailing list