diff -r c6acc34f98dc -r 1a7fe3bef514 lemon/bits/map_extender.h --- a/lemon/bits/map_extender.h Fri Oct 16 10:21:37 2009 +0200 +++ b/lemon/bits/map_extender.h Thu Nov 05 15:50:01 2009 +0100 @@ -2,7 +2,7 @@ * * This file is a part of LEMON, a generic C++ optimization library. * - * Copyright (C) 2003-2008 + * Copyright (C) 2003-2009 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport * (Egervary Research Group on Combinatorial Optimization, EGRES). * @@ -36,17 +36,20 @@ // \brief Extender for maps template class MapExtender : public _Map { + typedef _Map Parent; + typedef typename Parent::GraphType GraphType; + public: - typedef _Map Parent; typedef MapExtender Map; - - - typedef typename Parent::Graph Graph; typedef typename Parent::Key Item; typedef typename Parent::Key Key; typedef typename Parent::Value Value; + typedef typename Parent::Reference Reference; + typedef typename Parent::ConstReference ConstReference; + + typedef typename Parent::ReferenceMapTag ReferenceMapTag; class MapIt; class ConstMapIt; @@ -56,10 +59,10 @@ public: - MapExtender(const Graph& graph) + MapExtender(const GraphType& graph) : Parent(graph) {} - MapExtender(const Graph& graph, const Value& value) + MapExtender(const GraphType& graph, const Value& value) : Parent(graph, value) {} private: @@ -75,9 +78,10 @@ public: class MapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; typedef typename Map::Value Value; MapIt() {} @@ -114,10 +118,10 @@ }; class ConstMapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - typedef typename Map::Value Value; ConstMapIt() {} @@ -145,10 +149,10 @@ }; class ItemIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - ItemIt() {} ItemIt(Invalid i) : Parent(i) { } @@ -176,17 +180,20 @@ // \brief Extender for maps which use a subset of the items. template class SubMapExtender : public _Map { + typedef _Map Parent; + typedef _Graph GraphType; + public: - typedef _Map Parent; typedef SubMapExtender Map; - - typedef _Graph Graph; - typedef typename Parent::Key Item; typedef typename Parent::Key Key; typedef typename Parent::Value Value; + typedef typename Parent::Reference Reference; + typedef typename Parent::ConstReference ConstReference; + + typedef typename Parent::ReferenceMapTag ReferenceMapTag; class MapIt; class ConstMapIt; @@ -196,10 +203,10 @@ public: - SubMapExtender(const Graph& _graph) + SubMapExtender(const GraphType& _graph) : Parent(_graph), graph(_graph) {} - SubMapExtender(const Graph& _graph, const Value& _value) + SubMapExtender(const GraphType& _graph, const Value& _value) : Parent(_graph, _value), graph(_graph) {} private: @@ -219,9 +226,9 @@ public: class MapIt : public Item { + typedef Item Parent; + public: - - typedef Item Parent; typedef typename Map::Value Value; MapIt() {} @@ -258,10 +265,10 @@ }; class ConstMapIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - typedef typename Map::Value Value; ConstMapIt() {} @@ -289,10 +296,10 @@ }; class ItemIt : public Item { + typedef Item Parent; + public: - typedef Item Parent; - ItemIt() {} ItemIt(Invalid i) : Parent(i) { } @@ -316,7 +323,7 @@ private: - const Graph& graph; + const GraphType& graph; };