Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 26, 2007, 1:57:37 AM (16 years ago)
Author:
landauf
Message:

changed iterator: it now needs a list-element to start from (Iterator<classname> it = ObjectList<classname>::start() or end() for ++it or —it, respectively).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchie/src/ObjectList.h

    r246 r248  
    3939    // ###############################
    4040    template <class T>
     41    class Iterator;
     42
     43    template <class T>
    4144    class ObjectList
    4245    {
     
    4750            void remove(OrxonoxClass* object, bool bIterateForwards = true);
    4851
     52            inline static Iterator<T> start()
     53                { Iterator<T>(pointer_s->first_); }
     54            inline static Iterator<T> end()
     55                { Iterator<T>(pointer_s->last_); }
     56
    4957            ObjectListElement<T>* first_;
    5058            ObjectListElement<T>* last_;
     59
     60        private:
     61            static ObjectList<T>* pointer_s;
    5162    };
     63
     64    template <class T>
     65    ObjectList<T>* ObjectList<T>::pointer_s = 0;
    5266
    5367    template <class T>
     
    5670        this->first_ = 0;
    5771        this->last_ = 0;
     72
     73        this->pointer_s = this;
    5874    }
    5975
Note: See TracChangeset for help on using the changeset viewer.