src/lemon/alteration_notifier.h
changeset 1288 6cc7b573b7b5
parent 1164 80bb73097736
equal deleted inserted replaced
3:b3b2c3d136e2 4:c572154cb259
    63     /// to override. The add() and erase() functions are
    63     /// to override. The add() and erase() functions are
    64     /// to notify the oberver when one item is added or
    64     /// to notify the oberver when one item is added or
    65     /// erased.
    65     /// erased.
    66     ///
    66     ///
    67     /// The build() and clear() members are to notify the observer
    67     /// The build() and clear() members are to notify the observer
    68     /// about the container is builded from an empty container or
    68     /// about the container is built from an empty container or
    69     /// is cleared to an empty container. 
    69     /// is cleared to an empty container. 
    70     /// 
    70     /// 
    71     /// \author Balazs Dezso
    71     /// \author Balazs Dezso
    72 
    72 
    73     class ObserverBase {
    73     class ObserverBase {
   144       /// the subclasses.
   144       /// the subclasses.
   145 	
   145 	
   146       virtual void erase(const Item&) = 0;
   146       virtual void erase(const Item&) = 0;
   147 
   147 
   148       /// \brief The member function to notificate the observer about the
   148       /// \brief The member function to notificate the observer about the
   149       /// container is builded.
   149       /// container is built.
   150       ///
   150       ///
   151       /// The build() member function notificates the observer about the
   151       /// The build() member function notificates the observer about the
   152       /// container is builded from an empty container. It have to be
   152       /// container is built from an empty container. It have to be
   153       /// overrided in the subclasses.
   153       /// overrided in the subclasses.
   154 
   154 
   155       virtual void build() = 0;
   155       virtual void build() = 0;
   156 
   156 
   157       /// \brief The member function to notificate the observer about all
   157       /// \brief The member function to notificate the observer about all
   251 	(*it)->erase(key);
   251 	(*it)->erase(key);
   252       }
   252       }
   253     }
   253     }
   254     
   254     
   255 
   255 
   256     /// Notifies all the registered observers about the container is builded.
   256     /// Notifies all the registered observers about the container is built.
   257 		
   257 		
   258     /// Notifies all the registered observers about the container is builded
   258     /// Notifies all the registered observers about the container is built
   259     /// from an empty container.
   259     /// from an empty container.
   260     void build() {
   260     void build() {
   261       typename Container::iterator it;
   261       typename Container::iterator it;
   262       for (it = container.begin(); it != container.end(); ++it) {
   262       for (it = container.begin(); it != container.end(); ++it) {
   263 	(*it)->build();
   263 	(*it)->build();