AlterationObserverRegistry -> AlterationNotifier
authordeba
Thu, 16 Dec 2004 12:44:49 +0000
changeset 1040372f08e8f403
parent 1039 bd01c5a3f989
child 1041 9d503ce002db
AlterationObserverRegistry -> AlterationNotifier
third step
src/lemon/alteration_notifier.h
src/lemon/list_graph.h
src/lemon/smart_graph.h
     1.1 --- a/src/lemon/alteration_notifier.h	Thu Dec 16 12:26:57 2004 +0000
     1.2 +++ b/src/lemon/alteration_notifier.h	Thu Dec 16 12:44:49 2004 +0000
     1.3 @@ -192,8 +192,8 @@
     1.4      /// Assign operator.
     1.5  		
     1.6      /// Assign operator for the AlterationNotifier. 
     1.7 -    /// It makes the registry only empty because the copiable
     1.8 -    /// registry's observers have to be registered still into that registry.
     1.9 +    /// It makes the notifier only empty because the copiable
    1.10 +    /// notifier's observers have to be registered still into that registry.
    1.11      AlterationNotifier& operator=(const AlterationNotifier&) {
    1.12        typename Container::iterator it;
    1.13        for (it = container.begin(); it != container.end(); ++it) {
    1.14 @@ -315,23 +315,23 @@
    1.15  
    1.16    protected:
    1.17  
    1.18 -    mutable EdgeNotifier edge_observers;
    1.19 +    mutable EdgeNotifier edge_notifier;
    1.20  
    1.21 -    mutable NodeNotifier node_observers;
    1.22 +    mutable NodeNotifier node_notifier;
    1.23  
    1.24    public:
    1.25  
    1.26      EdgeNotifier& getNotifier(Edge = INVALID) const {
    1.27 -      return edge_observers;
    1.28 +      return edge_notifier;
    1.29      }
    1.30  
    1.31      NodeNotifier& getNotifier(Node = INVALID) const {
    1.32 -      return node_observers;
    1.33 +      return node_notifier;
    1.34      }
    1.35  
    1.36      ~AlterableGraphExtender() {
    1.37 -      node_observers.clear();
    1.38 -      edge_observers.clear();
    1.39 +      node_notifier.clear();
    1.40 +      edge_notifier.clear();
    1.41      }
    1.42      
    1.43    };
    1.44 @@ -362,17 +362,17 @@
    1.45  
    1.46    protected:
    1.47  
    1.48 -    mutable UndirEdgeNotifier undir_edge_observers;
    1.49 +    mutable UndirEdgeNotifier undir_edge_notifier;
    1.50  
    1.51    public:
    1.52  
    1.53      using Parent::getNotifier;
    1.54      UndirEdgeNotifier& getNotifier(UndirEdge) const {
    1.55 -      return undir_edge_observers;
    1.56 +      return undir_edge_notifier;
    1.57      }
    1.58  
    1.59      ~AlterableUndirGraphExtender() {
    1.60 -      undir_edge_observers.clear();
    1.61 +      undir_edge_notifier.clear();
    1.62      }
    1.63    };
    1.64    
     2.1 --- a/src/lemon/list_graph.h	Thu Dec 16 12:26:57 2004 +0000
     2.2 +++ b/src/lemon/list_graph.h	Thu Dec 16 12:44:49 2004 +0000
     2.3 @@ -431,9 +431,9 @@
     2.4        void regist(ListGraph &_g) {
     2.5  	g=&_g;
     2.6  	AlterationNotifier<Node>::ObserverBase::
     2.7 -	  attach(g->node_observers);
     2.8 +	  attach(g->getNotifier(Node()));
     2.9  	AlterationNotifier<Edge>::ObserverBase::
    2.10 -	  attach(g->edge_observers);
    2.11 +	  attach(g->getNotifier(Edge()));
    2.12        }
    2.13              
    2.14        void deregist() {
     3.1 --- a/src/lemon/smart_graph.h	Thu Dec 16 12:26:57 2004 +0000
     3.2 +++ b/src/lemon/smart_graph.h	Thu Dec 16 12:44:49 2004 +0000
     3.3 @@ -267,14 +267,14 @@
     3.4      void restoreSnapShot(const SnapShot &s)
     3.5      {
     3.6        while(s.edge_num>edges.size()) {
     3.7 -	edge_observers.erase(Edge(edges.size()-1));
     3.8 +	Parent::getNotifier(Edge()).erase(Edge(edges.size()-1));
     3.9  	nodes[edges.back().target].first_in=edges.back().next_in;
    3.10  	nodes[edges.back().source].first_out=edges.back().next_out;
    3.11  	edges.pop_back();
    3.12        }
    3.13        //nodes.resize(s.nodes_num);
    3.14        while(s.node_num>nodes.size()) {
    3.15 -	node_observers.erase(Node(nodes.size()-1));
    3.16 +	Parent::getNotifier(Node()).erase(Node(nodes.size()-1));
    3.17  	nodes.pop_back();
    3.18        }
    3.19      }