# HG changeset patch # User deba # Date 1138371491 0 # Node ID f1f523d39d327e964f5f452fc365b268dbc7bc5c # Parent 7ef30a71937f956370876fb1edec9d0ec74589bc Add new ItemSetTraits for ANode and BNode diff -r 7ef30a71937f -r f1f523d39d32 lemon/traits.h --- a/lemon/traits.h Fri Jan 27 08:19:42 2006 +0000 +++ b/lemon/traits.h Fri Jan 27 14:18:11 2006 +0000 @@ -93,6 +93,52 @@ }; + + template + class ItemSetTraits<_Graph, typename _Graph::ANode> { + public: + + typedef _Graph Graph; + + typedef typename Graph::ANode Item; + typedef typename Graph::ANodeIt ItemIt; + + template + class Map : public Graph::template ANodeMap<_Value> { + public: + typedef typename Graph::template ANodeMap<_Value> Parent; + typedef typename Parent::Value Value; + + Map(const Graph& _graph) : Parent(_graph) {} + Map(const Graph& _graph, const Value& _value) + : Parent(_graph, _value) {} + }; + + }; + + template + class ItemSetTraits<_Graph, typename _Graph::BNode> { + public: + + typedef _Graph Graph; + + typedef typename Graph::BNode Item; + typedef typename Graph::BNodeIt ItemIt; + + template + class Map : public Graph::template BNodeMap<_Value> { + public: + typedef typename Graph::template BNodeMap<_Value> Parent; + typedef typename Parent::Value Value; + + Map(const Graph& _graph) : Parent(_graph) {} + Map(const Graph& _graph, const Value& _value) + : Parent(_graph, _value) {} + }; + + }; + + template struct MapTraits { typedef False ReferenceMapTag;