Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 29, 2013, 2:33:04 PM (11 years ago)
Author:
landauf
Message:

added proper interface (ObjectListElementRemovalListener) to notify iterators about removed elements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core6/src/libraries/core/object/IteratorBase.h

    r9598 r9599  
    4747    */
    4848    template <class T, class I>
    49     class IteratorBase
     49    class IteratorBase : public ObjectListElementRemovalListener
    5050    {
    5151        public:
     
    169169
    170170            /**
    171                 @brief Increments the Iterator if it points at the given object.
     171                @brief Increments the Iterator if it points at the given element.
    172172                @param object The object to compare with
    173173            */
    174             inline void incrementIfEqual(Listable* object)
    175             {
    176                 if (this->element_ && this->element_->objectBase_ == object)
     174            virtual void removedElement(ObjectListBaseElement* element)
     175            {
     176                if (this->element_ == element)
    177177                    this->operator++();
    178178            }
     
    194194                {
    195195                    this->list_ = this->element_->list_;
    196                     this->list_->registerIterator(this);
     196                    this->list_->registerRemovalListener(this);
    197197                }
    198198                else
     
    206206            {
    207207                if (this->list_)
    208                     this->list_->unregisterIterator(this);
     208                    this->list_->unregisterRemovalListener(this);
    209209            }
    210210
Note: See TracChangeset for help on using the changeset viewer.