Set dists in a bit better way.
3 #ifndef LEMON_EXTENDABLE_GRAPH_EXTENDER_H
4 #define LEMON_EXTENDABLE_GRAPH_EXTENDER_H
8 template <typename _Base>
9 class ExtendableGraphExtender : public _Base {
12 typedef ExtendableGraphExtender Graph;
15 typedef typename Parent::Node Node;
16 typedef typename Parent::Edge Edge;
19 Node node = Parent::addNode();
20 Parent::getNotifier(Node()).add(node);
24 Edge addEdge(const Node& from, const Node& to) {
25 Edge edge = Parent::addEdge(from, to);
26 Parent::getNotifier(Edge()).add(edge);
32 template <typename _Base>
33 class ExtendableUndirGraphExtender : public _Base {
36 typedef ExtendableUndirGraphExtender Graph;
39 typedef typename Parent::Node Node;
40 typedef typename Parent::Edge Edge;
41 typedef typename Parent::UndirEdge UndirEdge;
44 Node node = Parent::addNode();
45 Parent::getNotifier(Node()).add(node);
49 UndirEdge addEdge(const Node& from, const Node& to) {
50 UndirEdge uedge = Parent::addEdge(from, to);
51 Parent::getNotifier(UndirEdge()).add(uedge);
53 std::vector<Edge> edges;
54 edges.push_back(Parent::direct(uedge, true));
55 edges.push_back(Parent::direct(uedge, false));
56 Parent::getNotifier(Edge()).add(edges);