lemon/bits/alteration_notifier.h
changeset 1740 4cade8579363
parent 1718 6a958ab38386
child 1820 22099ef840d7
equal deleted inserted replaced
4:424d7f6a9070 5:055a68c63d6d
   170 	for (int i = 0; i < (int)items.size(); ++i) {
   170 	for (int i = 0; i < (int)items.size(); ++i) {
   171 	  erase(items[i]);
   171 	  erase(items[i]);
   172 	}
   172 	}
   173       }
   173       }
   174 
   174 
   175       /// \brief Signal a property change on the given item.
       
   176       ///
       
   177       /// Signal a property change on the given item. It should
       
   178       /// be used always with the commitChange() function.
       
   179       /// This function is called always the property change.
       
   180       /// The commitChange() is called always after the change.
       
   181       virtual void signalChange(const Item&) {}
       
   182 
       
   183       /// \brief Commit the property change on the given item.
       
   184       ///
       
   185       /// Commit the property change on the given item. It should
       
   186       /// be used always with the signalChange() function.
       
   187       /// This function is called always the property change.
       
   188       /// The commitChange() is called always after the change.
       
   189       virtual void commitChange(const Item&) {}
       
   190 
       
   191       /// \brief The member function to notificate the observer about the
   175       /// \brief The member function to notificate the observer about the
   192       /// container is built.
   176       /// container is built.
   193       ///
   177       ///
   194       /// The build() member function notificates the observer about the
   178       /// The build() member function notificates the observer about the
   195       /// container is built from an empty container. It have to be
   179       /// container is built from an empty container. It have to be
   322       typename Container::iterator it;
   306       typename Container::iterator it;
   323       for (it = container.begin(); it != container.end(); ++it) {
   307       for (it = container.begin(); it != container.end(); ++it) {
   324 	(*it)->erase(items);
   308 	(*it)->erase(items);
   325       }
   309       }
   326     }
   310     }
   327     
       
   328     /// \brief Signal a property change on the given item.
       
   329     ///
       
   330     /// Signal a property change on the given item. It should
       
   331     /// be used always with the commitChange() function.
       
   332     /// This function is called always the property change.
       
   333     /// The commitChange() is called always after the change.
       
   334     void signalChange(const Item& item) {
       
   335       typename Container::iterator it;
       
   336       for (it = container.begin(); it != container.end(); ++it) {
       
   337 	(*it)->signalChange(item);
       
   338       }
       
   339     }
       
   340     
       
   341     /// \brief Commit the property change on the given item.
       
   342     ///
       
   343     /// Commit the property change on the given item. It should
       
   344     /// be used always with the signalChange() function.
       
   345     /// This function is called always the property change.
       
   346     /// The commitChange() is called always after the change.
       
   347     void commitChange(const Item& item) {
       
   348       typename Container::iterator it;
       
   349       for (it = container.begin(); it != container.end(); ++it) {
       
   350 	(*it)->commitChange(item);
       
   351       }
       
   352     }
       
   353 
   311 
   354     /// \brief Notifies all the registered observers about the container is 
   312     /// \brief Notifies all the registered observers about the container is 
   355     /// built.
   313     /// built.
   356     ///		
   314     ///		
   357     /// Notifies all the registered observers about the container is built
   315     /// Notifies all the registered observers about the container is built