# HG changeset patch # User deba # Date 1095404536 0 # Node ID 66dd225ca128b04124155b3e3167240bf76f54e8 # Parent 26c573ca6a996637f56aa27a6b2e093f513b96b3 Fix maps in the GraphWrappers. diff -r 26c573ca6a99 -r 66dd225ca128 src/hugo/graph_wrapper.h --- a/src/hugo/graph_wrapper.h Thu Sep 16 20:55:01 2004 +0000 +++ b/src/hugo/graph_wrapper.h Fri Sep 17 07:02:16 2004 +0000 @@ -224,25 +224,11 @@ Edge opposite(const Edge& e) const { return Edge(graph->opposite(e)); } - template class NodeMap : public Graph::template NodeMap { - typedef typename Graph::template NodeMap Parent; - public: - NodeMap(const GraphWrapper& gw) : Parent(*(gw.graph)) { } - NodeMap(const GraphWrapper& gw, T a) : Parent(*(gw.graph), a) { } -// NodeMap(const NodeMap& map) : Parent(map) { } -// template -// NodeMap(const Map& map) : Parent(map) { } - }; - template class EdgeMap : public Graph::template EdgeMap { - typedef typename Graph::template EdgeMap Parent; - public: - EdgeMap(const GraphWrapper& gw) : Parent(*(gw.graph)) { } - EdgeMap(const GraphWrapper& gw, T a) : Parent(*(gw.graph), a) { } -// EdgeMap(const EdgeMap& map) : Parent(map) { } -// template -// EdgeMap(const Map& map) : Parent(map) { } - }; + IMPORT_NODE_MAP(Graph, *(gw.graph), GraphWrapper, gw); + IMPORT_EDGE_MAP(Graph, *(gw.graph), GraphWrapper, gw); + + }; @@ -330,6 +316,8 @@ Node head(const Edge& e) const { return GraphWrapper::tail(e); } + KEEP_MAPS(Parent, RevGraphWrapper); + }; @@ -569,6 +557,7 @@ return i; } + KEEP_MAPS(Parent, SubGraphWrapper); }; @@ -659,6 +648,9 @@ Node bNode(const OutEdgeIt& e) const { if (e.out_or_in) return this->graph->head(e); else return this->graph->tail(e); } + + KEEP_MAPS(Parent, UndirGraphWrapper); + }; /// \brief An undirected graph template. @@ -676,6 +668,8 @@ UndirGraph() : UndirGraphWrapper() { Parent::setGraph(gr); } + + KEEP_MAPS(Parent, UndirGraph); }; @@ -1108,6 +1102,10 @@ // return backward_map.get(e.in); // } }; + + + KEEP_NODE_MAP(Parent, SubBidirGraphWrapper); + }; @@ -1145,6 +1143,7 @@ int edgeNum() const { return 2*this->graph->edgeNum(); } + KEEP_MAPS(Parent, BidirGraphWrapper); }; @@ -1167,6 +1166,7 @@ BidirGraph() : BidirGraphWrapper() { Parent::setGraph(gr); } + KEEP_MAPS(Parent, BidirGraph); }; @@ -1307,6 +1307,7 @@ void update() { } }; + KEEP_MAPS(Parent, ResGraphWrapper); }; @@ -1418,6 +1419,8 @@ ++f; first_out_edges->set(n, f); } + + KEEP_MAPS(Parent, ErasingFirstGraphWrapper); }; ///@} diff -r 26c573ca6a99 -r 66dd225ca128 src/hugo/list_graph.h --- a/src/hugo/list_graph.h Thu Sep 16 20:55:01 2004 +0000 +++ b/src/hugo/list_graph.h Fri Sep 17 07:02:16 2004 +0000 @@ -882,12 +882,12 @@ class InEdgeIt; - /// Creating edge map registry. + /// Creates edge map registry. CREATE_EDGE_MAP_REGISTRY; - /// Creating edge maps. + /// Creates edge maps. CREATE_EDGE_MAP(DefaultMap); - /// Importing node maps from the NodeGraphType. + /// Imports node maps from the NodeGraphType. IMPORT_NODE_MAP(NodeGraphType, graph.G, EdgeSet, graph); diff -r 26c573ca6a99 -r 66dd225ca128 src/hugo/map_defines.h --- a/src/hugo/map_defines.h Thu Sep 16 20:55:01 2004 +0000 +++ b/src/hugo/map_defines.h Fri Sep 17 07:02:16 2004 +0000 @@ -205,12 +205,19 @@ } \ }; +#define KEEP_EDGE_MAP(From, To) \ +IMPORT_EDGE_MAP(From, graph, To, graph) + + +#define KEEP_NODE_MAP(From, To) \ +IMPORT_NODE_MAP(From, graph, To, graph) /** This is a macro to keep the node and edge maps for a graph class. */ #define KEEP_MAPS(From, To) \ -IMPORT_EDGE_MAP(From, graph, To, graph) \ -IMPORT_NODE_MAP(From, graph, To, graph) +KEEP_EDGE_MAP(From, To) \ +KEEP_NODE_MAP(From, To) + /// @}