Changeset 6400 for code/branches/presentation2/src/libraries
- Timestamp:
- Dec 22, 2009, 10:05:38 PM (15 years ago)
- Location:
- code/branches/presentation2/src/libraries
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/core/ArgumentCompletionFunctions.cc
r6394 r6400 84 84 { 85 85 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() + '/')); 87 87 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())); 89 89 ++file; 90 90 } -
code/branches/presentation2/src/libraries/core/BaseObject.cc
r6394 r6400 291 291 std::map<std::string, EventState*>::const_iterator it = this->eventStates_.find(name); 292 292 if (it != this->eventStates_.end()) 293 return ( (*it).second);293 return (it->second); 294 294 else 295 295 return 0; -
code/branches/presentation2/src/libraries/core/ClassTreeMask.cc
r6394 r6400 850 850 // If there is a first subclass, move the object-iterator to the first object of this class. Else go to the end 851 851 if (this->subclassIterator_ != this->subclasses_.end()) 852 this->objectIterator_ = (*this->subclassIterator_).first->getObjects()->begin();852 this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin(); 853 853 else 854 854 this->objectIterator_ = ObjectList<BaseObject>::end(); 855 855 856 856 // 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))) 858 858 this->operator++(); 859 859 … … 882 882 // Check if there really is a next class. If yes, move the object-iterator to the first object 883 883 if (this->subclassIterator_ != this->subclasses_.end()) 884 this->objectIterator_ = (*this->subclassIterator_).first->getObjects()->begin();884 this->objectIterator_ = this->subclassIterator_->first->getObjects()->begin(); 885 885 else 886 886 return (*this); … … 888 888 889 889 // 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)); 891 891 } 892 892 return (*this); -
code/branches/presentation2/src/libraries/core/CommandEvaluation.cc
r6394 r6400 281 281 output += ' '; 282 282 283 output += (*it).getDisplay();283 output += it->getDisplay(); 284 284 } 285 285 return output; -
code/branches/presentation2/src/libraries/core/CommandExecutor.cc
r6394 r6400 82 82 std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_.find(name); 83 83 if (it != CommandExecutor::getInstance().consoleCommandShortcuts_.end()) 84 return (*it).second;84 return it->second; 85 85 else 86 86 return 0; … … 96 96 std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getInstance().consoleCommandShortcuts_LC_.find(name); 97 97 if (it != CommandExecutor::getInstance().consoleCommandShortcuts_LC_.end()) 98 return (*it).second;98 return it->second; 99 99 else 100 100 return 0; … … 386 386 { 387 387 // 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(); 390 390 CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation; 391 391 return; … … 471 471 if (it->second->hasConsoleCommands()) 472 472 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())); 474 474 } 475 475 … … 482 482 for (std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getLowercaseConsoleCommandShortcutMapBegin(); it != CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd(); ++it) 483 483 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())); 485 485 } 486 486 else … … 488 488 for (std::map<std::string, ConsoleCommand*>::const_iterator it = identifier->getLowercaseConsoleCommandMapBegin(); it != identifier->getLowercaseConsoleCommandMapEnd(); ++it) 489 489 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())); 491 491 } 492 492 } … … 517 517 const std::string& lowercase = getLowercase(name); 518 518 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; 521 521 522 522 return 0; … … 530 530 std::map<std::string, ConsoleCommand*>::const_iterator it = CommandExecutor::getLowercaseConsoleCommandShortcutMap().find(lowercase); 531 531 if (it != CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd()) 532 return (*it).second;532 return it->second; 533 533 } 534 534 else … … 536 536 std::map<std::string, ConsoleCommand*>::const_iterator it = identifier->getLowercaseConsoleCommandMap().find(lowercase); 537 537 if (it != identifier->getLowercaseConsoleCommandMapEnd()) 538 return (*it).second;538 return it->second; 539 539 } 540 540 return 0; … … 599 599 for (std::list<std::pair<const std::string*, const std::string*> >::const_iterator it = list.begin(); it != list.end(); ++it) 600 600 { 601 if ( (*(*it).first).size() > i)601 if (it->first->size() > i) 602 602 { 603 603 if (it == list.begin()) 604 604 { 605 temp = (* (*it).first)[i];605 temp = (*it->first)[i]; 606 606 } 607 607 else 608 608 { 609 if (temp != (* (*it).first)[i])609 if (temp != (*it->first)[i]) 610 610 return output; 611 611 } -
code/branches/presentation2/src/libraries/core/ConfigFileManager.cc
r6394 r6400 51 51 if (identifier != Identifier::getLowercaseStringIdentifierMapEnd()) 52 52 { 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); 56 56 } 57 57 return false; … … 68 68 if (identifier != Identifier::getLowercaseStringIdentifierMapEnd()) 69 69 { 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); 73 73 } 74 74 return false; … … 382 382 { 383 383 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()) 385 385 { 386 386 // The section exists, delete comment … … 389 389 for (std::list<ConfigFileEntry*>::iterator it3 = (*it1)->entries_.begin(); it3 != (*it1)->entries_.end(); ) 390 390 { 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()) 393 393 { 394 394 // The config-value exists, delete comment … … 464 464 if (it->second->hasConfigValues()) 465 465 { 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) 467 467 it2->second->update(); 468 468 -
code/branches/presentation2/src/libraries/core/Language.cc
r6394 r6400 318 318 for (std::map<std::string, LanguageEntry*>::const_iterator it = this->languageEntries_.begin(); it != this->languageEntries_.end(); ++it) 319 319 { 320 file << (*it).second->getLabel() << '=' << (*it).second->getDefault() << std::endl;320 file << it->second->getLabel() << '=' << it->second->getDefault() << std::endl; 321 321 } 322 322 -
code/branches/presentation2/src/libraries/core/Loader.cc
r6394 r6400 80 80 for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it) 81 81 { 82 if ( (*it).first == file)82 if (it->first == file) 83 83 { 84 84 Loader::files_s.erase(it); … … 92 92 bool success = true; 93 93 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)) 95 95 success = false; 96 96 … … 291 291 { 292 292 if (it != luaTags.end()) 293 end = ( *(it++)).first;293 end = (it++)->first; 294 294 else 295 295 end = std::string::npos; -
code/branches/presentation2/src/libraries/core/NamespaceNode.cc
r6394 r6400 43 43 { 44 44 for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ) 45 delete ( (*(it++)).second);45 delete (it++)->second; 46 46 } 47 47 … … 89 89 it = this->subnodes_.insert(this->subnodes_.begin(), std::pair<std::string, NamespaceNode*>(firstPart, new NamespaceNode(firstPart, this))); 90 90 91 if ( (*it).second->isHidden())91 if (it->second->isHidden()) 92 92 { 93 93 COUT(2) << "Warning: Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << std::endl; … … 96 96 else 97 97 { 98 nodes = (*it).second->getNodeRelative(secondPart);98 nodes = it->second->getNodeRelative(secondPart); 99 99 } 100 100 } … … 105 105 for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it) 106 106 { 107 if ( (*it).first.find(firstPart) == ((*it).first.size() - firstPart.size()))107 if (it->first.find(firstPart) == (it->first.size() - firstPart.size())) 108 108 { 109 std::set<NamespaceNode*> temp2 = (*it).second->getNodeRelative(secondPart);109 std::set<NamespaceNode*> temp2 = it->second->getNodeRelative(secondPart); 110 110 nodes.insert(temp2.begin(), temp2.end()); 111 111 bFoundMatchingNamespace = true; … … 133 133 { 134 134 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)) 136 136 return true; 137 137 } -
code/branches/presentation2/src/libraries/core/input/InputManager.cc
r6394 r6400 275 275 // destroy all user InputStates 276 276 while (statesByName_.size() > 0) 277 this->destroyStateInternal( (*statesByName_.rbegin()).second);277 this->destroyStateInternal(statesByName_.rbegin()->second); 278 278 279 279 if (!(internalState_ & Bad)) -
code/branches/presentation2/src/libraries/network/GamestateClient.cc
r6394 r6400 54 54 std::map<unsigned int, packet::Gamestate *>::iterator it; 55 55 for ( it = this->gamestateMap_.begin(); it != this->gamestateMap_.end(); ++it ) 56 delete (*it).second;56 delete it->second; 57 57 if( this->tempGamestate_ ) 58 58 delete this->tempGamestate_; … … 126 126 break; 127 127 // otherwise delete that stuff 128 delete (*it).second;128 delete it->second; 129 129 temp=it++; 130 130 gamestateMap_.erase(temp); -
code/branches/presentation2/src/libraries/network/GamestateManager.cc
r6388 r6400 69 69 delete this->reference;std::map<unsigned int, packet::Gamestate*>::iterator it; 70 70 for( it = gamestateQueue.begin(); it != gamestateQueue.end(); ++it ) 71 delete (*it).second;71 delete it->second; 72 72 std::map<unsigned int, std::map<unsigned int, packet::Gamestate*> >::iterator it1; 73 73 std::map<unsigned int, packet::Gamestate*>::iterator it2; … … 75 75 { 76 76 for( it2 = it1->second.begin(); it2 != it1->second.end(); ++it2 ) 77 delete (*it2).second;77 delete it2->second; 78 78 } 79 79 this->trafficControl_->destroy(); -
code/branches/presentation2/src/libraries/network/TrafficControl.cc
r6387 r6400 152 152 for(itvec = objectListTemp[gamestateID].begin(); itvec != objectListTemp[gamestateID].end(); itvec++) 153 153 { 154 if(objectListPerm.find( (*itvec).objID) != objectListPerm.end()) // check whether the obj already exists in our lists155 { 156 objectListPerm[ (*itvec).objID].objCurGS = gamestateID;157 objectListPerm[ (*itvec).objID].objValueSched = 0; //set scheduling value back154 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 158 158 } 159 159 else 160 160 { 161 161 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; 166 166 } 167 167 } … … 205 205 for(itvec = list.begin(); itvec != list.end();) 206 206 { 207 assert( (*itvec).objSize < 1000);208 if ( ( size + (*itvec).objSize ) < targetsize )209 { 210 size += (*itvec).objSize;//objSize is given in bytes207 assert( itvec->objSize < 1000); 208 if ( ( size + itvec->objSize ) < targetsize ) 209 { 210 size += itvec->objSize;//objSize is given in bytes 211 211 ++itvec; 212 212 } 213 213 else 214 214 { 215 clientListPerm_[currentClientID][ (*itvec).objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative215 clientListPerm_[currentClientID][itvec->objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative 216 216 list.erase(itvec, list.end()); 217 217 break; … … 241 241 for( itvec=list.begin(); itvec != list.end(); itvec++) 242 242 { 243 if ( objectListPerm.find( (*itvec).objID) != objectListPerm.end() )243 if ( objectListPerm.find( itvec->objID) != objectListPerm.end() ) 244 244 { 245 245 // we already have the object in our map 246 246 //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; 248 248 continue;//check next objId 249 249 } … … 289 289 COUT(0) << "=========== Objectlist ===========" << endl; 290 290 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; 292 292 } 293 293 294 294 void TrafficControl::fixCreatorDependencies(std::list<obj>::iterator it1, std::list<obj>& list, unsigned int clientID) 295 295 { 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 ) 299 299 return; 300 300 std::list<obj>::iterator it2, it3=it1; 301 301 for( it2 = ++it3; it2 != list.end(); it2++ ) 302 302 { 303 if( (*it2).objID == (*it1).objCreatorID )303 if( it2->objID == it1->objCreatorID ) 304 304 { 305 305 it3 = list.insert(it1, *it2); //insert creator before it1 -
code/branches/presentation2/src/libraries/network/packet/ClassID.cc
r6394 r6400 57 57 std::map<std::string, Identifier*>::const_iterator it = Identifier::getStringIdentifierMapBegin(); 58 58 for(;it != Identifier::getStringIdentifierMapEnd();++it){ 59 id = (*it).second;59 id = it->second; 60 60 if(id == NULL || !id->hasFactory()) 61 61 continue; -
code/branches/presentation2/src/libraries/network/packet/Gamestate.cc
r6394 r6400 534 534 SynchronisableHeader oldobjectheader(origdata); 535 535 SynchronisableHeader newobjectheader(newdata); 536 if ( (*it).objSize == 0 )536 if ( it->objSize == 0 ) 537 537 { 538 538 ++it; … … 541 541 objectsize = oldobjectheader.getDataSize(); 542 542 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() ){ 544 544 memcpy(newdata, origdata, objectsize); 545 545 assert(newobjectheader.isDataAvailable()==true); -
code/branches/presentation2/src/libraries/tools/TextureGenerator.cc
r6394 r6400 82 82 else 83 83 { 84 return (*it).second;84 return it->second; 85 85 } 86 86 } -
code/branches/presentation2/src/libraries/util/StringUtils.cc
r6394 r6400 54 54 { 55 55 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); 62 62 } 63 63
Note: See TracChangeset
for help on using the changeset viewer.