Changeset 1718:6a958ab38386 in lemon-0.x for lemon/bits/alteration_notifier.h
- Timestamp:
- 10/14/05 12:44:49 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2245
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/alteration_notifier.h
r1701 r1718 140 140 141 141 /// \brief The member function to notificate the observer about 142 /// simulitem is added to the container.143 /// 144 /// The add() member function notificates the observer about anitem142 /// more item is added to the container. 143 /// 144 /// The add() member function notificates the observer about more item 145 145 /// is added to the container. It have to be overrided in the 146 146 /// subclasses. … … 161 161 virtual void erase(const Item&) = 0; 162 162 163 /// \brief The member function to notificate the observer about 164 /// more item is erased from the container. 165 /// 166 /// The erase() member function notificates the observer about more item 167 /// is erased from the container. It have to be overrided in the 168 /// subclasses. 163 169 virtual void erase(const std::vector<Item>& items) { 164 170 for (int i = 0; i < (int)items.size(); ++i) { … … 166 172 } 167 173 } 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&) {} 168 190 169 191 /// \brief The member function to notificate the observer about the … … 304 326 } 305 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 } 306 353 307 354 /// \brief Notifies all the registered observers about the container is
Note: See TracChangeset
for help on using the changeset viewer.