src/lemon/extendable_graph_extender.h
changeset 1280 f2255b96c19c
parent 1022 567f392d1d2e
equal deleted inserted replaced
2:827750583197 3:d1f94e0527e0
    15     typedef typename Parent::Node Node;
    15     typedef typename Parent::Node Node;
    16     typedef typename Parent::Edge Edge;
    16     typedef typename Parent::Edge Edge;
    17 
    17 
    18     Node addNode() {
    18     Node addNode() {
    19       Node node = Parent::addNode();
    19       Node node = Parent::addNode();
    20       Parent::getObserverRegistry(Node()).add(node);
    20       Parent::getNotifier(Node()).add(node);
    21       return node;
    21       return node;
    22     }
    22     }
    23     
    23     
    24     Edge addEdge(const Node& from, const Node& to) {
    24     Edge addEdge(const Node& from, const Node& to) {
    25       Edge edge = Parent::addEdge(from, to);
    25       Edge edge = Parent::addEdge(from, to);
    26       Parent::getObserverRegistry(Edge()).add(edge);
    26       Parent::getNotifier(Edge()).add(edge);
    27       return edge;
    27       return edge;
    28     }
    28     }
    29 
    29 
    30   };
    30   };
    31 
    31 
    40     typedef typename Parent::Edge Edge;
    40     typedef typename Parent::Edge Edge;
    41     typedef typename Parent::UndirEdge UndirEdge;
    41     typedef typename Parent::UndirEdge UndirEdge;
    42 
    42 
    43     Node addNode() {
    43     Node addNode() {
    44       Node node = Parent::addNode();
    44       Node node = Parent::addNode();
    45       Parent::getObserverRegistry(Node()).add(node);
    45       Parent::getNotifier(Node()).add(node);
    46       return node;
    46       return node;
    47     }
    47     }
    48 
    48 
    49     UndirEdge addEdge(const Node& from, const Node& to) {
    49     UndirEdge addEdge(const Node& from, const Node& to) {
    50       UndirEdge uedge = Parent::addEdge(from, to);
    50       UndirEdge uedge = Parent::addEdge(from, to);
    51       Parent::getObserverRegistry(UndirEdge()).add(uedge);
    51       Parent::getNotifier(UndirEdge()).add(uedge);
    52 
    52 
    53       Edge edge_forward(uedge, true);
    53       Edge edge_forward(uedge, true);
    54       Edge edge_backward(uedge, false);
    54       Edge edge_backward(uedge, false);
    55       Parent::getObserverRegistry(Edge()).add(edge_forward);
    55       Parent::getNotifier(Edge()).add(edge_forward);
    56       Parent::getObserverRegistry(Edge()).add(edge_backward);
    56       Parent::getNotifier(Edge()).add(edge_backward);
    57 
    57 
    58       return uedge;
    58       return uedge;
    59     }
    59     }
    60 
    60 
    61   };
    61   };