diff --git a/lemon/adaptors.h b/lemon/adaptors.h --- a/lemon/adaptors.h +++ b/lemon/adaptors.h @@ -109,13 +109,11 @@ template class NodeMap : public DGR::template NodeMap { + typedef typename DGR::template NodeMap Parent; + public: - - typedef typename DGR::template NodeMap Parent; - explicit NodeMap(const Adaptor& adaptor) : Parent(*adaptor._digraph) {} - NodeMap(const Adaptor& adaptor, const V& value) : Parent(*adaptor._digraph, value) { } @@ -134,13 +132,11 @@ template class ArcMap : public DGR::template ArcMap { + typedef typename DGR::template ArcMap Parent; + public: - - typedef typename DGR::template ArcMap Parent; - explicit ArcMap(const DigraphAdaptorBase& adaptor) : Parent(*adaptor._digraph) {} - ArcMap(const DigraphAdaptorBase& adaptor, const V& value) : Parent(*adaptor._digraph, value) {} @@ -255,8 +251,9 @@ template class NodeMap : public GR::template NodeMap { + typedef typename GR::template NodeMap Parent; + public: - typedef typename GR::template NodeMap Parent; explicit NodeMap(const GraphAdaptorBase& adapter) : Parent(*adapter._graph) {} NodeMap(const GraphAdaptorBase& adapter, const V& value) @@ -277,8 +274,9 @@ template class ArcMap : public GR::template ArcMap { + typedef typename GR::template ArcMap Parent; + public: - typedef typename GR::template ArcMap Parent; explicit ArcMap(const GraphAdaptorBase& adapter) : Parent(*adapter._graph) {} ArcMap(const GraphAdaptorBase& adapter, const V& value) @@ -298,8 +296,9 @@ template class EdgeMap : public GR::template EdgeMap { + typedef typename GR::template EdgeMap Parent; + public: - typedef typename GR::template EdgeMap Parent; explicit EdgeMap(const GraphAdaptorBase& adapter) : Parent(*adapter._graph) {} EdgeMap(const GraphAdaptorBase& adapter, const V& value) @@ -321,9 +320,9 @@ template class ReverseDigraphBase : public DigraphAdaptorBase { + typedef DigraphAdaptorBase Parent; public: typedef DGR Digraph; - typedef DigraphAdaptorBase Parent; protected: ReverseDigraphBase() : Parent() { } public: @@ -374,10 +373,10 @@ class ReverseDigraph : public DigraphAdaptorExtender > { #endif + typedef DigraphAdaptorExtender > Parent; public: /// The type of the adapted digraph. typedef DGR Digraph; - typedef DigraphAdaptorExtender > Parent; protected: ReverseDigraph() { } public: @@ -403,13 +402,13 @@ template class SubDigraphBase : public DigraphAdaptorBase { + typedef DigraphAdaptorBase Parent; public: typedef DGR Digraph; typedef NF NodeFilterMap; typedef AF ArcFilterMap; typedef SubDigraphBase Adaptor; - typedef DigraphAdaptorBase Parent; protected: NF* _node_filter; AF* _arc_filter; @@ -509,10 +508,11 @@ class NodeMap : public SubMapExtender, LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> Parent; NodeMap(const SubDigraphBase& adaptor) : Parent(adaptor) {} @@ -535,10 +535,11 @@ class ArcMap : public SubMapExtender, LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> Parent; ArcMap(const SubDigraphBase& adaptor) : Parent(adaptor) {} @@ -562,13 +563,13 @@ template class SubDigraphBase : public DigraphAdaptorBase { + typedef DigraphAdaptorBase Parent; public: typedef DGR Digraph; typedef NF NodeFilterMap; typedef AF ArcFilterMap; typedef SubDigraphBase Adaptor; - typedef DigraphAdaptorBase Parent; protected: NF* _node_filter; AF* _arc_filter; @@ -650,10 +651,11 @@ class NodeMap : public SubMapExtender, LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(DigraphAdaptorBase, NodeMap)> Parent; NodeMap(const SubDigraphBase& adaptor) : Parent(adaptor) {} @@ -676,10 +678,11 @@ class ArcMap : public SubMapExtender, LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(DigraphAdaptorBase, ArcMap)> Parent; ArcMap(const SubDigraphBase& adaptor) : Parent(adaptor) {} @@ -863,13 +866,13 @@ template class SubGraphBase : public GraphAdaptorBase { + typedef GraphAdaptorBase Parent; public: typedef GR Graph; typedef NF NodeFilterMap; typedef EF EdgeFilterMap; typedef SubGraphBase Adaptor; - typedef GraphAdaptorBase Parent; protected: NF* _node_filter; @@ -1016,10 +1019,11 @@ class NodeMap : public SubMapExtender, LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> Parent; NodeMap(const SubGraphBase& adaptor) : Parent(adaptor) {} @@ -1042,10 +1046,11 @@ class ArcMap : public SubMapExtender, LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> Parent; ArcMap(const SubGraphBase& adaptor) : Parent(adaptor) {} @@ -1068,10 +1073,11 @@ class EdgeMap : public SubMapExtender, LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> Parent; EdgeMap(const SubGraphBase& adaptor) : Parent(adaptor) {} @@ -1096,13 +1102,13 @@ template class SubGraphBase : public GraphAdaptorBase { + typedef GraphAdaptorBase Parent; public: typedef GR Graph; typedef NF NodeFilterMap; typedef EF EdgeFilterMap; typedef SubGraphBase Adaptor; - typedef GraphAdaptorBase Parent; protected: NF* _node_filter; EF* _edge_filter; @@ -1211,10 +1217,11 @@ class NodeMap : public SubMapExtender, LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(GraphAdaptorBase, NodeMap)> Parent; NodeMap(const SubGraphBase& adaptor) : Parent(adaptor) {} @@ -1237,10 +1244,11 @@ class ArcMap : public SubMapExtender, LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(GraphAdaptorBase, ArcMap)> Parent; ArcMap(const SubGraphBase& adaptor) : Parent(adaptor) {} @@ -1263,10 +1271,11 @@ class EdgeMap : public SubMapExtender, LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> { + typedef SubMapExtender, + LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> Parent; + public: typedef V Value; - typedef SubMapExtender, - LEMON_SCOPE_FIX(GraphAdaptorBase, EdgeMap)> Parent; EdgeMap(const SubGraphBase& adaptor) : Parent(adaptor) {} @@ -1485,15 +1494,15 @@ SubDigraphBase >, true> > { #endif - public: - - typedef GR Digraph; - typedef NF NodeFilterMap; - typedef DigraphAdaptorExtender< SubDigraphBase >, true> > Parent; + public: + + typedef GR Digraph; + typedef NF NodeFilterMap; + typedef typename Parent::Node Node; protected: @@ -1548,14 +1557,17 @@ SubGraphBase >, true> > { - public: - typedef GR Graph; - typedef NF NodeFilterMap; typedef GraphAdaptorExtender< SubGraphBase >, true> > Parent; + public: + + typedef GR Graph; + typedef NF NodeFilterMap; + typedef typename Parent::Node Node; + protected: ConstMap > const_true_map; @@ -1629,16 +1641,17 @@ SubDigraphBase >, AF, false> > { #endif + typedef DigraphAdaptorExtender< + SubDigraphBase >, + AF, false> > Parent; + public: + /// The type of the adapted digraph. typedef DGR Digraph; /// The type of the arc filter map. typedef AF ArcFilterMap; - typedef DigraphAdaptorExtender< - SubDigraphBase >, - AF, false> > Parent; - typedef typename Parent::Arc Arc; protected: @@ -1738,16 +1751,17 @@ SubGraphBase >, EF, false> > { #endif + typedef GraphAdaptorExtender< + SubGraphBase >, + EF, false> > Parent; + public: + /// The type of the adapted graph. typedef GR Graph; /// The type of the edge filter map. typedef EF EdgeFilterMap; - typedef GraphAdaptorExtender< - SubGraphBase >, - EF, false> > Parent; - typedef typename Parent::Edge Edge; protected: @@ -2111,10 +2125,10 @@ template class NodeMap : public DGR::template NodeMap { + typedef typename DGR::template NodeMap Parent; + public: - typedef V Value; - typedef typename DGR::template NodeMap Parent; explicit NodeMap(const UndirectorBase& adaptor) : Parent(*adaptor._digraph) {} @@ -2137,11 +2151,11 @@ template class ArcMap - : public SubMapExtender, ArcMapBase > - { + : public SubMapExtender, ArcMapBase > { + typedef SubMapExtender, ArcMapBase > Parent; + public: typedef V Value; - typedef SubMapExtender > Parent; explicit ArcMap(const UndirectorBase& adaptor) : Parent(adaptor) {} @@ -2163,10 +2177,10 @@ template class EdgeMap : public Digraph::template ArcMap { + typedef typename Digraph::template ArcMap Parent; + public: - typedef V Value; - typedef typename Digraph::template ArcMap Parent; explicit EdgeMap(const UndirectorBase& adaptor) : Parent(*adaptor._digraph) {} @@ -2238,10 +2252,10 @@ class Undirector : public GraphAdaptorExtender > { #endif + typedef GraphAdaptorExtender > Parent; public: /// The type of the adapted digraph. typedef DGR Digraph; - typedef GraphAdaptorExtender > Parent; protected: Undirector() { } public: @@ -2449,10 +2463,10 @@ template class NodeMap : public GR::template NodeMap { + typedef typename GR::template NodeMap Parent; + public: - typedef typename GR::template NodeMap Parent; - explicit NodeMap(const OrienterBase& adapter) : Parent(*adapter._graph) {} @@ -2474,10 +2488,10 @@ template class ArcMap : public GR::template EdgeMap { + typedef typename Graph::template EdgeMap Parent; + public: - typedef typename Graph::template EdgeMap Parent; - explicit ArcMap(const OrienterBase& adapter) : Parent(*adapter._graph) { } @@ -2546,6 +2560,7 @@ class Orienter : public DigraphAdaptorExtender > { #endif + typedef DigraphAdaptorExtender > Parent; public: /// The type of the adapted graph. @@ -2553,10 +2568,11 @@ /// The type of the direction edge map. typedef DM DirectionMap; - typedef DigraphAdaptorExtender > Parent; typedef typename Parent::Arc Arc; + protected: Orienter() { } + public: /// \brief Constructor @@ -2866,10 +2882,11 @@ template class SplitNodesBase { + typedef DigraphAdaptorBase Parent; + public: typedef DGR Digraph; - typedef DigraphAdaptorBase Parent; typedef SplitNodesBase Adaptor; typedef typename DGR::Node DigraphNode; @@ -3228,11 +3245,11 @@ template class NodeMap - : public SubMapExtender, NodeMapBase > - { + : public SubMapExtender, NodeMapBase > { + typedef SubMapExtender, NodeMapBase > Parent; + public: typedef V Value; - typedef SubMapExtender, NodeMapBase > Parent; NodeMap(const SplitNodesBase& adaptor) : Parent(adaptor) {} @@ -3254,11 +3271,11 @@ template class ArcMap - : public SubMapExtender, ArcMapBase > - { + : public SubMapExtender, ArcMapBase > { + typedef SubMapExtender, ArcMapBase > Parent; + public: typedef V Value; - typedef SubMapExtender, ArcMapBase > Parent; ArcMap(const SplitNodesBase& adaptor) : Parent(adaptor) {} @@ -3324,9 +3341,10 @@ class SplitNodes : public DigraphAdaptorExtender > { #endif + typedef DigraphAdaptorExtender > Parent; + public: typedef DGR Digraph; - typedef DigraphAdaptorExtender > Parent; typedef typename DGR::Node DigraphNode; typedef typename DGR::Arc DigraphArc;