Changeset 2384:805c5a2a36dd in lemon-0.x for lemon/bits/graph_extender.h
- Timestamp:
- 03/01/07 18:14:24 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3215
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/graph_extender.h
r2329 r2384 87 87 public: 88 88 89 NodeNotifier& getNotifier(Node) const {89 NodeNotifier& notifier(Node) const { 90 90 return node_notifier; 91 91 } 92 92 93 EdgeNotifier& getNotifier(Edge) const {93 EdgeNotifier& notifier(Edge) const { 94 94 return edge_notifier; 95 95 } … … 267 267 Node addNode() { 268 268 Node node = Parent::addNode(); 269 getNotifier(Node()).add(node);269 notifier(Node()).add(node); 270 270 return node; 271 271 } … … 273 273 Edge addEdge(const Node& from, const Node& to) { 274 274 Edge edge = Parent::addEdge(from, to); 275 getNotifier(Edge()).add(edge);275 notifier(Edge()).add(edge); 276 276 return edge; 277 277 } 278 278 279 279 void clear() { 280 getNotifier(Edge()).clear();281 getNotifier(Node()).clear();280 notifier(Edge()).clear(); 281 notifier(Node()).clear(); 282 282 Parent::clear(); 283 283 } … … 286 286 void build(const Graph& graph, NodeRefMap& nodeRef, EdgeRefMap& edgeRef) { 287 287 Parent::build(graph, nodeRef, edgeRef); 288 getNotifier(Node()).build();289 getNotifier(Edge()).build();288 notifier(Node()).build(); 289 notifier(Edge()).build(); 290 290 } 291 291 … … 304 304 } 305 305 306 getNotifier(Node()).erase(node);306 notifier(Node()).erase(node); 307 307 Parent::erase(node); 308 308 } 309 309 310 310 void erase(const Edge& edge) { 311 getNotifier(Edge()).erase(edge);311 notifier(Edge()).erase(edge); 312 312 Parent::erase(edge); 313 313 } … … 398 398 public: 399 399 400 NodeNotifier& getNotifier(Node) const {400 NodeNotifier& notifier(Node) const { 401 401 return node_notifier; 402 402 } 403 403 404 EdgeNotifier& getNotifier(Edge) const {404 EdgeNotifier& notifier(Edge) const { 405 405 return edge_notifier; 406 406 } 407 407 408 UEdgeNotifier& getNotifier(UEdge) const {408 UEdgeNotifier& notifier(UEdge) const { 409 409 return uedge_notifier; 410 410 } … … 673 673 Node addNode() { 674 674 Node node = Parent::addNode(); 675 getNotifier(Node()).add(node);675 notifier(Node()).add(node); 676 676 return node; 677 677 } … … 679 679 UEdge addEdge(const Node& from, const Node& to) { 680 680 UEdge uedge = Parent::addEdge(from, to); 681 getNotifier(UEdge()).add(uedge);681 notifier(UEdge()).add(uedge); 682 682 std::vector<Edge> edges; 683 683 edges.push_back(Parent::direct(uedge, true)); 684 684 edges.push_back(Parent::direct(uedge, false)); 685 getNotifier(Edge()).add(edges);685 notifier(Edge()).add(edges); 686 686 return uedge; 687 687 } 688 688 689 689 void clear() { 690 getNotifier(Edge()).clear();691 getNotifier(UEdge()).clear();692 getNotifier(Node()).clear();690 notifier(Edge()).clear(); 691 notifier(UEdge()).clear(); 692 notifier(Node()).clear(); 693 693 Parent::clear(); 694 694 } … … 698 698 UEdgeRefMap& uEdgeRef) { 699 699 Parent::build(graph, nodeRef, uEdgeRef); 700 getNotifier(Node()).build();701 getNotifier(UEdge()).build();702 getNotifier(Edge()).build();700 notifier(Node()).build(); 701 notifier(UEdge()).build(); 702 notifier(Edge()).build(); 703 703 } 704 704 … … 717 717 } 718 718 719 getNotifier(Node()).erase(node);719 notifier(Node()).erase(node); 720 720 Parent::erase(node); 721 721 } … … 725 725 edges.push_back(Parent::direct(uedge, true)); 726 726 edges.push_back(Parent::direct(uedge, false)); 727 getNotifier(Edge()).erase(edges);728 getNotifier(UEdge()).erase(uedge);727 notifier(Edge()).erase(edges); 728 notifier(UEdge()).erase(uedge); 729 729 Parent::erase(uedge); 730 730 } … … 824 824 public: 825 825 826 NodeNotifier& getNotifier(Node) const {826 NodeNotifier& notifier(Node) const { 827 827 return node_notifier; 828 828 } 829 829 830 ANodeNotifier& getNotifier(ANode) const {830 ANodeNotifier& notifier(ANode) const { 831 831 return anode_notifier; 832 832 } 833 833 834 BNodeNotifier& getNotifier(BNode) const {834 BNodeNotifier& notifier(BNode) const { 835 835 return bnode_notifier; 836 836 } 837 837 838 EdgeNotifier& getNotifier(Edge) const {838 EdgeNotifier& notifier(Edge) const { 839 839 return edge_notifier; 840 840 } 841 841 842 UEdgeNotifier& getNotifier(UEdge) const {842 UEdgeNotifier& notifier(UEdge) const { 843 843 return uedge_notifier; 844 844 } … … 1284 1284 Node addANode() { 1285 1285 Node node = Parent::addANode(); 1286 getNotifier(ANode()).add(node);1287 getNotifier(Node()).add(node);1286 notifier(ANode()).add(node); 1287 notifier(Node()).add(node); 1288 1288 return node; 1289 1289 } … … 1291 1291 Node addBNode() { 1292 1292 Node node = Parent::addBNode(); 1293 getNotifier(BNode()).add(node);1294 getNotifier(Node()).add(node);1293 notifier(BNode()).add(node); 1294 notifier(Node()).add(node); 1295 1295 return node; 1296 1296 } … … 1298 1298 UEdge addEdge(const Node& source, const Node& target) { 1299 1299 UEdge uedge = Parent::addEdge(source, target); 1300 getNotifier(UEdge()).add(uedge);1300 notifier(UEdge()).add(uedge); 1301 1301 1302 1302 std::vector<Edge> edges; 1303 1303 edges.push_back(Parent::direct(uedge, true)); 1304 1304 edges.push_back(Parent::direct(uedge, false)); 1305 getNotifier(Edge()).add(edges);1305 notifier(Edge()).add(edges); 1306 1306 1307 1307 return uedge; … … 1309 1309 1310 1310 void clear() { 1311 getNotifier(Edge()).clear();1312 getNotifier(UEdge()).clear();1313 getNotifier(Node()).clear();1314 getNotifier(BNode()).clear();1315 getNotifier(ANode()).clear();1311 notifier(Edge()).clear(); 1312 notifier(UEdge()).clear(); 1313 notifier(Node()).clear(); 1314 notifier(BNode()).clear(); 1315 notifier(ANode()).clear(); 1316 1316 Parent::clear(); 1317 1317 } … … 1322 1322 BNodeRefMap& bNodeRef, UEdgeRefMap& uEdgeRef) { 1323 1323 Parent::build(graph, aNodeRef, bNodeRef, uEdgeRef); 1324 getNotifier(ANode()).build();1325 getNotifier(BNode()).build();1326 getNotifier(Node()).build();1327 getNotifier(UEdge()).build();1328 getNotifier(Edge()).build();1324 notifier(ANode()).build(); 1325 notifier(BNode()).build(); 1326 notifier(Node()).build(); 1327 notifier(UEdge()).build(); 1328 notifier(Edge()).build(); 1329 1329 } 1330 1330 … … 1337 1337 Parent::firstFromANode(uedge, node); 1338 1338 } 1339 getNotifier(ANode()).erase(node);1339 notifier(ANode()).erase(node); 1340 1340 } else { 1341 1341 Parent::firstFromBNode(uedge, node); … … 1344 1344 Parent::firstFromBNode(uedge, node); 1345 1345 } 1346 getNotifier(BNode()).erase(node);1347 } 1348 1349 getNotifier(Node()).erase(node);1346 notifier(BNode()).erase(node); 1347 } 1348 1349 notifier(Node()).erase(node); 1350 1350 Parent::erase(node); 1351 1351 } … … 1355 1355 edges.push_back(Parent::direct(uedge, true)); 1356 1356 edges.push_back(Parent::direct(uedge, false)); 1357 getNotifier(Edge()).erase(edges);1358 getNotifier(UEdge()).erase(uedge);1357 notifier(Edge()).erase(edges); 1358 notifier(UEdge()).erase(uedge); 1359 1359 Parent::erase(uedge); 1360 1360 }
Note: See TracChangeset
for help on using the changeset viewer.