# Changeset 1718:6a958ab38386 in lemon-0.x for lemon/bits/alteration_notifier.h

Ignore:
Timestamp:
10/14/05 12:44:49 (17 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2245
Message:

Extending observer interface
It will be used in the indegmap, outdegmap types

File:
1 edited

Unmodified
Added
Removed
• ## lemon/bits/alteration_notifier.h

 r1701 /// \brief The member function to notificate the observer about /// simulitem is added to the container. /// /// The add() member function notificates the observer about an item /// more item is added to the container. /// /// The add() member function notificates the observer about more item /// is added to the container. It have to be overrided in the /// subclasses. virtual void erase(const Item&) = 0; /// \brief The member function to notificate the observer about /// more item is erased from the container. /// /// The erase() member function notificates the observer about more item /// is erased from the container. It have to be overrided in the /// subclasses. virtual void erase(const std::vector& items) { for (int i = 0; i < (int)items.size(); ++i) { } } /// \brief Signal a property change on the given item. /// /// Signal a property change on the given item. It should /// be used always with the commitChange() function. /// This function is called always the property change. /// The commitChange() is called always after the change. virtual void signalChange(const Item&) {} /// \brief Commit the property change on the given item. /// /// Commit the property change on the given item. It should /// be used always with the signalChange() function. /// This function is called always the property change. /// The commitChange() is called always after the change. virtual void commitChange(const Item&) {} /// \brief The member function to notificate the observer about the } /// \brief Signal a property change on the given item. /// /// Signal a property change on the given item. It should /// be used always with the commitChange() function. /// This function is called always the property change. /// The commitChange() is called always after the change. void signalChange(const Item& item) { typename Container::iterator it; for (it = container.begin(); it != container.end(); ++it) { (*it)->signalChange(item); } } /// \brief Commit the property change on the given item. /// /// Commit the property change on the given item. It should /// be used always with the signalChange() function. /// This function is called always the property change. /// The commitChange() is called always after the change. void commitChange(const Item& item) { typename Container::iterator it; for (it = container.begin(); it != container.end(); ++it) { (*it)->commitChange(item); } } /// \brief Notifies all the registered observers about the container is
Note: See TracChangeset for help on using the changeset viewer.