Changeset 1022:567f392d1d2e in lemon-0.x for src/lemon/extendable_graph_extender.h
- Timestamp:
- 11/28/04 17:30:10 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1412
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/lemon/extendable_graph_extender.h
r980 r1022 30 30 }; 31 31 32 template <typename _Base> 33 class ExtendableUndirGraphExtender : public _Base { 34 public: 35 36 typedef ExtendableUndirGraphExtender Graph; 37 typedef _Base Parent; 38 39 typedef typename Parent::Node Node; 40 typedef typename Parent::Edge Edge; 41 typedef typename Parent::UndirEdge UndirEdge; 42 43 Node addNode() { 44 Node node = Parent::addNode(); 45 Parent::getObserverRegistry(Node()).add(node); 46 return node; 47 } 48 49 UndirEdge addEdge(const Node& from, const Node& to) { 50 UndirEdge uedge = Parent::addEdge(from, to); 51 Parent::getObserverRegistry(UndirEdge()).add(uedge); 52 53 Edge edge_forward(uedge, true); 54 Edge edge_backward(uedge, false); 55 Parent::getObserverRegistry(Edge()).add(edge_forward); 56 Parent::getObserverRegistry(Edge()).add(edge_backward); 57 58 return uedge; 59 } 60 61 }; 62 32 63 } 33 64
Note: See TracChangeset
for help on using the changeset viewer.