Changeset 10918 for code/branches/cpp11_v2/src/libraries/core
- Timestamp:
- Dec 5, 2015, 7:10:56 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/core
- Files:
-
- 11 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());
Note: See TracChangeset
for help on using the changeset viewer.