Changeset 877:66dd225ca128 in lemon-0.x for src/hugo
- Timestamp:
- 09/17/04 09:02:16 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1183
- Location:
- src/hugo
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/hugo/graph_wrapper.h
r876 r877 225 225 Edge opposite(const Edge& e) const { return Edge(graph->opposite(e)); } 226 226 227 template<typename T> class NodeMap : public Graph::template NodeMap<T> { 228 typedef typename Graph::template NodeMap<T> Parent; 229 public: 230 NodeMap(const GraphWrapper<Graph>& gw) : Parent(*(gw.graph)) { } 231 NodeMap(const GraphWrapper<Graph>& gw, T a) : Parent(*(gw.graph), a) { } 232 // NodeMap(const NodeMap<T>& map) : Parent(map) { } 233 // template<typename Map> 234 // NodeMap(const Map& map) : Parent(map) { } 235 }; 236 237 template<typename T> class EdgeMap : public Graph::template EdgeMap<T> { 238 typedef typename Graph::template EdgeMap<T> Parent; 239 public: 240 EdgeMap(const GraphWrapper<Graph>& gw) : Parent(*(gw.graph)) { } 241 EdgeMap(const GraphWrapper<Graph>& gw, T a) : Parent(*(gw.graph), a) { } 242 // EdgeMap(const EdgeMap<T>& map) : Parent(map) { } 243 // template<typename Map> 244 // EdgeMap(const Map& map) : Parent(map) { } 245 }; 227 228 IMPORT_NODE_MAP(Graph, *(gw.graph), GraphWrapper, gw); 229 IMPORT_EDGE_MAP(Graph, *(gw.graph), GraphWrapper, gw); 230 231 246 232 }; 247 233 … … 331 317 return GraphWrapper<Graph>::tail(e); } 332 318 319 KEEP_MAPS(Parent, RevGraphWrapper); 320 333 321 }; 334 322 … … 570 558 } 571 559 560 KEEP_MAPS(Parent, SubGraphWrapper); 572 561 }; 573 562 … … 660 649 if (e.out_or_in) return this->graph->head(e); else 661 650 return this->graph->tail(e); } 651 652 KEEP_MAPS(Parent, UndirGraphWrapper); 653 662 654 }; 663 655 … … 677 669 Parent::setGraph(gr); 678 670 } 671 672 KEEP_MAPS(Parent, UndirGraph); 679 673 }; 680 674 … … 1109 1103 // } 1110 1104 }; 1105 1106 1107 KEEP_NODE_MAP(Parent, SubBidirGraphWrapper); 1108 1111 1109 }; 1112 1110 … … 1146 1144 return 2*this->graph->edgeNum(); 1147 1145 } 1146 KEEP_MAPS(Parent, BidirGraphWrapper); 1148 1147 }; 1149 1148 … … 1168 1167 Parent::setGraph(gr); 1169 1168 } 1169 KEEP_MAPS(Parent, BidirGraph); 1170 1170 }; 1171 1171 … … 1308 1308 }; 1309 1309 1310 KEEP_MAPS(Parent, ResGraphWrapper); 1310 1311 }; 1311 1312 … … 1419 1420 first_out_edges->set(n, f); 1420 1421 } 1422 1423 KEEP_MAPS(Parent, ErasingFirstGraphWrapper); 1421 1424 }; 1422 1425 -
src/hugo/list_graph.h
r844 r877 883 883 884 884 885 /// Creat ingedge map registry.885 /// Creates edge map registry. 886 886 CREATE_EDGE_MAP_REGISTRY; 887 /// Creat ingedge maps.887 /// Creates edge maps. 888 888 CREATE_EDGE_MAP(DefaultMap); 889 889 890 /// Import ingnode maps from the NodeGraphType.890 /// Imports node maps from the NodeGraphType. 891 891 IMPORT_NODE_MAP(NodeGraphType, graph.G, EdgeSet, graph); 892 892 -
src/hugo/map_defines.h
r844 r877 206 206 }; 207 207 208 #define KEEP_EDGE_MAP(From, To) \ 209 IMPORT_EDGE_MAP(From, graph, To, graph) 210 211 212 #define KEEP_NODE_MAP(From, To) \ 213 IMPORT_NODE_MAP(From, graph, To, graph) 208 214 209 215 /** This is a macro to keep the node and edge maps for a graph class. 210 216 */ 211 217 #define KEEP_MAPS(From, To) \ 212 IMPORT_EDGE_MAP(From, graph, To, graph) \ 213 IMPORT_NODE_MAP(From, graph, To, graph) 218 KEEP_EDGE_MAP(From, To) \ 219 KEEP_NODE_MAP(From, To) 220 214 221 215 222 /// @}
Note: See TracChangeset
for help on using the changeset viewer.