Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 9, 2008, 4:35:38 AM (16 years ago)
Author:
landauf
Message:

big change in ObjectList: separated the class into a non-template base and a template wrapper for the base. this also changes the Iterator, there is now a non-template IteratorBase. this brings much more flexibility, like iterating through all objects of a given identifier without knowing the type. however this needs a dynamic_cast, which isn't quite optimal, but I think there are much worser things than that out there. ;)

there isn't much you have to know about this, except there is no more ObjectList<myClass>::start() function but a ObjectList<myClass>::begin() to be more STLish. another thing: ObjectList<myClass>::end() points now to the element _after_ the last element, so it's possible to iterate in a for-loop until (it != ObjectList<myClass>::end()). the reason is the same as above. however, (it) as a boolean still works perfectly fine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core3/src/core/Loader.cc

    r1505 r1574  
    3232#include "Identifier.h"
    3333#include "Iterator.h"
     34#include "ObjectList.h"
    3435#include "Debug.h"
    3536#include "CoreIncludes.h"
     
    9192    void Loader::unload(const ClassTreeMask& mask)
    9293    {
    93         for (Iterator<BaseObject> it = ObjectList<BaseObject>::begin(); it; )
     94        for (Iterator<BaseObject> it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); )
    9495        {
    9596            if (mask.isIncluded(it->getIdentifier()))
Note: See TracChangeset for help on using the changeset viewer.