Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 10:05:38 PM (15 years ago)
Author:
rgrieder
Message:

Replaced (*it). with it→ where I could find it. Should increased code readability.

Location:
code/branches/presentation2/src/libraries/network
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/network/GamestateClient.cc

    r6394 r6400  
    5454      std::map<unsigned int, packet::Gamestate *>::iterator it;
    5555      for ( it = this->gamestateMap_.begin(); it != this->gamestateMap_.end(); ++it )
    56           delete (*it).second;
     56          delete it->second;
    5757      if( this->tempGamestate_ )
    5858          delete this->tempGamestate_;
     
    126126        break;
    127127      // otherwise delete that stuff
    128       delete (*it).second;
     128      delete it->second;
    129129      temp=it++;
    130130      gamestateMap_.erase(temp);
  • code/branches/presentation2/src/libraries/network/GamestateManager.cc

    r6388 r6400  
    6969        delete this->reference;std::map<unsigned int, packet::Gamestate*>::iterator it;
    7070    for( it = gamestateQueue.begin(); it != gamestateQueue.end(); ++it )
    71       delete (*it).second;
     71      delete it->second;
    7272    std::map<unsigned int, std::map<unsigned int, packet::Gamestate*> >::iterator it1;
    7373    std::map<unsigned int, packet::Gamestate*>::iterator it2;
     
    7575    {
    7676      for( it2 = it1->second.begin(); it2 != it1->second.end(); ++it2 )
    77         delete (*it2).second;
     77        delete it2->second;
    7878    }
    7979    this->trafficControl_->destroy();
  • code/branches/presentation2/src/libraries/network/TrafficControl.cc

    r6387 r6400  
    152152    for(itvec = objectListTemp[gamestateID].begin(); itvec != objectListTemp[gamestateID].end(); itvec++)
    153153      {
    154       if(objectListPerm.find((*itvec).objID) != objectListPerm.end()) // check whether the obj already exists in our lists
    155       {
    156         objectListPerm[(*itvec).objID].objCurGS = gamestateID;
    157         objectListPerm[(*itvec).objID].objValueSched = 0; //set scheduling value back
     154      if(objectListPerm.find(itvec->objID) != objectListPerm.end()) // check whether the obj already exists in our lists
     155      {
     156        objectListPerm[itvec->objID].objCurGS = gamestateID;
     157        objectListPerm[itvec->objID].objValueSched = 0; //set scheduling value back
    158158      }
    159159      else
    160160      {
    161161        assert(0);
    162         objectListPerm[(*itvec).objID].objCurGS = gamestateID;
    163         objectListPerm[(*itvec).objID].objID = (*itvec).objID;
    164         objectListPerm[(*itvec).objID].objCreatorID = (*itvec).objCreatorID;
    165         objectListPerm[(*itvec).objID].objSize = (*itvec).objSize;
     162        objectListPerm[itvec->objID].objCurGS = gamestateID;
     163        objectListPerm[itvec->objID].objID = itvec->objID;
     164        objectListPerm[itvec->objID].objCreatorID = itvec->objCreatorID;
     165        objectListPerm[itvec->objID].objSize = itvec->objSize;
    166166      }
    167167      }
     
    205205    for(itvec = list.begin(); itvec != list.end();)
    206206    {
    207       assert( (*itvec).objSize < 1000);
    208       if ( ( size + (*itvec).objSize ) < targetsize )
    209       {
    210         size += (*itvec).objSize;//objSize is given in bytes
     207      assert( itvec->objSize < 1000);
     208      if ( ( size + itvec->objSize ) < targetsize )
     209      {
     210        size += itvec->objSize;//objSize is given in bytes
    211211        ++itvec;
    212212      }
    213213      else
    214214      {
    215         clientListPerm_[currentClientID][(*itvec).objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative
     215        clientListPerm_[currentClientID][itvec->objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative
    216216        list.erase(itvec, list.end());
    217217        break;
     
    241241      for( itvec=list.begin(); itvec != list.end(); itvec++)
    242242      {
    243         if ( objectListPerm.find( (*itvec).objID) != objectListPerm.end() )
     243        if ( objectListPerm.find( itvec->objID) != objectListPerm.end() )
    244244        {
    245245        // we already have the object in our map
    246246        //obj bleibt in liste und permanente prio wird berechnet
    247           objectListPerm[(*itvec).objID].objDiffGS = currentGamestateID - objectListPerm[(*itvec).objID].objCurGS;
     247          objectListPerm[itvec->objID].objDiffGS = currentGamestateID - objectListPerm[itvec->objID].objCurGS;
    248248          continue;//check next objId
    249249        }
     
    289289    COUT(0) << "=========== Objectlist ===========" << endl;
    290290    for( it=list.begin(); it!=list.end(); it++)
    291       COUT(0) << "ObjectID: " << (*it).objID << " creatorID: " << (*it).objCreatorID << " Priority: " << clientListPerm_[clientID][(*it).objID].objValuePerm + clientListPerm_[clientID][(*it).objID].objValueSched << " size: " << (*it).objSize << endl;
     291      COUT(0) << "ObjectID: " << it->objID << " creatorID: " << it->objCreatorID << " Priority: " << clientListPerm_[clientID][it->objID].objValuePerm + clientListPerm_[clientID][it->objID].objValueSched << " size: " << it->objSize << endl;
    292292  }
    293293
    294294  void TrafficControl::fixCreatorDependencies(std::list<obj>::iterator it1, std::list<obj>& list, unsigned int clientID)
    295295  {
    296     if ( (*it1).objCreatorID == OBJECTID_UNKNOWN )
    297       return;
    298     if( clientListPerm_[clientID][(*it1).objCreatorID].objCurGS != GAMESTATEID_INITIAL )
     296    if ( it1->objCreatorID == OBJECTID_UNKNOWN )
     297      return;
     298    if( clientListPerm_[clientID][it1->objCreatorID].objCurGS != GAMESTATEID_INITIAL )
    299299      return;
    300300    std::list<obj>::iterator it2, it3=it1;
    301301    for( it2 = ++it3; it2 != list.end(); it2++ )
    302302    {
    303       if( (*it2).objID == (*it1).objCreatorID )
     303      if( it2->objID == it1->objCreatorID )
    304304      {
    305305        it3 = list.insert(it1, *it2); //insert creator before it1
  • code/branches/presentation2/src/libraries/network/packet/ClassID.cc

    r6394 r6400  
    5757  std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMapBegin();
    5858  for(;it != Identifier::getStringIdentifierMapEnd();++it){
    59     id = (*it).second;
     59    id = it->second;
    6060    if(id == NULL || !id->hasFactory())
    6161      continue;
  • code/branches/presentation2/src/libraries/network/packet/Gamestate.cc

    r6394 r6400  
    534534    SynchronisableHeader oldobjectheader(origdata);
    535535    SynchronisableHeader newobjectheader(newdata);
    536     if ( (*it).objSize == 0 )
     536    if ( it->objSize == 0 )
    537537    {
    538538      ++it;
     
    541541    objectsize = oldobjectheader.getDataSize();
    542542    objectOffset=SynchronisableHeader::getSize(); //skip the size and the availableData variables in the objectheader
    543     if ( (*it).objID == oldobjectheader.getObjectID() ){
     543    if ( it->objID == oldobjectheader.getObjectID() ){
    544544      memcpy(newdata, origdata, objectsize);
    545545      assert(newobjectheader.isDataAvailable()==true);
Note: See TracChangeset for help on using the changeset viewer.