COIN-OR::LEMON - Graph Library

Changeset 1039:bd01c5a3f989 in lemon-0.x


Ignore:
Timestamp:
12/16/04 13:26:57 (15 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1429
Message:

AlterationObserverRegistry? -> AlterationNotifier?
2 step

Location:
src/lemon
Files:
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • src/lemon/Makefile.am

    r980 r1039  
    1515        kruskal.h                                                       \
    1616        list_graph.h                                                    \
    17         alteration_observer_registry.h                                  \
     17        alteration_notifier.h                                  \
    1818        maps.h                                                          \
    1919        min_cost_flow.h                                                 \
  • src/lemon/alteration_notifier.h

    r1038 r1039  
    188188    /// It creates only an empty registry because the copiable
    189189    /// registry's observers have to be registered still into that registry.
    190     AlterationNotifier(const AlterationObserverRegistry&) {}
     190    AlterationNotifier(const AlterationNotifier&) {}
    191191
    192192    /// Assign operator.
     
    195195    /// It makes the registry only empty because the copiable
    196196    /// registry's observers have to be registered still into that registry.
    197     AlterationNotifier& operator=(const AlterationObserverRegistry&) {
     197    AlterationNotifier& operator=(const AlterationNotifier&) {
    198198      typename Container::iterator it;
    199199      for (it = container.begin(); it != container.end(); ++it) {
     
    309309
    310310    /// The edge observer registry.
    311     typedef AlterationNotifier<Edge> EdgeObserverRegistry;
     311    typedef AlterationNotifier<Edge> EdgeNotifier;
    312312    /// The node observer registry.
    313     typedef AlterationNotifier<Node> NodeObserverRegistry;
     313    typedef AlterationNotifier<Node> NodeNotifier;
    314314
    315315
     
    322322  public:
    323323
    324     EdgeNotifier& getObserverRegistry(Edge = INVALID) const {
     324    EdgeNotifier& getNotifier(Edge = INVALID) const {
    325325      return edge_observers;
    326326    }
    327327
    328     NodeNotifier& getObserverRegistry(Node = INVALID) const {
     328    NodeNotifier& getNotifier(Node = INVALID) const {
    329329      return node_observers;
    330330    }
     
    359359
    360360    /// The edge observer registry.
    361     typedef AlterationNotifier<UndirEdge> UndirEdgeObserverRegistry;
     361    typedef AlterationNotifier<UndirEdge> UndirEdgeNotifier;
    362362
    363363  protected:
     
    368368
    369369    using Parent::getNotifier;
    370     UndirEdgeNotifier& getObserverRegistry(UndirEdge) const {
     370    UndirEdgeNotifier& getNotifier(UndirEdge) const {
    371371      return undir_edge_observers;
    372372    }
  • src/lemon/array_map.h

    r988 r1039  
    4444            typename _ItemIt,
    4545            typename _Value>
    46   class ArrayMap : public AlterationObserverRegistry<_Item>::ObserverBase {
     46  class ArrayMap : public AlterationNotifier<_Item>::ObserverBase {
    4747
    4848  public:
     
    5353    typedef _Item Key;
    5454
    55     typedef AlterationObserverRegistry<_Item> Registry;
     55    typedef AlterationNotifier<_Item> Registry;
    5656
    5757  private:
     
    8989     */
    9090    ArrayMap(const Graph& _g) : graph(&_g) {
    91       attach(_g.getObserverRegistry(_Item()));
     91      attach(_g.getNotifier(_Item()));
    9292      allocate_memory();
    9393      for (KeyIt it(*graph); it != INVALID; ++it) {
     
    102102
    103103    ArrayMap(const Graph& _g, const Value& _v) : graph(&_g) {
    104       attach(_g.getObserverRegistry(_Item()));
     104      attach(_g.getNotifier(_Item()));
    105105      allocate_memory();
    106106      for (KeyIt it(*graph); it != INVALID; ++it) {
     
    337337    typedef typename Parent::Node Node;
    338338    typedef typename Parent::NodeIt NodeIt;
    339     typedef typename Parent::NodeObserverRegistry NodeObserverRegistry;
     339    typedef typename Parent::NodeNotifier NodeObserverRegistry;
    340340
    341341    typedef typename Parent::Edge Edge;
    342342    typedef typename Parent::EdgeIt EdgeIt;
    343     typedef typename Parent::EdgeObserverRegistry EdgeObserverRegistry;
     343    typedef typename Parent::EdgeNotifier EdgeObserverRegistry;
    344344
    345345   
  • src/lemon/clearable_graph_extender.h

    r1022 r1039  
    1919
    2020    void clear() {
    21       Parent::getObserverRegistry(Node()).clear();
    22       Parent::getObserverRegistry(Edge()).clear();
     21      Parent::getNotifier(Node()).clear();
     22      Parent::getNotifier(Edge()).clear();
    2323      Parent::clear();
    2424    }
     
    3737
    3838    void clear() {
    39       Parent::getObserverRegistry(Node()).clear();
    40       Parent::getObserverRegistry(UndirEdge()).clear();
    41       Parent::getObserverRegistry(Edge()).clear();
     39      Parent::getNotifier(Node()).clear();
     40      Parent::getNotifier(UndirEdge()).clear();
     41      Parent::getNotifier(Edge()).clear();
    4242      Parent::clear();
    4343    }
  • src/lemon/erasable_graph_extender.h

    r1022 r1039  
    3333      }
    3434
    35       Parent::getObserverRegistry(Node()).erase(node);
     35      Parent::getNotifier(Node()).erase(node);
    3636      Parent::erase(node);
    3737    }
    3838   
    3939    void erase(const Edge& edge) {
    40       Parent::getObserverRegistry(Edge()).erase(edge);
     40      Parent::getNotifier(Edge()).erase(edge);
    4141      Parent::erase(edge);
    4242    }
     
    6363      }
    6464
    65       Parent::getObserverRegistry(Node()).erase(node);
     65      Parent::getNotifier(Node()).erase(node);
    6666      Parent::erase(node);
    6767    }
    6868   
    6969    void erase(const UndirEdge& uedge) {
    70       Parent::getObserverRegistry(Edge()).erase(Edge(uedge,true));
    71       Parent::getObserverRegistry(Edge()).erase(Edge(uedge,false));
    72       Parent::getObserverRegistry(UndirEdge()).erase(uedge);
     70      Parent::getNotifier(Edge()).erase(Edge(uedge,true));
     71      Parent::getNotifier(Edge()).erase(Edge(uedge,false));
     72      Parent::getNotifier(UndirEdge()).erase(uedge);
    7373      Parent::erase(uedge);
    7474    }
  • src/lemon/extendable_graph_extender.h

    r1022 r1039  
    1818    Node addNode() {
    1919      Node node = Parent::addNode();
    20       Parent::getObserverRegistry(Node()).add(node);
     20      Parent::getNotifier(Node()).add(node);
    2121      return node;
    2222    }
     
    2424    Edge addEdge(const Node& from, const Node& to) {
    2525      Edge edge = Parent::addEdge(from, to);
    26       Parent::getObserverRegistry(Edge()).add(edge);
     26      Parent::getNotifier(Edge()).add(edge);
    2727      return edge;
    2828    }
     
    4343    Node addNode() {
    4444      Node node = Parent::addNode();
    45       Parent::getObserverRegistry(Node()).add(node);
     45      Parent::getNotifier(Node()).add(node);
    4646      return node;
    4747    }
     
    4949    UndirEdge addEdge(const Node& from, const Node& to) {
    5050      UndirEdge uedge = Parent::addEdge(from, to);
    51       Parent::getObserverRegistry(UndirEdge()).add(uedge);
     51      Parent::getNotifier(UndirEdge()).add(uedge);
    5252
    5353      Edge edge_forward(uedge, true);
    5454      Edge edge_backward(uedge, false);
    55       Parent::getObserverRegistry(Edge()).add(edge_forward);
    56       Parent::getObserverRegistry(Edge()).add(edge_backward);
     55      Parent::getNotifier(Edge()).add(edge_forward);
     56      Parent::getNotifier(Edge()).add(edge_backward);
    5757
    5858      return uedge;
  • src/lemon/full_graph.h

    r986 r1039  
    2222
    2323#include <lemon/iterable_graph_extender.h>
    24 #include <lemon/alteration_observer_registry.h>
     24#include <lemon/alteration_notifier.h>
    2525#include <lemon/default_map.h>
    2626
  • src/lemon/list_graph.h

    r1035 r1039  
    2626#include <lemon/extendable_graph_extender.h>
    2727#include <lemon/iterable_graph_extender.h>
    28 #include <lemon/alteration_observer_registry.h>
     28#include <lemon/alteration_notifier.h>
    2929#include <lemon/default_map.h>
    3030
     
    400400    ///\ingroup graphs
    401401    ///\todo \c SnapShot or \c Snapshot?
    402     class SnapShot : protected AlterationObserverRegistry<Node>::ObserverBase,
    403                      protected AlterationObserverRegistry<Edge>::ObserverBase
     402    class SnapShot : protected AlterationNotifier<Node>::ObserverBase,
     403                     protected AlterationNotifier<Edge>::ObserverBase
    404404    {
    405405      protected:
     
    431431      void regist(ListGraph &_g) {
    432432        g=&_g;
    433         AlterationObserverRegistry<Node>::ObserverBase::
     433        AlterationNotifier<Node>::ObserverBase::
    434434          attach(g->node_observers);
    435         AlterationObserverRegistry<Edge>::ObserverBase::
     435        AlterationNotifier<Edge>::ObserverBase::
    436436          attach(g->edge_observers);
    437437      }
    438438           
    439439      void deregist() {
    440         AlterationObserverRegistry<Node>::ObserverBase::
     440        AlterationNotifier<Node>::ObserverBase::
    441441          detach();
    442         AlterationObserverRegistry<Edge>::ObserverBase::
     442        AlterationNotifier<Edge>::ObserverBase::
    443443          detach();
    444444        g=0;
  • src/lemon/smart_graph.h

    r1035 r1039  
    2929#include <lemon/extendable_graph_extender.h>
    3030#include <lemon/iterable_graph_extender.h>
    31 #include <lemon/alteration_observer_registry.h>
     31#include <lemon/alteration_notifier.h>
    3232#include <lemon/default_map.h>
    3333
  • src/lemon/vector_map.h

    r987 r1039  
    2121#include <algorithm>
    2222
    23 #include <lemon/alteration_observer_registry.h>
     23#include <lemon/alteration_notifier.h>
    2424
    2525///\ingroup graphmaps
     
    3838  /// uses the std::vector to implement the container function.
    3939  ///
    40   /// \param Registry The AlterationObserverRegistry that will notify this map.
     40  /// \param Registry The AlterationNotifier that will notify this map.
    4141  /// \param IdMap The IdMap type of the graph items.
    4242  /// \param Value The value type of the map.
     
    4848            typename _Item,
    4949            typename _Value>
    50   class VectorMap : public AlterationObserverRegistry<_Item>::ObserverBase {
     50  class VectorMap : public AlterationNotifier<_Item>::ObserverBase {
    5151  public:
    5252               
     
    5656    typedef _Item Key;
    5757    /// The id map type of the map.
    58     typedef AlterationObserverRegistry<_Item> Registry;
     58    typedef AlterationNotifier<_Item> Registry;
    5959    /// The value type of the map.
    6060    typedef _Value Value;
     
    9090     
    9191    VectorMap(const Graph& _g) : graph(&_g) {
    92       attach(_g.getObserverRegistry(_Item()));
     92      attach(_g.getNotifier(_Item()));
    9393      build();
    9494    }
     
    100100     
    101101    VectorMap(const Graph& _g, const Value& _v) : graph(&_g) {
    102       attach(_g.getObserverRegistry(_Item()));
     102      attach(_g.getNotifier(_Item()));
    103103      container.resize(graph->maxId(_Item()) + 1, _v);
    104104    }
     
    225225    typedef typename Parent::NodeIt NodeIt;
    226226    typedef typename Parent::NodeIdMap NodeIdMap;
    227     typedef typename Parent::NodeObserverRegistry NodeObserverRegistry;
     227    typedef typename Parent::NodeNotifier NodeObserverRegistry;
    228228
    229229    typedef typename Parent::Edge Edge;
    230230    typedef typename Parent::EdgeIt EdgeIt;
    231231    typedef typename Parent::EdgeIdMap EdgeIdMap;
    232     typedef typename Parent::EdgeObserverRegistry EdgeObserverRegistry;
     232    typedef typename Parent::EdgeNotifier EdgeObserverRegistry;
    233233
    234234   
Note: See TracChangeset for help on using the changeset viewer.