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
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/ArgumentCompletionFunctions.cc

    r6394 r6400  
    8484                {
    8585                    if (boost::filesystem::is_directory(*file))
    86                         dirlist.push_back(ArgumentCompletionListElement((*file).string() + '/', getLowercase((*file).string()) + '/', (*file).BOOST_LEAF_FUNCTION() + '/'));
     86                        dirlist.push_back(ArgumentCompletionListElement(file->string() + '/', getLowercase(file->string()) + '/', file->BOOST_LEAF_FUNCTION() + '/'));
    8787                    else
    88                         filelist.push_back(ArgumentCompletionListElement((*file).string(), getLowercase((*file).string()), (*file).BOOST_LEAF_FUNCTION()));
     88                        filelist.push_back(ArgumentCompletionListElement(file->string(), getLowercase(file->string()), file->BOOST_LEAF_FUNCTION()));
    8989                    ++file;
    9090                }
  • code/branches/presentation2/src/libraries/core/BaseObject.cc

    r6394 r6400  
    291291        std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(name);
    292292        if (it != this->eventStates_.end())
    293             return ((*it).second);
     293            return (it->second);
    294294        else
    295295            return 0;
  • code/branches/presentation2/src/libraries/core/ClassTreeMask.cc

    r6394 r6400  
    850850        // If there is a first subclass, move the object-iterator to the first object of this class. Else go to the end
    851851        if (this->subclassIterator_ != this->subclasses_.end())
    852             this->objectIterator_ = (*this->subclassIterator_).first->getObjects()->begin();
     852            this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin();
    853853        else
    854854            this->objectIterator_ = ObjectList<BaseObject>::end();
    855855
    856856        // Check if the iterator points on a valid object. If not, go to the next object by calling ++
    857         if (!this->objectIterator_ || ((*this->subclassIterator_).second && !this->objectIterator_->isExactlyA((*this->subclassIterator_).first)))
     857        if (!this->objectIterator_ || (this->subclassIterator_->second && !this->objectIterator_->isExactlyA(this->subclassIterator_->first)))
    858858            this->operator++();
    859859
     
    882882                    // Check if there really is a next class. If yes, move the object-iterator to the first object
    883883                    if (this->subclassIterator_ != this->subclasses_.end())
    884                         this->objectIterator_ = (*this->subclassIterator_).first->getObjects()->begin();
     884                        this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin();
    885885                    else
    886886                        return (*this);
     
    888888
    889889            // Repeat this until we reach a valid object or the end
    890             } while ((*this->subclassIterator_).second && !this->objectIterator_->isExactlyA((*this->subclassIterator_).first));
     890            } while (this->subclassIterator_->second && !this->objectIterator_->isExactlyA(this->subclassIterator_->first));
    891891        }
    892892        return (*this);
  • code/branches/presentation2/src/libraries/core/CommandEvaluation.cc

    r6394 r6400  
    281281                output += ' ';
    282282
    283             output += (*it).getDisplay();
     283            output += it->getDisplay();
    284284        }
    285285        return output;
  • code/branches/presentation2/src/libraries/core/CommandExecutor.cc

    r6394 r6400  
    8282        std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_.find(name);
    8383        if (it != CommandExecutor::getInstance().consoleCommandShortcuts_.end())
    84             return (*it).second;
     84            return it->second;
    8585        else
    8686            return 0;
     
    9696        std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_LC_.find(name);
    9797        if (it != CommandExecutor::getInstance().consoleCommandShortcuts_LC_.end())
    98             return (*it).second;
     98            return it->second;
    9999        else
    100100            return 0;
     
    386386                {
    387387                    // There is exactly one possible argument
    388                     CommandExecutor::getEvaluation().argument_ = (*CommandExecutor::getEvaluation().listOfPossibleArguments_.begin()).getString();
    389                     CommandExecutor::getEvaluation().possibleArgument_ = (*CommandExecutor::getEvaluation().listOfPossibleArguments_.begin()).getString();
     388                    CommandExecutor::getEvaluation().argument_ = CommandExecutor::getEvaluation().listOfPossibleArguments_.begin()->getString();
     389                    CommandExecutor::getEvaluation().possibleArgument_ = CommandExecutor::getEvaluation().listOfPossibleArguments_.begin()->getString();
    390390                    CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation;
    391391                    return;
     
    471471            if (it->second->hasConsoleCommands())
    472472                if (it->first.find(lowercase) == 0 || fragment.empty())
    473                     CommandExecutor::getEvaluation().listOfPossibleIdentifiers_.push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second->getName()));
     473                    CommandExecutor::getEvaluation().listOfPossibleIdentifiers_.push_back(std::pair<const std::string*, const std::string*>(&it->first, &it->second->getName()));
    474474    }
    475475
     
    482482            for (std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getLowercaseConsoleCommandShortcutMapBegin(); it != CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd(); ++it)
    483483                if (it->first.find(lowercase) == 0 || fragment.empty())
    484                     CommandExecutor::getEvaluation().listOfPossibleFunctions_.push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second->getName()));
     484                    CommandExecutor::getEvaluation().listOfPossibleFunctions_.push_back(std::pair<const std::string*, const std::string*>(&it->first, &it->second->getName()));
    485485        }
    486486        else
     
    488488            for (std::map<std::string, ConsoleCommand*>::const_iterator it = identifier->getLowercaseConsoleCommandMapBegin(); it != identifier->getLowercaseConsoleCommandMapEnd(); ++it)
    489489                if (it->first.find(lowercase) == 0 || fragment.empty())
    490                     CommandExecutor::getEvaluation().listOfPossibleFunctions_.push_back(std::pair<const std::string*, const std::string*>(&(*it).first, &(*it).second->getName()));
     490                    CommandExecutor::getEvaluation().listOfPossibleFunctions_.push_back(std::pair<const std::string*, const std::string*>(&it->first, &it->second->getName()));
    491491        }
    492492    }
     
    517517        const std::string& lowercase = getLowercase(name);
    518518        std::map<std::string, Identifier*>::const_iterator it = Identifier::getLowercaseStringIdentifierMap().find(lowercase);
    519         if ((it != Identifier::getLowercaseStringIdentifierMapEnd()) && (*it).second->hasConsoleCommands())
    520             return (*it).second;
     519        if ((it != Identifier::getLowercaseStringIdentifierMapEnd()) && it->second->hasConsoleCommands())
     520            return it->second;
    521521
    522522        return 0;
     
    530530            std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getLowercaseConsoleCommandShortcutMap().find(lowercase);
    531531            if (it != CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd())
    532                 return (*it).second;
     532                return it->second;
    533533        }
    534534        else
     
    536536            std::map<std::string, ConsoleCommand*>::const_iterator it = identifier->getLowercaseConsoleCommandMap().find(lowercase);
    537537            if (it != identifier->getLowercaseConsoleCommandMapEnd())
    538                 return (*it).second;
     538                return it->second;
    539539        }
    540540        return 0;
     
    599599                for (std::list<std::pair<const std::string*, const std::string*> >::const_iterator it = list.begin(); it != list.end(); ++it)
    600600                {
    601                     if ((*(*it).first).size() > i)
     601                    if (it->first->size() > i)
    602602                    {
    603603                        if (it == list.begin())
    604604                        {
    605                             temp = (*(*it).first)[i];
     605                            temp = (*it->first)[i];
    606606                        }
    607607                        else
    608608                        {
    609                             if (temp != (*(*it).first)[i])
     609                            if (temp != (*it->first)[i])
    610610                                return output;
    611611                        }
  • code/branches/presentation2/src/libraries/core/ConfigFileManager.cc

    r6394 r6400  
    5151        if (identifier != Identifier::getLowercaseStringIdentifierMapEnd())
    5252        {
    53             std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
    54             if (variable != (*identifier).second->getLowercaseConfigValueMapEnd())
    55                 return (*variable).second->set(value);
     53            std::map<std::string, ConfigValueContainer*>::const_iterator variable = identifier->second->getLowercaseConfigValueMap().find(getLowercase(varname));
     54            if (variable != identifier->second->getLowercaseConfigValueMapEnd())
     55                return variable->second->set(value);
    5656        }
    5757        return false;
     
    6868        if (identifier != Identifier::getLowercaseStringIdentifierMapEnd())
    6969        {
    70             std::map<std::string, ConfigValueContainer*>::const_iterator variable = (*identifier).second->getLowercaseConfigValueMap().find(getLowercase(varname));
    71             if (variable != (*identifier).second->getLowercaseConfigValueMapEnd())
    72                 return (*variable).second->tset(value);
     70            std::map<std::string, ConfigValueContainer*>::const_iterator variable = identifier->second->getLowercaseConfigValueMap().find(getLowercase(varname));
     71            if (variable != identifier->second->getLowercaseConfigValueMapEnd())
     72                return variable->second->tset(value);
    7373        }
    7474        return false;
     
    382382        {
    383383            std::map<std::string, Identifier*>::const_iterator it2 = Identifier::getStringIdentifierMap().find((*it1)->getName());
    384             if (it2 != Identifier::getStringIdentifierMapEnd() && (*it2).second->hasConfigValues())
     384            if (it2 != Identifier::getStringIdentifierMapEnd() && it2->second->hasConfigValues())
    385385            {
    386386                // The section exists, delete comment
     
    389389                for (std::list<ConfigFileEntry*>::iterator it3 = (*it1)->entries_.begin(); it3 != (*it1)->entries_.end(); )
    390390                {
    391                     std::map<std::string, ConfigValueContainer*>::const_iterator it4 = (*it2).second->getConfigValueMap().find((*it3)->getName());
    392                     if (it4 != (*it2).second->getConfigValueMapEnd())
     391                    std::map<std::string, ConfigValueContainer*>::const_iterator it4 = it2->second->getConfigValueMap().find((*it3)->getName());
     392                    if (it4 != it2->second->getConfigValueMapEnd())
    393393                    {
    394394                        // The config-value exists, delete comment
     
    464464                if (it->second->hasConfigValues())
    465465                {
    466                     for (std::map<std::string, ConfigValueContainer*>::const_iterator it2 = (*it).second->getConfigValueMapBegin(); it2 != (*it).second->getConfigValueMapEnd(); ++it2)
     466                    for (std::map<std::string, ConfigValueContainer*>::const_iterator it2 = it->second->getConfigValueMapBegin(); it2 != it->second->getConfigValueMapEnd(); ++it2)
    467467                        it2->second->update();
    468468
  • code/branches/presentation2/src/libraries/core/Language.cc

    r6394 r6400  
    318318        for (std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it)
    319319        {
    320             file << (*it).second->getLabel() << '=' << (*it).second->getDefault() << std::endl;
     320            file << it->second->getLabel() << '=' << it->second->getDefault() << std::endl;
    321321        }
    322322
  • code/branches/presentation2/src/libraries/core/Loader.cc

    r6394 r6400  
    8080        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
    8181        {
    82             if ((*it).first == file)
     82            if (it->first == file)
    8383            {
    8484                Loader::files_s.erase(it);
     
    9292        bool success = true;
    9393        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
    94             if (!Loader::load((*it).first, (*it).second * mask))
     94            if (!Loader::load(it->first, it->second * mask))
    9595                success = false;
    9696
     
    291291            {
    292292                if (it != luaTags.end())
    293                     end = (*(it++)).first;
     293                    end = (it++)->first;
    294294                else
    295295                    end = std::string::npos;
  • code/branches/presentation2/src/libraries/core/NamespaceNode.cc

    r6394 r6400  
    4343    {
    4444        for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); )
    45             delete ((*(it++)).second);
     45            delete (it++)->second;
    4646    }
    4747
     
    8989                    it = this->subnodes_.insert(this->subnodes_.begin(), std::pair<std::string, NamespaceNode*>(firstPart, new NamespaceNode(firstPart, this)));
    9090
    91                 if ((*it).second->isHidden())
     91                if (it->second->isHidden())
    9292                {
    9393                    COUT(2) << "Warning: Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << std::endl;
     
    9696                else
    9797                {
    98                     nodes = (*it).second->getNodeRelative(secondPart);
     98                    nodes = it->second->getNodeRelative(secondPart);
    9999                }
    100100            }
     
    105105                for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
    106106                {
    107                     if ((*it).first.find(firstPart) == ((*it).first.size() - firstPart.size()))
     107                    if (it->first.find(firstPart) == (it->first.size() - firstPart.size()))
    108108                    {
    109                         std::set<NamespaceNode*> temp2 = (*it).second->getNodeRelative(secondPart);
     109                        std::set<NamespaceNode*> temp2 = it->second->getNodeRelative(secondPart);
    110110                        nodes.insert(temp2.begin(), temp2.end());
    111111                        bFoundMatchingNamespace = true;
     
    133133        {
    134134            for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
    135                 if ((*it).second->includes(ns))
     135                if (it->second->includes(ns))
    136136                    return true;
    137137        }
  • code/branches/presentation2/src/libraries/core/input/InputManager.cc

    r6394 r6400  
    275275        // destroy all user InputStates
    276276        while (statesByName_.size() > 0)
    277             this->destroyStateInternal((*statesByName_.rbegin()).second);
     277            this->destroyStateInternal(statesByName_.rbegin()->second);
    278278
    279279        if (!(internalState_ & Bad))
  • 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);
  • code/branches/presentation2/src/libraries/tools/TextureGenerator.cc

    r6394 r6400  
    8282        else
    8383        {
    84             return (*it).second;
     84            return it->second;
    8585        }
    8686    }
  • code/branches/presentation2/src/libraries/util/StringUtils.cc

    r6394 r6400  
    5454    {
    5555        size_t pos;
    56         while ((pos = (*str).find(' ')) < (*str).length())
    57             (*str).erase(pos, 1);
    58         while ((pos = (*str).find('\t')) < (*str).length())
    59             (*str).erase(pos, 1);
    60         while ((pos = (*str).find('\n')) < (*str).length())
    61             (*str).erase(pos, 1);
     56        while ((pos = str->find(' ')) < str->length())
     57            str->erase(pos, 1);
     58        while ((pos = str->find('\t')) < str->length())
     59            str->erase(pos, 1);
     60        while ((pos = str->find('\n')) < str->length())
     61            str->erase(pos, 1);
    6262    }
    6363
Note: See TracChangeset for help on using the changeset viewer.