Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9667 in orxonox.OLD for trunk/src/lib/lang


Ignore:
Timestamp:
Aug 21, 2006, 10:55:02 AM (18 years ago)
Author:
bensch
Message:

trunk: iterator-insertion works

Location:
trunk/src/lib/lang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/new_class_id.h

    r9666 r9667  
    2727private:
    2828  NewObjectListBase*            _objectList;
    29 
    30   std::list<NewObjectListBase::IteratorBase*>  _iterators;
     29  std::list<NewObjectListBase::IteratorBase*>  _iterators; //!< Iterators to the class-list's positions.
    3130};
    3231
  • trunk/src/lib/lang/new_object_list.h

    r9666 r9667  
    8282  {
    8383  public:
     84    Iterator(iterator it) { it = it; }
    8485    typename NewObjectList::iterator it;
    8586  };
     
    9293  inline const list&      objects() const { return _objects; };
    9394
    94   void registerObject(T* object);
     95  NewObjectListBase::IteratorBase* registerObject(T* object);
    9596  void unregisterObject(const IteratorBase& iterator);
    9697
     
    118119NewObjectList<T>::~NewObjectList()
    119120{
    120   assert(_objects.empty());
     121 // assert(_objects.empty());
    121122}
    122123
     
    132133
    133134template <class T>
    134 void NewObjectList<T>::registerObject(T* object)
     135NewObjectListBase::IteratorBase* NewObjectList<T>::registerObject(T* object)
    135136{
    136   this->_objects.push_back(object);
     137  this->_objects.push_front(object);
     138  return new Iterator(this->_objects.begin());
    137139}
    138140
Note: See TracChangeset for help on using the changeset viewer.