Changeset 10918 for code/branches
- Timestamp:
- Dec 5, 2015, 7:10:56 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/ConfigurablePaths.cc
r10817 r10918 145 145 // Create directories to avoid problems when opening files in non existent folders. 146 146 std::vector<std::pair<bf::path, std::string>> directories; 147 directories. push_back(std::make_pair(bf::path(configPath_), std::string("config")));148 directories. push_back(std::make_pair(bf::path(logPath_), std::string("log")));147 directories.emplace_back(bf::path(configPath_), std::string("config")); 148 directories.emplace_back(bf::path(logPath_), std::string("log")); 149 149 150 150 for (std::vector<std::pair<bf::path, std::string>>::iterator it = directories.begin(); -
code/branches/cpp11_v2/src/libraries/core/Game.cc
r10916 r10918 464 464 while (pos < str.size() && str[pos] != ' ') 465 465 ++pos; 466 stateStrings. push_back(std::make_pair(str.substr(startPos, pos - startPos), indentation));466 stateStrings.emplace_back(str.substr(startPos, pos - startPos), indentation); 467 467 } 468 468 if (stateStrings.empty()) 469 469 ThrowException(GameState, "Emtpy GameState hierarchy provided, terminating."); 470 470 // Add element with large identation to detect the last with just an iterator 471 stateStrings. push_back(std::make_pair(std::string(), -1));471 stateStrings.emplace_back(std::string(), -1); 472 472 473 473 // Parse elements recursively -
code/branches/cpp11_v2/src/libraries/core/LuaState.cc
r10916 r10918 259 259 { 260 260 //Add the new line to the trace map 261 lineTrace_-> push_back(std::vector<std::pair<std::string, size_t>>());261 lineTrace_->emplace_back(); 262 262 //Add the source of the line at the end 263 lineTrace_->rbegin()-> push_back(std::make_pair(filename, line + i));263 lineTrace_->rbegin()->emplace_back(filename, line + i); 264 264 } 265 265 } -
code/branches/cpp11_v2/src/libraries/core/LuaState.h
r10771 r10918 95 95 96 96 void setTraceMap(std::shared_ptr<std::vector<std::vector<std::pair<std::string, size_t>>>> map) 97 { map-> push_back(std::vector<std::pair<std::string, size_t>>()); lineTrace_ = map; }97 { map->emplace_back(); lineTrace_ = map; } 98 98 99 99 void setIncludeParser(std::string (*function)(const std::string&)) { includeParseFunction_ = function; } -
code/branches/cpp11_v2/src/libraries/core/class/Identifier.h
r10916 r10918 363 363 364 364 // Add pointer of type T to the map in the Identifiable instance that enables "dynamic_casts" 365 object->objectPointers_. push_back(std::make_pair(this->getClassID(), static_cast<void*>(object)));365 object->objectPointers_.emplace_back(this->getClassID(), static_cast<void*>(object)); 366 366 return false; 367 367 } -
code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
r10916 r10918 102 102 for (const auto& mapEntry : commands) 103 103 if (groupIsVisible(mapEntry.second, bOnlyShowHidden) && mapEntry.first != "" && (fragmentLC == "" || getLowercase(mapEntry.first).find(fragmentLC) == 0)) 104 groupList. push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));104 groupList.emplace_back(mapEntry.first, getLowercase(mapEntry.first)); 105 105 106 106 // now add all shortcuts (in group "") … … 110 110 // add a line-break if the list isn't empty 111 111 if (!groupList.empty()) 112 groupList. push_back(ArgumentCompletionListElement("", "", "\n"));112 groupList.emplace_back("", "", "\n"); 113 113 114 114 // add the shortcuts 115 115 for (const auto& mapEntry : it_group->second) 116 116 if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(mapEntry.first).find(fragmentLC) == 0)) 117 groupList. push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));117 groupList.emplace_back(mapEntry.first, getLowercase(mapEntry.first)); 118 118 } 119 119 … … 148 148 for (const auto& mapEntry : it_group->second) 149 149 if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden) 150 commandList. push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));150 commandList.emplace_back(mapEntry.first, getLowercase(mapEntry.first)); 151 151 } 152 152 … … 188 188 { 189 189 ArgumentCompletionList list; 190 list. push_back(ArgumentCompletionListElement("", "", hint));190 list.emplace_back("", "", hint); 191 191 return list; 192 192 } … … 261 261 { 262 262 if (boost::filesystem::is_directory(*file)) 263 dirlist. push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BF_DICTIONARY_ENTRY_NAME()) + '/', file->BF_LEAF() + '/'));263 dirlist.emplace_back(file->BF_DICTIONARY_ENTRY_NAME() + '/', getLowercase(file->BF_DICTIONARY_ENTRY_NAME()) + '/', file->BF_LEAF() + '/'); 264 264 else 265 filelist. push_back(ArgumentCompletionListElement(file->BF_DICTIONARY_ENTRY_NAME(), getLowercase(file->BF_DICTIONARY_ENTRY_NAME()), file->BF_LEAF()));265 filelist.emplace_back(file->BF_DICTIONARY_ENTRY_NAME(), getLowercase(file->BF_DICTIONARY_ENTRY_NAME()), file->BF_LEAF()); 266 266 ++file; 267 267 } … … 282 282 const std::set<std::string>& names = SettingsConfigFile::getInstance().getSectionNames(); 283 283 for (const std::string& name : names) 284 sectionList. push_back(ArgumentCompletionListElement(name, getLowercase(name)));284 sectionList.emplace_back(name, getLowercase(name)); 285 285 286 286 return sectionList; … … 298 298 SettingsConfigFile::ContainerMap::const_iterator upper = settings.getContainerUpperBound(sectionLC); 299 299 for (SettingsConfigFile::ContainerMap::const_iterator it = settings.getContainerLowerBound(sectionLC); it != upper; ++it) 300 entryList. push_back(ArgumentCompletionListElement(it->second.second->getName(), it->second.first));300 entryList.emplace_back(it->second.second->getName(), it->second.first); 301 301 302 302 return entryList; … … 319 319 { 320 320 const std::string& valuestring = it->second.second->toString(); 321 oldValue. push_back(ArgumentCompletionListElement(valuestring, getLowercase(valuestring), "Old value: " + valuestring));321 oldValue.emplace_back(valuestring, getLowercase(valuestring), "Old value: " + valuestring); 322 322 } 323 323 } … … 335 335 336 336 for (std::list<unsigned int>::const_iterator it = threadnumbers.begin(); it != threadnumbers.end(); ++it) 337 threads. push_back(ArgumentCompletionListElement(multi_cast<std::string>(*it)));337 threads.emplace_back(multi_cast<std::string>(*it)); 338 338 339 339 return threads; -
code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.h
r7401 r10918 86 86 { 87 87 for (int month = 1; month <= 12; ++month) 88 list. push_back(ArgumentCompletionListElement(multi_cast<std::string>(month)));88 list.emplace_back(multi_cast<std::string>(month)); 89 89 } 90 90 else 91 91 { 92 list. push_back(ArgumentCompletionListElement("January", "january"));93 list. push_back(ArgumentCompletionListElement("February", "february"));94 list. push_back(ArgumentCompletionListElement("March", "march"));95 list. push_back(ArgumentCompletionListElement("April", "april"));96 list. push_back(ArgumentCompletionListElement("May", "may"));97 list. push_back(ArgumentCompletionListElement("June", "june"));98 list. push_back(ArgumentCompletionListElement("July", "july"));99 list. push_back(ArgumentCompletionListElement("August", "august"));100 list. push_back(ArgumentCompletionListElement("September", "september"));101 list. push_back(ArgumentCompletionListElement("October", "october"));102 list. push_back(ArgumentCompletionListElement("November", "november"));103 list. push_back(ArgumentCompletionListElement("December", "december"));92 list.emplace_back("January", "january"); 93 list.emplace_back("February", "february"); 94 list.emplace_back("March", "march"); 95 list.emplace_back("April", "april"); 96 list.emplace_back("May", "may"); 97 list.emplace_back("June", "june"); 98 list.emplace_back("July", "july"); 99 list.emplace_back("August", "august"); 100 list.emplace_back("September", "september"); 101 list.emplace_back("October", "october"); 102 list.emplace_back("November", "november"); 103 list.emplace_back("December", "december"); 104 104 } 105 105 -
code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc
r10916 r10918 84 84 this->executor_ = executor; 85 85 86 this->names_. push_back(CommandName(group, name));86 this->names_.emplace_back(group, name); 87 87 } 88 88 … … 99 99 ConsoleCommand& ConsoleCommand::addShortcut() 100 100 { 101 this->names_. push_back(CommandName("", this->baseName_));101 this->names_.emplace_back("", this->baseName_); 102 102 return *this; 103 103 } … … 108 108 ConsoleCommand& ConsoleCommand::addShortcut(const std::string& name) 109 109 { 110 this->names_. push_back(CommandName("", name));110 this->names_.emplace_back("", name); 111 111 return *this; 112 112 } … … 117 117 ConsoleCommand& ConsoleCommand::addGroup(const std::string& group) 118 118 { 119 this->names_. push_back(CommandName(group, this->baseName_));119 this->names_.emplace_back(group, this->baseName_); 120 120 return *this; 121 121 } … … 126 126 ConsoleCommand& ConsoleCommand::addGroup(const std::string& group, const std::string& name) 127 127 { 128 this->names_. push_back(CommandName(group, name));128 this->names_.emplace_back(group, name); 129 129 return *this; 130 130 } -
code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.cc
r10768 r10918 191 191 for (unsigned int i = this->valueVector_.size(); i <= index; i++) 192 192 { 193 this->valueVector_. push_back(MultiType());193 this->valueVector_.emplace_back(); 194 194 } 195 195 } -
code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.h
r10916 r10918 131 131 this->value_ = V(); 132 132 for (const D& defvalueElement : defvalue) 133 this->valueVector_. push_back(MultiType(defvalueElement));133 this->valueVector_.emplace_back(defvalueElement); 134 134 135 135 this->initVector(); -
code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc
r10916 r10918 188 188 { 189 189 while (joyStickAxes_.size() < joySticks_.size()) 190 joyStickAxes_.push_back(std:: shared_ptr<JoyStickAxisVector>(std::make_shared<JoyStickAxisVector>()));190 joyStickAxes_.push_back(std::make_shared<JoyStickAxisVector>()); 191 191 while (joyStickButtons_.size() < joySticks_.size()) 192 joyStickButtons_.push_back(std:: shared_ptr<JoyStickButtonVector>(std::make_shared<JoyStickButtonVector>()));192 joyStickButtons_.push_back(std::make_shared<JoyStickButtonVector>()); 193 193 // For the case the new size is smaller 194 194 this->joyStickAxes_.resize(joySticks_.size()); -
code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc
r10916 r10918 119 119 for( unsigned int i=0; i<this->nrOfArguments_; ++i ) 120 120 { 121 this->arguments_. push_back(MultiType());121 this->arguments_.emplace_back(); 122 122 this->arguments_.back().importData(mem); 123 123 } -
code/branches/cpp11_v2/src/libraries/network/FunctionCallManager.cc
r10769 r10918 65 65 void FunctionCallManager::bufferIncomingFunctionCall(const orxonox::FunctionCall& fctCall, uint32_t minGamestateID, uint32_t peerID) 66 66 { 67 FunctionCallManager::sIncomingFunctionCallBuffer_. push_back( std::make_pair(fctCall, std::make_pair(minGamestateID, peerID)));67 FunctionCallManager::sIncomingFunctionCallBuffer_.emplace_back(fctCall, std::make_pair(minGamestateID, peerID)); 68 68 } 69 69 -
code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc
r10768 r10918 133 133 tempsize = it->getData(mem, this->sizes_, id, mode); 134 134 if ( tempsize != 0 ) 135 dataVector_. push_back( obj(it->getObjectID(), it->getContextID(), tempsize, mem-data_));135 dataVector_.emplace_back(it->getObjectID(), it->getContextID(), tempsize, mem-data_); 136 136 137 137 #ifndef NDEBUG -
code/branches/cpp11_v2/src/libraries/tools/DebugDrawer.cc
r10916 r10918 433 433 int DebugDrawer::addLineVertex(const Ogre::Vector3& vertex, const Ogre::ColourValue& colour) 434 434 { 435 lineVertices. push_back(VertexPair(vertex, colour));435 lineVertices.emplace_back(vertex, colour); 436 436 return linesIndex++; 437 437 } … … 445 445 int DebugDrawer::addTriangleVertex(const Ogre::Vector3& vertex, const Ogre::ColourValue& colour) 446 446 { 447 triangleVertices. push_back(VertexPair(vertex, colour));447 triangleVertices.emplace_back(vertex, colour); 448 448 return trianglesIndex++; 449 449 } -
code/branches/cpp11_v2/src/libraries/tools/DynamicLines.cc
r5781 r10918 69 69 void DynamicLines::addPoint(Real x, Real y, Real z) 70 70 { 71 mPoints. push_back(Vector3(x,y,z));71 mPoints.emplace_back(x,y,z); 72 72 mDirty = true; 73 73 } -
code/branches/cpp11_v2/src/libraries/tools/IcoSphere.cc
r10916 r10918 126 126 removeLineIndices(f.v3, f.v1); 127 127 128 faces2. push_back(TriangleIndices(f.v1, a, c));129 faces2. push_back(TriangleIndices(f.v2, b, a));130 faces2. push_back(TriangleIndices(f.v3, c, b));131 faces2. push_back(TriangleIndices(a, b, c));128 faces2.emplace_back(f.v1, a, c); 129 faces2.emplace_back(f.v2, b, a); 130 faces2.emplace_back(f.v3, c, b); 131 faces2.emplace_back(a, b, c); 132 132 133 133 addTriangleLines(f.v1, a, c); … … 142 142 void IcoSphere::addLineIndices(int index0, int index1) 143 143 { 144 lineIndices. push_back(LineIndices(index0, index1));144 lineIndices.emplace_back(index0, index1); 145 145 } 146 146 … … 163 163 { 164 164 Ogre::Real length = vertex.length(); 165 vertices. push_back(Ogre::Vector3(vertex.x / length, vertex.y / length, vertex.z / length));165 vertices.emplace_back(vertex.x / length, vertex.y / length, vertex.z / length); 166 166 return index++; 167 167 } … … 188 188 void IcoSphere::addFace(int index0, int index1, int index2) 189 189 { 190 faces. push_back(TriangleIndices(index0, index1, index2));190 faces.emplace_back(index0, index1, index2); 191 191 } 192 192 … … 217 217 218 218 for (const Ogre::Vector3& vertex : vertices) 219 target-> push_back(VertexPair(transform * vertex, colour));219 target->emplace_back(transform * vertex, colour); 220 220 221 221 return vertices.size(); -
code/branches/cpp11_v2/src/libraries/util/SubString.cc
r9550 r10918 112 112 for (size_t i = 0; i < argc; ++i) 113 113 { 114 this->tokens_. push_back(std::string(argv[i]));114 this->tokens_.emplace_back(argv[i]); 115 115 this->bTokenInSafemode_.push_back(false); 116 116 } -
code/branches/cpp11_v2/src/libraries/util/output/BaseWriter.cc
r10916 r10918 47 47 this->configurableMaxLevel_ = level::none; 48 48 this->configurableAdditionalContextsMaxLevel_ = level::verbose; 49 this->configurableAdditionalContexts_. push_back("example");49 this->configurableAdditionalContexts_.emplace_back("example"); 50 50 51 51 this->changedConfigurableLevel(); -
code/branches/cpp11_v2/src/libraries/util/output/MemoryWriter.cc
r10916 r10918 57 57 void MemoryWriter::output(OutputLevel level, const OutputContextContainer& context, const std::vector<std::string>& lines) 58 58 { 59 this->messages_. push_back(Message(level, context, lines));59 this->messages_.emplace_back(level, context, lines); 60 60 } 61 61 -
code/branches/cpp11_v2/src/modules/designtools/SkyboxGenerator.cc
r10765 r10918 82 82 this->faceCounter_ = 0; 83 83 84 this->names_. push_back("fr");85 this->names_. push_back("lf");86 this->names_. push_back("bk");87 this->names_. push_back("rt");88 this->names_. push_back("up");89 this->names_. push_back("dn");90 91 this->rotations_. push_back(std::pair<int, int>(90, 0));92 this->rotations_. push_back(std::pair<int, int>(90, 0));93 this->rotations_. push_back(std::pair<int, int>(90, 0));94 this->rotations_. push_back(std::pair<int, int>(90, 90));95 this->rotations_. push_back(std::pair<int, int>(0, 180));96 this->rotations_. push_back(std::pair<int, int>(0, 90));84 this->names_.emplace_back("fr"); 85 this->names_.emplace_back("lf"); 86 this->names_.emplace_back("bk"); 87 this->names_.emplace_back("rt"); 88 this->names_.emplace_back("up"); 89 this->names_.emplace_back("dn"); 90 91 this->rotations_.emplace_back(90, 0); 92 this->rotations_.emplace_back(90, 0); 93 this->rotations_.emplace_back(90, 0); 94 this->rotations_.emplace_back(90, 90); 95 this->rotations_.emplace_back(0, 180); 96 this->rotations_.emplace_back(0, 90); 97 97 } 98 98 -
code/branches/cpp11_v2/src/modules/objects/triggers/MultiTrigger.cc
r10916 r10918 265 265 else 266 266 { 267 this->stateQueue_. push_back(std::pair<float, MultiTriggerState*>(timeRemaining-dt, state));267 this->stateQueue_.emplace_back(timeRemaining-dt, state); 268 268 this->stateQueue_.pop_front(); 269 269 } … … 489 489 490 490 // Add it ot the state queue with the delay specified for the MultiTrigger. 491 this->stateQueue_. push_back(std::pair<float, MultiTriggerState*>(this->getDelay(), state));491 this->stateQueue_.emplace_back(this->getDelay(), state); 492 492 493 493 return true; -
code/branches/cpp11_v2/src/modules/pong/PongAI.cc
r10916 r10918 362 362 // Add a new Timer 363 363 Timer* timer = new Timer(delay, false, createExecutor(createFunctor(&PongAI::delayedMove, this))); 364 this->reactionTimers_. push_back(std::pair<Timer*, char>(timer, direction));364 this->reactionTimers_.emplace_back(timer, direction); 365 365 } 366 366 else -
code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc
r10916 r10918 576 576 ALuint source = this->availableSoundSources_.back(); 577 577 this->availableSoundSources_.pop_back(); 578 this->usedSoundSources_. push_back(std::make_pair(source, object));578 this->usedSoundSources_.emplace_back(source, object); 579 579 return source; 580 580 } … … 588 588 if (alIsSource(source) && !alGetError()) 589 589 { 590 this->usedSoundSources_. push_back(std::make_pair(source, object));590 this->usedSoundSources_.emplace_back(source, object); 591 591 return source; 592 592 } -
code/branches/cpp11_v2/src/orxonox/sound/WorldAmbientSound.cc
r10624 r10918 49 49 this->ambientSound_ = new AmbientSound(); 50 50 this->registerVariables(); 51 soundList_. push_back("Earth.ogg");52 soundList_. push_back("Jupiter.ogg");53 soundList_. push_back("Mars.ogg");54 soundList_. push_back("allgorythm-lift_up.ogg");55 soundList_. push_back("allgorythm-resonance_blaster.ogg");56 soundList_. push_back("AlphaCentauri.ogg");57 soundList_. push_back("Asteroid_rocks.ogg");58 soundList_. push_back("Ganymede.ogg");59 soundList_. push_back("luke_grey_-_hypermode.ogg");51 soundList_.emplace_back("Earth.ogg"); 52 soundList_.emplace_back("Jupiter.ogg"); 53 soundList_.emplace_back("Mars.ogg"); 54 soundList_.emplace_back("allgorythm-lift_up.ogg"); 55 soundList_.emplace_back("allgorythm-resonance_blaster.ogg"); 56 soundList_.emplace_back("AlphaCentauri.ogg"); 57 soundList_.emplace_back("Asteroid_rocks.ogg"); 58 soundList_.emplace_back("Ganymede.ogg"); 59 soundList_.emplace_back("luke_grey_-_hypermode.ogg"); 60 60 61 61 }
Note: See TracChangeset
for help on using the changeset viewer.