src/lemon/extendable_graph_extender.h
author alpar
Sat, 30 Oct 2004 18:33:14 +0000
changeset 950 d74557d1f100
child 980 0f1044b7a3af
permissions -rw-r--r--
- Changes in doc (spell check).
- SmallGraph is a class instead of being a typedef. (For the sake of doxygen.)
klao@946
     1
// -*- c++ -*-
klao@946
     2
klao@946
     3
#ifndef LEMON_EXTENDABLE_GRAPH_EXTENDER_H
klao@946
     4
#define LEMON_EXTENDABLE_GRAPH_EXTENDER_H
klao@946
     5
klao@946
     6
namespace lemon {
klao@946
     7
klao@946
     8
  template <typename _Base> 
klao@946
     9
  class ExtendableGraphExtender : public _Base {
klao@946
    10
  public:
klao@946
    11
klao@946
    12
    typedef ExtendableGraphExtender Graph;
klao@946
    13
    typedef _Base Parent;
klao@946
    14
klao@946
    15
    typedef typename Parent::Node Node;
klao@946
    16
    typedef typename Parent::Edge Edge;
klao@946
    17
klao@946
    18
    Node addNode() {
klao@946
    19
      Node node = Parent::addNode();
klao@946
    20
      Parent::getNodeObserverRegistry().add(node);
klao@946
    21
      return node;
klao@946
    22
    }
klao@946
    23
    
klao@946
    24
    Edge addEdge(const Node& from, const Node& to) {
klao@946
    25
      Edge edge = Parent::addEdge(from, to);
klao@946
    26
      Parent::getEdgeObserverRegistry().add(edge);
klao@946
    27
      return edge;
klao@946
    28
    }
klao@946
    29
klao@946
    30
  };
klao@946
    31
klao@946
    32
}
klao@946
    33
klao@946
    34
#endif