# HG changeset patch # User deba # Date 1109956561 0 # Node ID aa4483befa56900ec5dd94c9c3b4c1a91769e244 # Parent c988f12c6c0cd70e3a316414829ab9a631a0fc0e Adding GraphEdgeSet and GraphNodeSet classes to graph_utils.h. diff -r c988f12c6c0c -r aa4483befa56 src/lemon/graph_utils.h --- a/src/lemon/graph_utils.h Fri Mar 04 17:14:48 2005 +0000 +++ b/src/lemon/graph_utils.h Fri Mar 04 17:16:01 2005 +0000 @@ -21,6 +21,7 @@ #include #include +#include ///\ingroup gutils ///\file @@ -261,8 +262,61 @@ } }; + + template + class GraphNodeSet { + public: + + typedef _Graph Graph; -/// @} + typedef typename Graph::Node Item; + typedef typename Graph::NodeIt ItemIt; + + template + 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 IdMap; + + private: + Graph* graph; + }; + + template + class GraphEdgeSet { + public: + + typedef _Graph Graph; + + typedef typename Graph::Edge Item; + typedef typename Graph::EdgeIt ItemIt; + + template + 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 IdMap; + + private: + Graph* graph; + }; + + + /// @} } //END OF NAMESPACE LEMON