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/network/GameStateClient.cc

    r1534 r1574  
    151151    COUT(4) << "loadSnapshot: loading gs: " << state->id << std::endl;
    152152    // get the start of the Synchronisable list
    153     orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::start();
     153    orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::begin();
    154154    syncData sync;
    155155    // loop as long as we have some data ;)
     
    236236    int offset=0, size=0;
    237237    // get total size of gamestate
    238     for(it = orxonox::ObjectList<Synchronisable>::start(); it; ++it){
     238    for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it){
    239239      if(!it->getBacksync())
    240240        continue;
     
    253253    memsize=size;
    254254    // go through all Synchronisables
    255     for(it = orxonox::ObjectList<Synchronisable>::start(); it; ++it){
     255    for(it = orxonox::ObjectList<Synchronisable>::begin(); it; ++it){
    256256      if(!it->getBacksync())
    257257        continue;
Note: See TracChangeset for help on using the changeset viewer.