Renaming AlterationObserverRegistry -> AlterationNotifier
authordeba
Thu, 16 Dec 2004 12:15:02 +0000
changeset 1038ca63ec3424d8
parent 1037 3eaff8d04171
child 1039 bd01c5a3f989
Renaming AlterationObserverRegistry -> AlterationNotifier
first step
src/lemon/alteration_observer_registry.h
     1.1 --- a/src/lemon/alteration_observer_registry.h	Wed Dec 15 19:56:55 2004 +0000
     1.2 +++ b/src/lemon/alteration_observer_registry.h	Thu Dec 16 12:15:02 2004 +0000
     1.3 @@ -1,5 +1,5 @@
     1.4  /* -*- C++ -*-
     1.5 - * src/lemon/observer_registry.h - Part of LEMON, a generic C++ optimization library
     1.6 + * src/lemon/notifier.h - Part of LEMON, a generic C++ optimization library
     1.7   *
     1.8   * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     1.9   * (Egervary Combinatorial Optimization Research Group, EGRES).
    1.10 @@ -36,7 +36,7 @@
    1.11    /// This class is a registry for the objects which observe the
    1.12    /// alterations in a container. The alteration observers can be attached
    1.13    /// to and detached from the registry. The observers have to inherit
    1.14 -  /// from the \ref AlterationObserverRegistry::ObserverBase and override
    1.15 +  /// from the \ref AlterationNotifier::ObserverBase and override
    1.16    /// the virtual functions in that.
    1.17    ///
    1.18    /// The most important application of the alteration observing is the
    1.19 @@ -49,7 +49,7 @@
    1.20    /// \author Balazs Dezso
    1.21  
    1.22    template <typename _Item>
    1.23 -  class AlterationObserverRegistry {
    1.24 +  class AlterationNotifier {
    1.25    public:
    1.26      typedef _Item Item;
    1.27  
    1.28 @@ -72,9 +72,9 @@
    1.29  
    1.30      class ObserverBase {
    1.31      protected:
    1.32 -      typedef AlterationObserverRegistry Registry;
    1.33 +      typedef AlterationNotifier Registry;
    1.34  
    1.35 -      friend class AlterationObserverRegistry;
    1.36 +      friend class AlterationNotifier;
    1.37  
    1.38        /// Default constructor.
    1.39  
    1.40 @@ -84,18 +84,18 @@
    1.41  
    1.42        virtual ~ObserverBase() {}
    1.43  
    1.44 -      /// Attaches the observer into an AlterationObserverRegistry.
    1.45 +      /// Attaches the observer into an AlterationNotifier.
    1.46  
    1.47 -      /// This member attaches the observer into an AlterationObserverRegistry.
    1.48 +      /// This member attaches the observer into an AlterationNotifier.
    1.49        ///
    1.50 -      void attach(AlterationObserverRegistry& r) {
    1.51 +      void attach(AlterationNotifier& r) {
    1.52  	registry = &r;
    1.53  	registry->attach(*this);
    1.54        }
    1.55  
    1.56 -      /// Detaches the observer into an AlterationObserverRegistry.
    1.57 +      /// Detaches the observer into an AlterationNotifier.
    1.58  
    1.59 -      /// This member detaches the observer from an AlterationObserverRegistry.
    1.60 +      /// This member detaches the observer from an AlterationNotifier.
    1.61        ///
    1.62        void detach() {
    1.63  	if (registry) {
    1.64 @@ -178,23 +178,23 @@
    1.65      /// Default constructor.
    1.66  	
    1.67      ///
    1.68 -    /// The default constructor of the AlterationObserverRegistry. 
    1.69 +    /// The default constructor of the AlterationNotifier. 
    1.70      /// It creates an empty registry.
    1.71 -    AlterationObserverRegistry() {}
    1.72 +    AlterationNotifier() {}
    1.73  
    1.74 -    /// Copy Constructor of the AlterationObserverRegistry. 
    1.75 +    /// Copy Constructor of the AlterationNotifier. 
    1.76  	
    1.77 -    /// Copy constructor of the AlterationObserverRegistry. 
    1.78 +    /// Copy constructor of the AlterationNotifier. 
    1.79      /// It creates only an empty registry because the copiable
    1.80      /// registry's observers have to be registered still into that registry.
    1.81 -    AlterationObserverRegistry(const AlterationObserverRegistry&) {}
    1.82 +    AlterationNotifier(const AlterationObserverRegistry&) {}
    1.83  
    1.84      /// Assign operator.
    1.85  		
    1.86 -    /// Assign operator for the AlterationObserverRegistry. 
    1.87 +    /// Assign operator for the AlterationNotifier. 
    1.88      /// It makes the registry only empty because the copiable
    1.89      /// registry's observers have to be registered still into that registry.
    1.90 -    AlterationObserverRegistry& operator=(const AlterationObserverRegistry&) {
    1.91 +    AlterationNotifier& operator=(const AlterationObserverRegistry&) {
    1.92        typename Container::iterator it;
    1.93        for (it = container.begin(); it != container.end(); ++it) {
    1.94  	(*it)->registry = 0;
    1.95 @@ -203,9 +203,9 @@
    1.96  
    1.97      /// Destructor.
    1.98  				
    1.99 -    /// Destructor of the AlterationObserverRegistry.
   1.100 +    /// Destructor of the AlterationNotifier.
   1.101      ///
   1.102 -    ~AlterationObserverRegistry() {
   1.103 +    ~AlterationNotifier() {
   1.104        typename Container::iterator it;
   1.105        for (it = container.begin(); it != container.end(); ++it) {
   1.106  	(*it)->registry = 0;
   1.107 @@ -308,24 +308,24 @@
   1.108      typedef typename Parent::Edge Edge;
   1.109  
   1.110      /// The edge observer registry.
   1.111 -    typedef AlterationObserverRegistry<Edge> EdgeObserverRegistry;
   1.112 +    typedef AlterationNotifier<Edge> EdgeObserverRegistry;
   1.113      /// The node observer registry.
   1.114 -    typedef AlterationObserverRegistry<Node> NodeObserverRegistry;
   1.115 +    typedef AlterationNotifier<Node> NodeObserverRegistry;
   1.116  
   1.117  
   1.118    protected:
   1.119  
   1.120 -    mutable EdgeObserverRegistry edge_observers;
   1.121 +    mutable EdgeNotifier edge_observers;
   1.122  
   1.123 -    mutable NodeObserverRegistry node_observers;
   1.124 +    mutable NodeNotifier node_observers;
   1.125  
   1.126    public:
   1.127  
   1.128 -    EdgeObserverRegistry& getObserverRegistry(Edge = INVALID) const {
   1.129 +    EdgeNotifier& getObserverRegistry(Edge = INVALID) const {
   1.130        return edge_observers;
   1.131      }
   1.132  
   1.133 -    NodeObserverRegistry& getObserverRegistry(Node = INVALID) const {
   1.134 +    NodeNotifier& getObserverRegistry(Node = INVALID) const {
   1.135        return node_observers;
   1.136      }
   1.137  
   1.138 @@ -358,16 +358,16 @@
   1.139      typedef typename Parent::UndirEdge UndirEdge;
   1.140  
   1.141      /// The edge observer registry.
   1.142 -    typedef AlterationObserverRegistry<UndirEdge> UndirEdgeObserverRegistry;
   1.143 +    typedef AlterationNotifier<UndirEdge> UndirEdgeObserverRegistry;
   1.144  
   1.145    protected:
   1.146  
   1.147 -    mutable UndirEdgeObserverRegistry undir_edge_observers;
   1.148 +    mutable UndirEdgeNotifier undir_edge_observers;
   1.149  
   1.150    public:
   1.151  
   1.152 -    using Parent::getObserverRegistry;
   1.153 -    UndirEdgeObserverRegistry& getObserverRegistry(UndirEdge) const {
   1.154 +    using Parent::getNotifier;
   1.155 +    UndirEdgeNotifier& getObserverRegistry(UndirEdge) const {
   1.156        return undir_edge_observers;
   1.157      }
   1.158