Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2015, 11:22:03 PM (9 years ago)
Author:
landauf
Message:

use actual types instead of 'auto'. only exception is for complicated template types, e.g. when iterating over a map

Location:
code/branches/cpp11_v2/src/libraries
Files:
57 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/BaseObject.cc

    r10821 r10916  
    234234    {
    235235        unsigned int i = 0;
    236         for (const auto & elem : this->templates_)
     236        for (Template* temp : this->templates_)
    237237        {
    238238            if (i == index)
    239                 return (elem);
     239                return temp;
    240240            i++;
    241241        }
     
    269269    {
    270270        unsigned int i = 0;
    271         for (const auto & elem : this->eventSources_)
    272         {
    273             if (elem.second != state)
     271        for (const auto& mapEntry : this->eventSources_)
     272        {
     273            if (mapEntry.second != state)
    274274                continue;
    275275
    276276            if (i == index)
    277                 return elem.first;
     277                return mapEntry.first;
    278278            ++i;
    279279        }
     
    296296    {
    297297        unsigned int i = 0;
    298         for (const auto & elem : this->eventListenersXML_)
     298        for (BaseObject* listener : this->eventListenersXML_)
    299299        {
    300300            if (i == index)
    301                 return elem;
     301                return listener;
    302302            ++i;
    303303        }
     
    358358        Event event(activate, originator, name);
    359359
    360         for (const auto & elem : this->eventListeners_)
    361         {
    362             event.statename_ = (elem)->eventSources_[this];
    363             (elem)->processEvent(event);
     360        for (BaseObject* listener : this->eventListeners_)
     361        {
     362            event.statename_ = listener->eventSources_[this];
     363            listener->processEvent(event);
    364364        }
    365365    }
     
    370370    void BaseObject::fireEvent(Event& event)
    371371    {
    372         for (const auto & elem : this->eventListeners_)
    373             (elem)->processEvent(event);
     372        for (BaseObject* listener : this->eventListeners_)
     373            listener->processEvent(event);
    374374    }
    375375
     
    474474
    475475            // iterate through all states and get the event sources
    476             for (auto & statename : eventnames)
    477             {
    478                
    479 
     476            for (const std::string& statename : eventnames)
     477            {
    480478                // if the event state is already known, continue with the next state
    481479                orxonox::EventState* eventstate = object->getEventState(statename);
  • code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc

    r10821 r10916  
    293293        {
    294294            // No it's not: Search for classes inheriting from the given class and add the rules for them
    295             for (const auto & elem : subclass->getDirectChildren())
    296                 if ((elem)->isA(this->root_->getClass()))
    297                     if (overwrite || (!this->nodeExists(elem))) // If we don't want to overwrite, only add nodes that don't already exist
    298                         this->add(this->root_, elem, bInclude, overwrite);
     295            for (const Identifier* directChild : subclass->getDirectChildren())
     296                if (directChild->isA(this->root_->getClass()))
     297                    if (overwrite || (!this->nodeExists(directChild))) // If we don't want to overwrite, only add nodes that don't already exist
     298                        this->add(this->root_, directChild, bInclude, overwrite);
    299299        }
    300300
     
    325325        {
    326326            // Search for an already existing node, containing the subclass we want to add
    327             for (auto & elem : node->subnodes_)
     327            for (ClassTreeMaskNode* subnode : node->subnodes_)
    328328            {
    329                 if (subclass->isA((elem)->getClass()))
     329                if (subclass->isA(subnode->getClass()))
    330330                {
    331331                    // We've found an existing node -> delegate the work with a recursive function-call and return
    332                     this->add(elem, subclass, bInclude, overwrite);
     332                    this->add(subnode, subclass, bInclude, overwrite);
    333333                    return;
    334334                }
     
    392392        if (!subclass)
    393393            return;
    394         for (const auto & elem : subclass->getDirectChildren())
    395             this->add(elem, this->isIncluded(elem), false, false);
     394        for (const Identifier* directChild : subclass->getDirectChildren())
     395            this->add(directChild, this->isIncluded(directChild), false, false);
    396396
    397397        this->add(subclass, bInclude, false, clean);
     
    435435
    436436            // Go through the list of subnodes and look for a node containing the searched subclass and delegate the request by a recursive function-call.
    437             for (auto & elem : node->subnodes_)
    438                 if (subclass->isA((elem)->getClass()))
    439                     return isIncluded(elem, subclass);
     437            for (ClassTreeMaskNode* subnode : node->subnodes_)
     438                if (subclass->isA(subnode->getClass()))
     439                    return isIncluded(subnode, subclass);
    440440
    441441            // There is no subnode containing our class -> the rule of the current node takes in effect
     
    957957            // The bool is "false", meaning they have no subnodes and therefore need no further checks
    958958            if (node->isIncluded())
    959                 for (const auto & elem : directChildren)
    960                     this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(elem, false));
     959                for (const Identifier* directChild : directChildren)
     960                    this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(directChild, false));
    961961        }
    962962    }
  • code/branches/cpp11_v2/src/libraries/core/Core.cc

    r10821 r10916  
    279279
    280280        const std::vector<std::string>& modulePaths = ApplicationPaths::getInstance().getModulePaths();
    281         for (const auto & modulePath : modulePaths)
     281        for (const std::string& modulePath : modulePaths)
    282282        {
    283283            ModuleInstance* module = new ModuleInstance(modulePath);
     
    309309    void Core::unloadModules()
    310310    {
    311         for (auto module : this->modules_)
    312         {
    313            
     311        for (ModuleInstance* module : this->modules_)
     312        {
    314313            this->unloadModule(module);
    315314            delete module;
  • code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc

    r10821 r10916  
    9999        std::set<Identifier*> identifiers;
    100100        const std::set<StaticallyInitializedInstance*>& instances = module->getInstances(StaticInitialization::IDENTIFIER);
    101         for (const auto & instance : instances)
     101        for (StaticallyInitializedInstance* instance : instances)
    102102            identifiers.insert(&static_cast<StaticallyInitializedIdentifier*>(instance)->getIdentifier());
    103103
     
    106106        // that objects within one module may reference each other by strong pointers. but it is not allowed that objects from another
    107107        // module (which is not unloaded) uses strong pointers to point at objects inside the unloaded module. this will lead to a crash.
    108         for (const auto & identifier : identifiers)
    109             (identifier)->destroyObjects();
     108        for (Identifier* identifier : identifiers)
     109            identifier->destroyObjects();
    110110
    111111        // check if all objects were really destroyed. this is not the case if an object is referenced by a strong pointer from another
    112112        // module (or if two objects inside this module reference each other). this will lead to a crash and must be fixed (e.g. by
    113113        // changing object dependencies; or by changing the logic that allows modules to be unloaded).
    114         for (const auto & identifier : identifiers)
     114        for (Identifier* identifier : identifiers)
    115115        {
    116116            ObjectListBase* objectList = Context::getRootContext()->getObjectList(identifier);
    117117            if (objectList->size() > 0)
    118118            {
    119                 orxout(internal_error) << "There are still " << objectList->size() << " objects of type " << (identifier)->getName()
     119                orxout(internal_error) << "There are still " << objectList->size() << " objects of type " << identifier->getName()
    120120                    << " after unloading the Identifier. This may lead to a crash" << endl;
    121121            }
     
    123123
    124124        // destroy object-lists in all contexts
    125         for (const auto & identifier : identifiers)
     125        for (Identifier* identifier : identifiers)
    126126        {
    127127            // only do this if the Identifier is not a Context itself; otherwise we delete the list we're iterating over
    128             if (!(identifier)->isExactlyA(Class(Context)))
     128            if (!identifier->isExactlyA(Class(Context)))
    129129            {
    130130                // iterate over all contexts
    131131                for (ObjectList<Context>::iterator it_context = ObjectList<Context>::begin(); it_context != ObjectList<Context>::end(); ++it_context)
    132                     it_context->destroyObjectList((identifier));
     132                    it_context->destroyObjectList(identifier);
    133133            }
    134134        }
  • code/branches/cpp11_v2/src/libraries/core/Game.cc

    r10821 r10916  
    612612        // Check if graphics is still required
    613613        bool graphicsRequired = false;
    614         for (auto & elem : loadedStates_)
    615             graphicsRequired |= elem->getInfo().bGraphicsMode;
     614        for (const std::shared_ptr<GameState>& state : loadedStates_)
     615            graphicsRequired |= state->getInfo().bGraphicsMode;
    616616        if (!graphicsRequired)
    617617            this->unloadGraphics(!this->bAbort_); // if abort is false, that means the game is still running while unloading graphics. in this case we load a graphics manager without renderer (to keep all necessary ogre instances alive)
  • code/branches/cpp11_v2/src/libraries/core/Language.cc

    r10821 r10916  
    107107    Language::~Language()
    108108    {
    109         for (auto & elem : this->languageEntries_)
    110             delete (elem.second);
     109        for (auto& mapEntry : this->languageEntries_)
     110            delete (mapEntry.second);
    111111    }
    112112
     
    319319
    320320        // Iterate through the list an write the lines into the file
    321         for (const auto & elem : this->languageEntries_)
    322         {
    323             file << elem.second->getLabel() << '=' << elem.second->getDefault() << endl;
     321        for (const auto& mapEntry : this->languageEntries_)
     322        {
     323            file << mapEntry.second->getLabel() << '=' << mapEntry.second->getDefault() << endl;
    324324        }
    325325
  • code/branches/cpp11_v2/src/libraries/core/Loader.cc

    r10821 r10916  
    165165                        std::ostringstream message;
    166166                        message << "Possible sources of error:" << endl;
    167                         for (auto & linesource : linesources)
     167                        for (const std::pair<std::string, size_t>& pair : linesources)
    168168                        {
    169                             message << linesource.first << ", Line " << linesource.second << endl;
     169                            message << pair.first << ", Line " << pair.second << endl;
    170170                        }
    171171                        orxout(user_error, context::loader) << message.str() << endl;
     
    261261        {
    262262            bool expectedValue = true;
    263             for (auto & luaTag : luaTags)
    264             {
    265                 if (luaTag.second == expectedValue)
     263            for (auto& mapEntry : luaTags)
     264            {
     265                if (mapEntry.second == expectedValue)
    266266                    expectedValue = !expectedValue;
    267267                else
  • code/branches/cpp11_v2/src/libraries/core/LuaState.cc

    r10852 r10916  
    326326    /*static*/ bool LuaState::addToluaInterface(int (*function)(lua_State*), const std::string& name)
    327327    {
    328         for (const auto & interface : getToluaInterfaces())
    329         {
    330             if (interface.first == name || interface.second == function)
     328        for (const auto& mapEntry : getToluaInterfaces())
     329        {
     330            if (mapEntry.first == name || mapEntry.second == function)
    331331            {
    332332                orxout(internal_warning, context::lua) << "Trying to add a Tolua interface with the same name or function." << endl;
     
    337337
    338338        // Open interface in all LuaStates
    339         for (const auto & state : getInstances())
     339        for (LuaState* state : getInstances())
    340340            (*function)(state->luaState_);
    341341
     
    354354
    355355        // Close interface in all LuaStates
    356         for (const auto & state : getInstances())
     356        for (LuaState* state : getInstances())
    357357        {
    358358            lua_pushnil(state->luaState_);
     
    369369    /*static*/ void LuaState::openToluaInterfaces(lua_State* state)
    370370    {
    371         for (const auto & interface : getToluaInterfaces())
    372             (interface.second)(state);
     371        for (const auto& mapEntry : getToluaInterfaces())
     372            (mapEntry.second)(state);
    373373    }
    374374
    375375    /*static*/ void LuaState::closeToluaInterfaces(lua_State* state)
    376376    {
    377         for (const auto & interface : getToluaInterfaces())
     377        for (const auto& mapEntry : getToluaInterfaces())
    378378        {
    379379            lua_pushnil(state);
    380             lua_setglobal(state, interface.first.c_str());
     380            lua_setglobal(state, mapEntry.first.c_str());
    381381        }
    382382    }
  • code/branches/cpp11_v2/src/libraries/core/Namespace.cc

    r10821 r10916  
    5353    {
    5454        if (this->bRoot_)
    55             for (auto & elem : this->representingNamespaces_)
    56                 delete elem;
     55            for (NamespaceNode* node : this->representingNamespaces_)
     56                delete node;
    5757    }
    5858
     
    8080            for (unsigned int i = 0; i < tokens.size(); i++)
    8181            {
    82                 for (auto & elem : this->getNamespace()->representingNamespaces_)
     82                for (NamespaceNode* node : this->getNamespace()->representingNamespaces_)
    8383                {
    84                     std::set<NamespaceNode*> temp = elem->getNodeRelative(tokens[i]);
     84                    std::set<NamespaceNode*> temp = node->getNodeRelative(tokens[i]);
    8585                    this->representingNamespaces_.insert(temp.begin(), temp.end());
    8686                }
     
    9393        if (this->bAutogeneratedFileRootNamespace_)
    9494        {
    95             for (auto & elem : this->representingNamespaces_)
     95            for (NamespaceNode* node : this->representingNamespaces_)
    9696            {
    97                 elem->setRoot(true);
    98                 elem->setHidden(true);
     97                node->setRoot(true);
     98                node->setHidden(true);
    9999            }
    100100        }
     
    114114    bool Namespace::includes(const Namespace* ns) const
    115115    {
    116         for (const auto & elem1 : this->representingNamespaces_)
     116        for (NamespaceNode* node1 : this->representingNamespaces_)
    117117        {
    118             for (const auto & elem2 : ns->representingNamespaces_)
     118            for (NamespaceNode* node2 : ns->representingNamespaces_)
    119119            {
    120                 if (elem1->includes(elem2))
     120                if (node1->includes(node2))
    121121                {
    122122                    if (this->operator_ == "or")
     
    149149
    150150        int i = 0;
    151         for (const auto & elem : this->representingNamespaces_)
     151        for (NamespaceNode* node : this->representingNamespaces_)
    152152        {
    153153            if (i > 0)
    154154                output += " / ";
    155155
    156             output += elem->toString();
     156            output += node->toString();
    157157            i++;
    158158        }
     
    166166
    167167        int i = 0;
    168         for (const auto & elem : this->representingNamespaces_)
     168        for (NamespaceNode* node : this->representingNamespaces_)
    169169        {
    170170            if (i > 0)
    171171                output += '\n';
    172172
    173             output += elem->toString(indentation);
     173            output += node->toString(indentation);
    174174            i++;
    175175        }
  • code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc

    r10821 r10916  
    103103                bool bFoundMatchingNamespace = false;
    104104
    105                 for (auto & elem : this->subnodes_)
     105                for (auto& mapEntry : this->subnodes_)
    106106                {
    107                     if (elem.first.find(firstPart) == (elem.first.size() - firstPart.size()))
     107                    if (mapEntry.first.find(firstPart) == (mapEntry.first.size() - firstPart.size()))
    108108                    {
    109                         std::set<NamespaceNode*> temp2 = elem.second->getNodeRelative(secondPart);
     109                        std::set<NamespaceNode*> temp2 = mapEntry.second->getNodeRelative(secondPart);
    110110                        nodes.insert(temp2.begin(), temp2.end());
    111111                        bFoundMatchingNamespace = true;
     
    132132        else
    133133        {
    134             for (const auto & elem : this->subnodes_)
    135                 if (elem.second->includes(ns))
     134            for (const auto& mapEntry : this->subnodes_)
     135                if (mapEntry.second->includes(ns))
    136136                    return true;
    137137        }
     
    167167        std::string output = (indentation + this->name_ + '\n');
    168168
    169         for (const auto & elem : this->subnodes_)
    170             output += elem.second->toString(indentation + "  ");
     169        for (const auto& mapEntry : this->subnodes_)
     170            output += mapEntry.second->toString(indentation + "  ");
    171171
    172172        return output;
  • code/branches/cpp11_v2/src/libraries/core/Resource.cc

    r10821 r10916  
    5858        DataStreamListPtr resources(new Ogre::DataStreamList());
    5959        const Ogre::StringVector& groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
    60         for (const auto & group : groups)
     60        for (const std::string& group : groups)
    6161        {
    6262            DataStreamListPtr temp = Ogre::ResourceGroupManager::getSingleton().openResources(pattern, group);
     
    121121        StringVectorPtr resourceNames(new Ogre::StringVector());
    122122        const Ogre::StringVector& groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
    123         for (const auto & group : groups)
     123        for (const std::string& group : groups)
    124124        {
    125125            StringVectorPtr temp = Ogre::ResourceGroupManager::getSingleton().findResourceNames(group, pattern);
  • code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc

    r10821 r10916  
    8787        for (std::list<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
    8888            const_cast<Identifier*>(*it)->directChildren_.erase(this);
    89         for (const auto & elem : this->children_)
    90             const_cast<Identifier*>(elem)->parents_.remove(this);
    91         for (const auto & elem : this->directChildren_)
    92             const_cast<Identifier*>(elem)->directParents_.remove(this);
    93 
    94         for (auto & elem : this->configValues_)
    95             delete (elem.second);
    96         for (auto & elem : this->xmlportParamContainers_)
    97             delete (elem.second);
    98         for (auto & elem : this->xmlportObjectContainers_)
    99             delete (elem.second);
     89        for (const Identifier* child : this->children_)
     90            const_cast<Identifier*>(child)->parents_.remove(this);
     91        for (const Identifier* directChild : this->directChildren_)
     92            const_cast<Identifier*>(directChild)->directParents_.remove(this);
     93
     94        for (auto& mapEntry : this->configValues_)
     95            delete (mapEntry.second);
     96        for (auto& mapEntry : this->xmlportParamContainers_)
     97            delete (mapEntry.second);
     98        for (auto& mapEntry : this->xmlportObjectContainers_)
     99            delete (mapEntry.second);
    100100    }
    101101
     
    157157        if (this->directParents_.empty())
    158158        {
    159             for (const auto & elem : initializationTrace)
    160                 if (elem != this)
    161                     this->parents_.push_back(elem);
     159            for (const Identifier* identifier : initializationTrace)
     160                if (identifier != this)
     161                    this->parents_.push_back(identifier);
    162162        }
    163163        else
     
    261261
    262262        // if any parent class is virtual, it will be instantiated first, so we need to add them first.
    263         for (const auto & elem : this->parents_)
    264         {
    265             if ((elem)->isVirtualBase())
     263        for (const Identifier* parent : this->parents_)
     264        {
     265            if (parent->isVirtualBase())
    266266            {
    267                 for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(elem)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(elem)->parents_.end(); ++it_parent_parent)
     267                for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(parent)->parents_.end(); ++it_parent_parent)
    268268                    this->addIfNotExists(expectedIdentifierTrace, *it_parent_parent);
    269                 this->addIfNotExists(expectedIdentifierTrace, elem);
     269                this->addIfNotExists(expectedIdentifierTrace, parent);
    270270            }
    271271        }
    272272
    273273        // now all direct parents get created recursively. already added identifiers (e.g. virtual base classes) are not added again.
    274         for (const auto & elem : this->directParents_)
    275         {
    276             for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(elem)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(elem)->parents_.end(); ++it_parent_parent)
     274        for (const Identifier* directParent : this->directParents_)
     275        {
     276            for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(directParent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(directParent)->parents_.end(); ++it_parent_parent)
    277277                this->addIfNotExists(expectedIdentifierTrace, *it_parent_parent);
    278             this->addIfNotExists(expectedIdentifierTrace, elem);
     278            this->addIfNotExists(expectedIdentifierTrace, directParent);
    279279        }
    280280
     
    285285
    286286            orxout(internal_warning) << "  Actual trace (after creating a sample instance):" << endl << "    ";
    287             for (const auto & elem : this->parents_)
    288                 orxout(internal_warning) << " " << (elem)->getName();
     287            for (const Identifier* parent : this->parents_)
     288                orxout(internal_warning) << " " << parent->getName();
    289289            orxout(internal_warning) << endl;
    290290
     
    295295
    296296            orxout(internal_warning) << "  Direct parents (according to class hierarchy definitions):" << endl << "    ";
    297             for (const auto & elem : this->directParents_)
    298                 orxout(internal_warning) << " " << (elem)->getName();
     297            for (const Identifier* directParent : this->directParents_)
     298                orxout(internal_warning) << " " << directParent->getName();
    299299            orxout(internal_warning) << endl;
    300300        }
  • code/branches/cpp11_v2/src/libraries/core/class/Identifier.h

    r10821 r10916  
    462462
    463463        if (updateChildren)
    464             for (const auto & elem : this->getChildren())
    465                 (elem)->updateConfigValues(false);
     464            for (const Identifier* child : this->getChildren())
     465                child->updateConfigValues(false);
    466466    }
    467467
  • code/branches/cpp11_v2/src/libraries/core/class/IdentifierManager.cc

    r10821 r10916  
    9393        {
    9494            Context temporaryContext(nullptr);
    95             for (auto identifier : this->identifiers_)
     95            for (Identifier* identifier : this->identifiers_)
    9696            {
    97                
    9897                if (identifier->isInitialized())
    9998                    continue;
     
    127126
    128127        // finish the initialization of all identifiers
    129         for (const auto & initializedIdentifier : initializedIdentifiers)
    130             (initializedIdentifier)->finishInitialization();
     128        for (Identifier* initializedIdentifier : initializedIdentifiers)
     129            initializedIdentifier->finishInitialization();
    131130
    132131        // only check class hierarchy in dev mode because it's an expensive operation and it requires a developer to fix detected problems anyway.
     
    144143    {
    145144        // check if there are any uninitialized identifiers remaining
    146         for (const auto & elem : this->identifiers_)
    147             if (!(elem)->isInitialized())
    148                 orxout(internal_error) << "Identifier was registered late and is not initialized: " << (elem)->getName() << " / " << (elem)->getTypeInfo().name() << endl;
     145        for (Identifier* identifier : this->identifiers_)
     146            if (!identifier->isInitialized())
     147                orxout(internal_error) << "Identifier was registered late and is not initialized: " << identifier->getName() << " / " << identifier->getTypeInfo().name() << endl;
    149148
    150149        // for all initialized identifiers, check if a sample instance behaves as expected according to the class hierarchy
    151150        Context temporaryContext(nullptr);
    152         for (const auto & initializedIdentifier : initializedIdentifiers)
     151        for (Identifier* initializedIdentifier : initializedIdentifiers)
    153152        {
    154             if (!(initializedIdentifier)->hasFactory())
     153            if (!initializedIdentifier->hasFactory())
    155154                continue;
    156155
    157             Identifiable* temp = (initializedIdentifier)->fabricate(&temporaryContext);
    158 
    159             for (const auto & elem : this->identifiers_)
     156            Identifiable* temp = initializedIdentifier->fabricate(&temporaryContext);
     157
     158            for (Identifier* identifier : this->identifiers_)
    160159            {
    161                 bool isA_AccordingToRtti = (elem)->canDynamicCastObjectToIdentifierClass(temp);
    162                 bool isA_AccordingToClassHierarchy = temp->isA((elem));
     160                bool isA_AccordingToRtti = identifier->canDynamicCastObjectToIdentifierClass(temp);
     161                bool isA_AccordingToClassHierarchy = temp->isA(identifier);
    163162
    164163                if (isA_AccordingToRtti != isA_AccordingToClassHierarchy)
    165164                {
    166                     orxout(internal_error) << "Class hierarchy does not match RTTI: Class hierarchy claims that " << (initializedIdentifier)->getName() <<
    167                         (isA_AccordingToClassHierarchy ? " is a " : " is not a ") << (elem)->getName() << " but RTTI says the opposite." << endl;
     165                    orxout(internal_error) << "Class hierarchy does not match RTTI: Class hierarchy claims that " << initializedIdentifier->getName() <<
     166                        (isA_AccordingToClassHierarchy ? " is a " : " is not a ") << identifier->getName() << " but RTTI says the opposite." << endl;
    168167                }
    169168            }
     
    184183    {
    185184        orxout(internal_status) << "Destroy class-hierarchy" << endl;
    186         for (const auto & elem : this->identifiers_)
    187             (elem)->reset();
     185        for (Identifier* identifier : this->identifiers_)
     186            identifier->reset();
    188187    }
    189188
     
    260259    {
    261260        // TODO: use std::type_index and a map to find identifiers by type_info (only with c++11)
    262         for (const auto & elem : this->identifiers_)
    263             if ((elem)->getTypeInfo() == typeInfo)
    264                 return (elem);
     261        for (Identifier* identifer : this->identifiers_)
     262            if (identifer->getTypeInfo() == typeInfo)
     263                return identifer;
    265264        return nullptr;
    266265    }
  • code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc

    r10821 r10916  
    7777            bool groupIsVisible(const std::map<std::string, ConsoleCommand*>& group, bool bOnlyShowHidden)
    7878            {
    79                 for (const auto & elem : group)
    80                     if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden)
     79                for (const auto& mapEntry : group)
     80                    if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden)
    8181                        return true;
    8282
     
    100100                // get all the groups that are visible (except the shortcut group "")
    101101                const std::map<std::string, std::map<std::string, ConsoleCommand*>>& commands = ConsoleCommandManager::getInstance().getCommands();
    102                 for (const auto & command : commands)
    103                     if (groupIsVisible(command.second, bOnlyShowHidden) && command.first != "" && (fragmentLC == "" || getLowercase(command.first).find(fragmentLC) == 0))
    104                         groupList.push_back(ArgumentCompletionListElement(command.first, getLowercase(command.first)));
     102                for (const auto& mapEntry : commands)
     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)));
    105105
    106106                // now add all shortcuts (in group "")
     
    113113
    114114                    // add the shortcuts
    115                     for (const auto & elem : it_group->second)
    116                         if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden && (fragmentLC == "" || getLowercase(elem.first).find(fragmentLC) == 0))
    117                             groupList.push_back(ArgumentCompletionListElement(elem.first, getLowercase(elem.first)));
     115                    for (const auto& mapEntry : it_group->second)
     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)));
    118118                }
    119119
     
    146146                if (it_group != ConsoleCommandManager::getInstance().getCommands().end())
    147147                {
    148                     for (const auto & elem : it_group->second)
    149                         if (elem.second->isActive() && elem.second->hasAccess() && (!elem.second->isHidden())^bOnlyShowHidden)
    150                             commandList.push_back(ArgumentCompletionListElement(elem.first, getLowercase(elem.first)));
     148                    for (const auto& mapEntry : it_group->second)
     149                        if (mapEntry.second->isActive() && mapEntry.second->hasAccess() && (!mapEntry.second->isHidden())^bOnlyShowHidden)
     150                            commandList.push_back(ArgumentCompletionListElement(mapEntry.first, getLowercase(mapEntry.first)));
    151151                }
    152152
     
    281281
    282282            const std::set<std::string>& names = SettingsConfigFile::getInstance().getSectionNames();
    283             for (const auto & name : names)
     283            for (const std::string& name : names)
    284284                sectionList.push_back(ArgumentCompletionListElement(name, getLowercase(name)));
    285285
  • code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc

    r10821 r10916  
    306306                // the user typed 1-2 arguments, check what he tried to type and print a suitable error
    307307                std::string groupLC = getLowercase(this->getToken(0));
    308                 for (const auto & elem : ConsoleCommandManager::getInstance().getCommandsLC())
    309                     if (elem.first == groupLC)
     308                for (const auto& mapEntry : ConsoleCommandManager::getInstance().getCommandsLC())
     309                    if (mapEntry.first == groupLC)
    310310                        return std::string("Error: There is no command in group \"") + this->getToken(0) + "\" starting with \"" + this->getToken(1) + "\".";
    311311
     
    328328
    329329        // iterate through all groups and their commands and calculate the distance to the current command. keep the best.
    330         for (const auto & elem : ConsoleCommandManager::getInstance().getCommandsLC())
    331         {
    332             if (elem.first != "")
    333             {
    334                 for (std::map<std::string, ConsoleCommand*>::const_iterator it_name = elem.second.begin(); it_name != elem.second.end(); ++it_name)
    335                 {
    336                     std::string command = elem.first + " " + it_name->first;
     330        for (const auto& mapEntry : ConsoleCommandManager::getInstance().getCommandsLC())
     331        {
     332            if (mapEntry.first != "")
     333            {
     334                for (std::map<std::string, ConsoleCommand*>::const_iterator it_name = mapEntry.second.begin(); it_name != mapEntry.second.end(); ++it_name)
     335                {
     336                    std::string command = mapEntry.first + " " + it_name->first;
    337337                    unsigned int distance = getLevenshteinDistance(command, token0_LC + " " + token1_LC);
    338338                    if (distance < nearestDistance)
     
    349349        if (it_group !=  ConsoleCommandManager::getInstance().getCommandsLC().end())
    350350        {
    351             for (const auto & elem : it_group->second)
    352             {
    353                 std::string command = elem.first;
     351            for (const auto& mapEntry : it_group->second)
     352            {
     353                std::string command = mapEntry.first;
    354354                unsigned int distance = getLevenshteinDistance(command, token0_LC);
    355355                if (distance < nearestDistance)
     
    429429    {
    430430        size_t count = 0;
    431         for (const auto & elem : list)
    432             if (elem.getComparable() != "")
     431        for (const ArgumentCompletionListElement& element : list)
     432            if (element.getComparable() != "")
    433433                ++count;
    434434        return count;
     
    495495        {
    496496            // only one (non-empty) value in the list - search it and return it
    497             for (const auto & elem : list)
    498             {
    499                 if (elem.getComparable() != "")
     497            for (const ArgumentCompletionListElement& element : list)
     498            {
     499                if (element.getComparable() != "")
    500500                {
    501501                    // arguments that have a separate string to be displayed need a little more care - just return them without modification. add a space character to the others.
    502                     if (elem.hasDisplay())
    503                         return (elem.getString());
     502                    if (element.hasDisplay())
     503                        return (element.getString());
    504504                    else
    505                         return (elem.getString() + ' ');
     505                        return (element.getString() + ' ');
    506506                }
    507507            }
     
    517517                char tempComparable = '\0';
    518518                char temp = '\0';
    519                 for (const auto & elem : list)
    520                 {
    521                     const std::string& argumentComparable = elem.getComparable();
    522                     const std::string& argument = elem.getString();
     519                for (const ArgumentCompletionListElement& element : list)
     520                {
     521                    const std::string& argumentComparable = element.getComparable();
     522                    const std::string& argument = element.getString();
    523523
    524524                    // ignore empty arguments
     
    560560    {
    561561        std::string output;
    562         for (const auto & elem : list)
    563         {
    564             output += elem.getDisplay();
     562        for (const ArgumentCompletionListElement& element : list)
     563        {
     564            output += element.getDisplay();
    565565
    566566            // add a space character between two elements for all non-empty arguments
    567             if (elem.getComparable() != "")
     567            if (element.getComparable() != "")
    568568                output += ' ';
    569569        }
  • code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.cc

    r10825 r10916  
    7575        this->baseFunctor_ = executor->getFunctor();
    7676
    77         for (auto & elem : this->argumentCompleter_)
    78             elem = nullptr;
     77        for (ArgumentCompleter*& completer : this->argumentCompleter_)
     78            completer = nullptr;
    7979
    8080        this->keybindMode_ = KeybindMode::OnPress;
  • code/branches/cpp11_v2/src/libraries/core/command/Shell.cc

    r10821 r10916  
    258258        vectorize(text, '\n', &lines);
    259259
    260         for (auto & line : lines)
     260        for (const std::string& line : lines)
    261261            this->addLine(line, type);
    262262    }
  • code/branches/cpp11_v2/src/libraries/core/command/TclThreadList.h

    r10821 r10916  
    262262        boost::shared_lock<boost::shared_mutex> lock(this->mutex_);
    263263
    264         for (const auto & elem : this->list_)
    265             if (elem == value)
     264        for (const T& element : this->list_)
     265            if (element == value)
    266266                return true;
    267267
  • code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc

    r10821 r10916  
    551551
    552552        std::list<unsigned int> threads;
    553         for (const auto & elem : this->interpreterBundles_)
    554             if (elem.first > 0 && elem.first <= this->numInterpreterBundles_) // only list autonumbered interpreters (created with create()) - exclude the default interpreter 0 and all manually numbered interpreters)
    555                 threads.push_back(elem.first);
     553        for (const auto& mapEntry : this->interpreterBundles_)
     554            if (mapEntry.first > 0 && mapEntry.first <= this->numInterpreterBundles_) // only list autonumbered interpreters (created with create()) - exclude the default interpreter 0 and all manually numbered interpreters)
     555                threads.push_back(mapEntry.first);
    556556        return threads;
    557557    }
  • code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc

    r10821 r10916  
    124124            std::string shortcut;
    125125            std::string value;
    126             for (auto & argument : arguments)
     126            for (const std::string& argument : arguments)
    127127            {
    128128                if (argument.size() != 0)
  • code/branches/cpp11_v2/src/libraries/core/config/ConfigFile.cc

    r10821 r10916  
    234234        }
    235235
    236         for (const auto & elem : this->sections_)
    237         {
    238             file << (elem)->getFileEntry() << endl;
    239 
    240             for (std::list<ConfigFileEntry*>::const_iterator it_entries = (elem)->getEntriesBegin(); it_entries != (elem)->getEntriesEnd(); ++it_entries)
     236        for (ConfigFileSection* section : this->sections_)
     237        {
     238            file << section->getFileEntry() << endl;
     239
     240            for (std::list<ConfigFileEntry*>::const_iterator it_entries = section->getEntriesBegin(); it_entries != section->getEntriesEnd(); ++it_entries)
    241241                file << (*it_entries)->getFileEntry() << endl;
    242242
     
    278278        @brief Returns a pointer to the section with given name (or nullptr if the section doesn't exist).
    279279    */
    280     ConfigFileSection* ConfigFile::getSection(const std::string& section) const
    281     {
    282         for (const auto & elem : this->sections_)
    283             if ((elem)->getName() == section)
    284                 return (elem);
     280    ConfigFileSection* ConfigFile::getSection(const std::string& sectionName) const
     281    {
     282        for (ConfigFileSection* section : this->sections_)
     283            if (section->getName() == sectionName)
     284                return section;
    285285        return nullptr;
    286286    }
     
    289289        @brief Returns a pointer to the section with given name. If it doesn't exist, the section is created.
    290290    */
    291     ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& section)
    292     {
    293         for (auto & elem : this->sections_)
    294             if ((elem)->getName() == section)
    295                 return (elem);
     291    ConfigFileSection* ConfigFile::getOrCreateSection(const std::string& sectionName)
     292    {
     293        for (ConfigFileSection* section : this->sections_)
     294            if (section->getName() == sectionName)
     295                return section;
    296296
    297297        this->bUpdated_ = true;
    298298
    299         return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(section)));
     299        return (*this->sections_.insert(this->sections_.end(), new ConfigFileSection(sectionName)));
    300300    }
    301301
     
    307307        bool sectionsUpdated = false;
    308308
    309         for (auto & elem : this->sections_)
    310         {
    311             if ((elem)->bUpdated_)
     309        for (ConfigFileSection* section : this->sections_)
     310        {
     311            if (section->bUpdated_)
    312312            {
    313313                sectionsUpdated = true;
    314                 (elem)->bUpdated_ = false;
     314                section->bUpdated_ = false;
    315315            }
    316316        }
  • code/branches/cpp11_v2/src/libraries/core/config/ConfigFileManager.cc

    r10821 r10916  
    5353    ConfigFileManager::~ConfigFileManager()
    5454    {
    55         for (const auto & elem : this->configFiles_)
    56             if (elem)
    57                 delete (elem);
     55        for (ConfigFile* configFile : this->configFiles_)
     56            if (configFile)
     57                delete configFile;
    5858    }
    5959
  • code/branches/cpp11_v2/src/libraries/core/config/ConfigFileSection.cc

    r10821 r10916  
    8080    {
    8181        unsigned int size = 0;
    82         for (const auto & elem : this->entries_)
    83             if ((elem)->getName() == name)
    84                 if ((elem)->getIndex() >= size)
    85                     size = (elem)->getIndex() + 1;
     82        for (ConfigFileEntry* entry : this->entries_)
     83            if (entry->getName() == name)
     84                if (entry->getIndex() >= size)
     85                    size = entry->getIndex() + 1;
    8686        return size;
    8787    }
     
    105105    ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name) const
    106106    {
    107         for (const auto & elem : this->entries_)
     107        for (ConfigFileEntry* entry : this->entries_)
    108108        {
    109             if ((elem)->getName() == name)
    110                 return elem;
     109            if (entry->getName() == name)
     110                return entry;
    111111        }
    112112        return nullptr;
     
    121121    ConfigFileEntry* ConfigFileSection::getEntry(const std::string& name, unsigned int index) const
    122122    {
    123         for (const auto & elem : this->entries_)
     123        for (ConfigFileEntry* entry : this->entries_)
    124124        {
    125             if (((elem)->getName() == name) && ((elem)->getIndex() == index))
    126                 return elem;
     125            if ((entry->getName() == name) && (entry->getIndex() == index))
     126                return entry;
    127127        }
    128128        return nullptr;
  • code/branches/cpp11_v2/src/libraries/core/config/ConfigValueContainer.h

    r10845 r10916  
    130130
    131131                this->value_ = V();
    132                 for (auto & elem : defvalue)
    133                     this->valueVector_.push_back(MultiType(elem));
     132                for (const D& defvalueElement : defvalue)
     133                    this->valueVector_.push_back(MultiType(defvalueElement));
    134134
    135135                this->initVector();
     
    183183                    std::vector<T> temp = *value;
    184184                    value->clear();
    185                     for (auto & elem : this->valueVector_)
    186                         value->push_back(elem);
     185                    for (const MultiType& vectorEntry : this->valueVector_)
     186                        value->push_back(vectorEntry);
    187187
    188188                    if (value->size() != temp.size())
     
    211211                {
    212212                    value->clear();
    213                     for (auto & elem : this->valueVector_)
    214                         value->push_back(elem);
     213                    for (const MultiType& vectorEntry : this->valueVector_)
     214                        value->push_back(vectorEntry);
    215215                }
    216216                return *this;
  • code/branches/cpp11_v2/src/libraries/core/input/Button.cc

    r10821 r10916  
    196196
    197197                    // add command to the buffer if not yet existing
    198                     for (auto & elem : *paramCommandBuffer_)
    199                     {
    200                         if (elem->evaluation_.getConsoleCommand()
     198                    for (BufferedParamCommand* command : *paramCommandBuffer_)
     199                    {
     200                        if (command->evaluation_.getConsoleCommand()
    201201                            == eval.getConsoleCommand())
    202202                        {
    203203                            // already in list
    204                             cmd->paramCommand_ = elem;
     204                            cmd->paramCommand_ = command;
    205205                            break;
    206206                        }
  • code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc

    r10821 r10916  
    110110    void InputBuffer::insert(const std::string& input, bool update)
    111111    {
    112         for (auto & elem : input)
    113         {
    114             this->insert(elem, false);
     112        for (const char& inputChar : input)
     113        {
     114            this->insert(inputChar, false);
    115115
    116116            if (update)
    117                 this->updated(elem, false);
     117                this->updated(inputChar, false);
    118118        }
    119119
     
    170170    void InputBuffer::updated()
    171171    {
    172         for (auto & elem : this->listeners_)
    173         {
    174             if ((elem)->bListenToAllChanges_)
    175                 (elem)->callFunction();
     172        for (BaseInputBufferListenerTuple* listener : this->listeners_)
     173        {
     174            if (listener->bListenToAllChanges_)
     175                listener->callFunction();
    176176        }
    177177    }
     
    179179    void InputBuffer::updated(const char& update, bool bSingleInput)
    180180    {
    181         for (auto & elem : this->listeners_)
    182         {
    183             if ((!(elem)->trueKeyFalseChar_) && ((elem)->bListenToAllChanges_ || ((elem)->char_ == update)) && (!(elem)->bOnlySingleInput_ || bSingleInput))
    184                 (elem)->callFunction();
     181        for (BaseInputBufferListenerTuple* listener : this->listeners_)
     182        {
     183            if ((!listener->trueKeyFalseChar_) && (listener->bListenToAllChanges_ || (listener->char_ == update)) && (!listener->bOnlySingleInput_ || bSingleInput))
     184                listener->callFunction();
    185185        }
    186186    }
     
    201201            return;
    202202
    203         for (auto & elem : this->listeners_)
    204         {
    205             if ((elem)->trueKeyFalseChar_ && ((elem)->key_ == evt.getKeyCode()))
    206                 (elem)->callFunction();
     203        for (BaseInputBufferListenerTuple* listener : this->listeners_)
     204        {
     205            if (listener->trueKeyFalseChar_ && (listener->key_ == evt.getKeyCode()))
     206                listener->callFunction();
    207207        }
    208208
  • code/branches/cpp11_v2/src/libraries/core/input/InputDevice.h

    r10845 r10916  
    158158
    159159            // Call all the states with the held button event
    160             for (auto & button : pressedButtons_)
    161                 for (auto & state : inputStates_)
     160            for (ButtonType& button : pressedButtons_)
     161                for (InputState* state : inputStates_)
    162162                    state->template buttonEvent<ButtonEvent::THold, typename Traits::ButtonTypeParam>(
    163163                        this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
    164164
    165165            // Call states with device update events
    166             for (auto & elem : inputStates_)
    167                 elem->update(time.getDeltaTime(), this->getDeviceID());
     166            for (InputState* state : inputStates_)
     167                state->update(time.getDeltaTime(), this->getDeviceID());
    168168
    169169            static_cast<DeviceClass*>(this)->updateImpl(time);
     
    196196
    197197            // Call states
    198             for (auto & elem : inputStates_)
    199                 elem->template buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
     198            for (InputState* state : inputStates_)
     199                state->template buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
    200200        }
    201201
     
    218218
    219219            // Call states
    220             for (auto & elem : inputStates_)
    221                 elem->template buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
     220            for (InputState* state : inputStates_)
     221                state->template buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->getDeviceID(), static_cast<DeviceClass*>(this)->getButtonEventArg(button));
    222222        }
    223223
  • code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc

    r10821 r10916  
    373373        // check whether a state has changed its EMPTY situation
    374374        bool bUpdateRequired = false;
    375         for (auto & elem : activeStates_)
    376         {
    377             if (elem.second->hasExpired())
    378             {
    379                 elem.second->resetExpiration();
     375        for (auto& mapEntry : activeStates_)
     376        {
     377            if (mapEntry.second->hasExpired())
     378            {
     379                mapEntry.second->resetExpiration();
    380380                bUpdateRequired = true;
    381381            }
     
    391391
    392392        // Collect function calls for the update
    393         for (auto & elem : activeStatesTicked_)
    394             elem->update(time.getDeltaTime());
     393        for (InputState* state : activeStatesTicked_)
     394            state->update(time.getDeltaTime());
    395395
    396396        // Execute all cached function calls in order
     
    401401        // If we delay the calls, then OIS and and the InputStates are not anymore
    402402        // in the call stack and can therefore be edited.
    403         for (auto & elem : this->callBuffer_)
    404             elem();
     403        for (auto& function : this->callBuffer_)
     404            function();
    405405
    406406        this->callBuffer_.clear();
     
    437437        // Using an std::set to avoid duplicates
    438438        std::set<InputState*> tempSet;
    439         for (auto & elem : devices_)
    440             if (elem != nullptr)
    441                 for (unsigned int iState = 0; iState < elem->getStateListRef().size(); ++iState)
    442                     tempSet.insert(elem->getStateListRef()[iState]);
     439        for (InputDevice* device : devices_)
     440            if (device != nullptr)
     441                for (unsigned int iState = 0; iState < device->getStateListRef().size(); ++iState)
     442                    tempSet.insert(device->getStateListRef()[iState]);
    443443
    444444        // Copy the content of the std::set back to the actual vector
    445445        activeStatesTicked_.clear();
    446         for (const auto & elem : tempSet)
    447             activeStatesTicked_.push_back(elem);
     446        for (InputState* state : tempSet)
     447            activeStatesTicked_.push_back(state);
    448448
    449449        // Check whether we have to change the mouse mode
  • code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc

    r10821 r10916  
    186186    void JoyStick::clearBuffersImpl()
    187187    {
    188         for (auto & elem : povStates_)
    189             elem = 0;
     188        for (int& state : povStates_)
     189            state = 0;
    190190    }
    191191
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc

    r10821 r10916  
    153153    void KeyBinder::buttonThresholdChanged()
    154154    {
    155         for (auto & elem : allHalfAxes_)
    156             if (!elem->bButtonThresholdUser_)
    157                 elem->buttonThreshold_ = this->buttonThreshold_;
     155        for (HalfAxis* halfAxis : allHalfAxes_)
     156            if (!halfAxis->bButtonThresholdUser_)
     157                halfAxis->buttonThreshold_ = this->buttonThreshold_;
    158158    }
    159159
     
    383383            it->second->clear();
    384384
    385         for (auto & elem : paramCommandBuffer_)
    386             delete elem;
     385        for (BufferedParamCommand* command : paramCommandBuffer_)
     386            delete command;
    387387        paramCommandBuffer_.clear();
    388388    }
     
    394394    {
    395395        // iterate over all buttons
    396         for (const auto & elem : this->allButtons_)
    397         {
    398             Button* button = elem.second;
     396        for (const auto& mapEntry : this->allButtons_)
     397        {
     398            Button* button = mapEntry.second;
    399399
    400400            // iterate over all modes
     
    465465        this->mousePosition_[1] = 0.0f;
    466466
    467         for (auto & elem : mouseAxes_)
    468             elem.reset();
     467        for (HalfAxis& axis : mouseAxes_)
     468            axis.reset();
    469469    }
    470470
     
    505505        }
    506506
    507         for (auto & elem : mouseAxes_)
     507        for (HalfAxis& axis : mouseAxes_)
    508508        {
    509509            // Why dividing relative value by dt? The reason lies in the simple fact, that when you
     
    515515            {
    516516                // just ignore if dt == 0.0 because we have multiplied by 0.0 anyway..
    517                 elem.relVal_ /= dt;
    518             }
    519 
    520             tickHalfAxis(elem);
     517                axis.relVal_ /= dt;
     518            }
     519
     520            tickHalfAxis(axis);
    521521        }
    522522    }
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.h

    r10845 r10916  
    226226    {
    227227        // execute all buffered bindings (additional parameter)
    228         for (auto & elem : paramCommandBuffer_)
     228        for (BufferedParamCommand* command : paramCommandBuffer_)
    229229        {
    230             elem->rel_ *= dt;
    231             elem->execute();
     230            command->rel_ *= dt;
     231            command->execute();
    232232        }
    233233
    234234        // always reset the relative movement of the mouse
    235         for (auto & elem : mouseAxes_)
    236             elem.relVal_ = 0.0f;
     235        for (HalfAxis& axis : mouseAxes_)
     236            axis.relVal_ = 0.0f;
    237237    }
    238238}// tolua_export
  • code/branches/cpp11_v2/src/libraries/core/input/Mouse.cc

    r10821 r10916  
    8282            IntVector2 rel(e.state.X.rel, e.state.Y.rel);
    8383            IntVector2 clippingSize(e.state.width, e.state.height);
    84             for (auto & elem : inputStates_)
    85                 elem->mouseMoved(abs, rel, clippingSize);
     84            for (InputState* state : inputStates_)
     85                state->mouseMoved(abs, rel, clippingSize);
    8686        }
    8787
     
    8989        if (e.state.Z.rel != 0)
    9090        {
    91             for (auto & elem : inputStates_)
    92                 elem->mouseScrolled(e.state.Z.abs, e.state.Z.rel);
     91            for (InputState* state : inputStates_)
     92                state->mouseScrolled(e.state.Z.abs, e.state.Z.rel);
    9393        }
    9494
  • code/branches/cpp11_v2/src/libraries/core/module/DynLibManager.cc

    r10821 r10916  
    7575    {
    7676        // Unload & delete resources in turn
    77         for (auto & elem : mLibList)
     77        for (auto& mapEntry : mLibList)
    7878        {
    79             elem.second->unload();
    80             delete elem.second;
     79            mapEntry.second->unload();
     80            delete mapEntry.second;
    8181        }
    8282
  • code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc

    r10821 r10916  
    5959    {
    6060        const std::set<StaticallyInitializedInstance*>& instances = this->staticallyInitializedInstancesByType_[type];
    61         for (const auto & instance : instances)
    62             (instance)->load();
     61        for (StaticallyInitializedInstance* instance : instances)
     62            instance->load();
    6363    }
    6464
     
    7575        std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*>> copy(this->staticallyInitializedInstancesByType_);
    7676        this->staticallyInitializedInstancesByType_.clear();
    77         for (auto & elem : copy)
    78             for (std::set<StaticallyInitializedInstance*>::iterator it2 = elem.second.begin(); it2 != elem.second.end(); ++it2)
     77        for (auto& mapEntry : copy)
     78            for (std::set<StaticallyInitializedInstance*>::iterator it2 = mapEntry.second.begin(); it2 != mapEntry.second.end(); ++it2)
    7979                delete (*it2);
    8080    }
  • code/branches/cpp11_v2/src/libraries/core/module/PluginManager.cc

    r10821 r10916  
    5959        ModifyConsoleCommand("PluginManager", __CC_PluginManager_unload_name).setObject(nullptr);
    6060
    61         for (auto & elem : this->references_)
    62             delete elem.second;
    63         for (auto & elem : this->plugins_)
    64             delete elem.second;
     61        for (auto& mapEntry : this->references_)
     62            delete mapEntry.second;
     63        for (auto& mapEntry : this->plugins_)
     64            delete mapEntry.second;
    6565    }
    6666
     
    6868    {
    6969        const std::vector<std::string>& pluginPaths = ApplicationPaths::getInstance().getPluginPaths();
    70         for (auto libraryName : pluginPaths)
     70        for (const std::string& libraryName : pluginPaths)
    7171        {
    7272            std::string name;
    73            
    7473            std::string filename = libraryName +  + specialConfig::pluginExtension;
    7574            std::ifstream infile(filename.c_str());
  • code/branches/cpp11_v2/src/libraries/core/module/StaticInitializationManager.cc

    r10821 r10916  
    5050    {
    5151        // attention: loading a module may add new handlers to the list
    52         for (auto & elem : this->handlers_)
    53             (elem)->loadModule(module);
     52        for (StaticInitializationHandler* handler : this->handlers_)
     53            handler->loadModule(module);
    5454    }
    5555
  • code/branches/cpp11_v2/src/libraries/core/object/Context.cc

    r10821 r10916  
    7070        // unregister context from object lists before object lists are destroyed
    7171        this->unregisterObject();
    72         for (auto & elem : this->objectLists_)
    73             delete elem;
     72        for (ObjectListBase* objectList : this->objectLists_)
     73            delete objectList;
    7474    }
    7575
  • code/branches/cpp11_v2/src/libraries/core/object/Listable.cc

    r10821 r10916  
    7676    void Listable::unregisterObject()
    7777    {
    78         for (auto & elem : this->elements_)
    79             Listable::deleteObjectListElement(elem);
     78        for (ObjectListBaseElement* element : this->elements_)
     79            Listable::deleteObjectListElement(element);
    8080        this->elements_.clear();
    8181    }
     
    9191        this->elements_.clear();
    9292
    93         for (auto & elem : copy)
     93        for (ObjectListBaseElement* element : copy)
    9494        {
    95             elem->changeContext(this->context_, context);
    96             Listable::deleteObjectListElement(elem);
     95            element->changeContext(this->context_, context);
     96            Listable::deleteObjectListElement(element);
    9797        }
    9898
  • code/branches/cpp11_v2/src/libraries/core/object/ObjectListBase.cc

    r10821 r10916  
    9292    void ObjectListBase::notifyRemovalListeners(ObjectListBaseElement* element) const
    9393    {
    94         for (const auto & elem : this->listeners_)
    95             (elem)->removedElement(element);
     94        for (ObjectListElementRemovalListener* listener : this->listeners_)
     95            listener->removedElement(element);
    9696    }
    9797
  • code/branches/cpp11_v2/src/libraries/core/singleton/ScopeManager.cc

    r10821 r10916  
    7373    void ScopeManager::activateListenersForScope(ScopeID::Value scope)
    7474    {
    75         for (const auto & elem : this->listeners_[scope])
    76             this->activateListener(elem);
     75        for (ScopeListener* listener : this->listeners_[scope])
     76            this->activateListener(listener);
    7777    }
    7878
    7979    void ScopeManager::deactivateListenersForScope(ScopeID::Value scope)
    8080    {
    81         for (const auto & elem : this->listeners_[scope])
    82             this->deactivateListener(elem);
     81        for (ScopeListener* listener : this->listeners_[scope])
     82            this->deactivateListener(listener);
    8383    }
    8484
  • code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc

    r10821 r10916  
    131131  *(uint32_t*)(mem+2*sizeof(uint32_t)) = this->objectID_;
    132132  mem += 3*sizeof(uint32_t);
    133   for(auto & elem : this->arguments_)
     133  for(const MultiType& argument : this->arguments_)
    134134  {
    135     elem.exportData( mem );
     135    argument.exportData( mem );
    136136  }
    137137}
  • code/branches/cpp11_v2/src/libraries/network/Host.cc

    r10821 r10916  
    8080  void Host::addPacket(ENetPacket *packet, int clientID, uint8_t channelID)
    8181  {
    82     for(auto & instances_ : instances_s)
     82    for(Host* host : instances_s)
    8383    {
    84       if( (instances_)->isActive() )
     84      if( host->isActive() )
    8585      {
    86         (instances_)->queuePacket(packet, clientID, channelID);
     86        host->queuePacket(packet, clientID, channelID);
    8787      }
    8888    }
     
    9797  void Host::sendChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
    9898  {
    99     for(auto & instances_ : instances_s)
    100       if( (instances_)->isActive() )
    101         (instances_)->doSendChat(message, sourceID, targetID);
     99    for(Host* host : instances_s)
     100      if( host->isActive() )
     101        host->doSendChat(message, sourceID, targetID);
    102102  }
    103103
     
    114114  bool Host::isServer()
    115115  {
    116     for (auto & instances_ : instances_s)
     116    for (Host* host : instances_s)
    117117    {
    118       if( (instances_)->isActive() )
     118      if( host->isActive() )
    119119      {
    120         if( (instances_)->isServer_() )
     120        if( host->isServer_() )
    121121          return true;
    122122      }
  • code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc

    r10821 r10916  
    8888    }
    8989    // delete all Synchronisable Variables from syncList_ ( which are also in stringList_ )
    90     for(auto & elem : syncList_)
    91       delete (elem);
     90    for(SynchronisableVariableBase* variable : syncList_)
     91      delete variable;
    9292    syncList_.clear();
    9393    stringList_.clear();
  • code/branches/cpp11_v2/src/libraries/tools/DebugDrawer.cc

    r10821 r10916  
    392392            manualObject->estimateVertexCount(lineVertices.size());
    393393            manualObject->estimateIndexCount(lineIndices.size());
    394             for (auto & elem : lineVertices)
     394            for (const VertexPair& pair : lineVertices)
    395395            {
    396                 manualObject->position(elem.first);
    397                 manualObject->colour(elem.second);
     396                manualObject->position(pair.first);
     397                manualObject->colour(pair.second);
    398398            }
    399             for (auto & elem : lineIndices)
    400                 manualObject->index(elem);
     399            for (int lineIndex : lineIndices)
     400                manualObject->index(lineIndex);
    401401        }
    402402        else
     
    409409            manualObject->estimateVertexCount(triangleVertices.size());
    410410            manualObject->estimateIndexCount(triangleIndices.size());
    411             for (auto & elem : triangleVertices)
     411            for (const VertexPair& pair : triangleVertices)
    412412            {
    413                 manualObject->position(elem.first);
    414                 manualObject->colour(elem.second.r, elem.second.g, elem.second.b, fillAlpha);
     413                manualObject->position(pair.first);
     414                manualObject->colour(pair.second.r, pair.second.g, pair.second.b, fillAlpha);
    415415            }
    416             for (auto & elem : triangleIndices)
    417                 manualObject->index(elem);
     416            for (int triangleIndex : triangleIndices)
     417                manualObject->index(triangleIndex);
    418418        }
    419419        else
  • code/branches/cpp11_v2/src/libraries/tools/IcoSphere.cc

    r10821 r10916  
    116116            std::list<TriangleIndices> faces2;
    117117
    118             for (auto f : faces)
     118            for (const TriangleIndices& f : faces)
    119119            {
    120                
    121120                int a = getMiddlePoint(f.v1, f.v2);
    122121                int b = getMiddlePoint(f.v2, f.v3);
     
    194193    void IcoSphere::addToLineIndices(int baseIndex, std::list<int>* target) const
    195194    {
    196         for (const auto & elem : lineIndices)
     195        for (const LineIndices& line : lineIndices)
    197196        {
    198             target->push_back(baseIndex + (elem).v1);
    199             target->push_back(baseIndex + (elem).v2);
     197            target->push_back(baseIndex + line.v1);
     198            target->push_back(baseIndex + line.v2);
    200199        }
    201200    }
     
    203202    void IcoSphere::addToTriangleIndices(int baseIndex, std::list<int>* target) const
    204203    {
    205         for (const auto & elem : faces)
     204        for (const TriangleIndices& triangle : faces)
    206205        {
    207             target->push_back(baseIndex + (elem).v1);
    208             target->push_back(baseIndex + (elem).v2);
    209             target->push_back(baseIndex + (elem).v3);
     206            target->push_back(baseIndex + triangle.v1);
     207            target->push_back(baseIndex + triangle.v2);
     208            target->push_back(baseIndex + triangle.v3);
    210209        }
    211210    }
     
    217216        transform.setScale(Ogre::Vector3(scale, scale, scale));
    218217
    219         for (auto & elem : vertices)
    220             target->push_back(VertexPair(transform * elem, colour));
     218        for (const Ogre::Vector3& vertex : vertices)
     219            target->push_back(VertexPair(transform * vertex, colour));
    221220
    222221        return vertices.size();
  • code/branches/cpp11_v2/src/libraries/tools/Shader.cc

    r10821 r10916  
    197197    {
    198198        // iterate through the list of parameters
    199         for (auto & elem : this->parameters_)
    200         {
    201             Ogre::Technique* techniquePtr = materialPtr->getTechnique(elem.technique_);
     199        for (const ParameterContainer& parameter : this->parameters_)
     200        {
     201            Ogre::Technique* techniquePtr = materialPtr->getTechnique(parameter.technique_);
    202202            if (techniquePtr)
    203203            {
    204                 Ogre::Pass* passPtr = techniquePtr->getPass(elem.pass_);
     204                Ogre::Pass* passPtr = techniquePtr->getPass(parameter.pass_);
    205205                if (passPtr)
    206206                {
    207207                    // change the value of the parameter depending on its type
    208                     if (elem.value_.isType<int>())
    209                         passPtr->getFragmentProgramParameters()->setNamedConstant(elem.parameter_, elem.value_.get<int>());
    210                     else if (elem.value_.isType<float>())
    211                         passPtr->getFragmentProgramParameters()->setNamedConstant(elem.parameter_, elem.value_.get<float>());
     208                    if (parameter.value_.isType<int>())
     209                        passPtr->getFragmentProgramParameters()->setNamedConstant(parameter.parameter_, parameter.value_.get<int>());
     210                    else if (parameter.value_.isType<float>())
     211                        passPtr->getFragmentProgramParameters()->setNamedConstant(parameter.parameter_, parameter.value_.get<float>());
    212212                }
    213213                else
    214                     orxout(internal_warning) << "No pass " << elem.pass_ << " in technique " << elem.technique_ << " in compositor \"" << this->compositorName_ << "\" or pass has no shader." << endl;
     214                    orxout(internal_warning) << "No pass " << parameter.pass_ << " in technique " << parameter.technique_ << " in compositor \"" << this->compositorName_ << "\" or pass has no shader." << endl;
    215215            }
    216216            else
    217                 orxout(internal_warning) << "No technique " << elem.technique_ << " in compositor \"" << this->compositorName_ << "\" or technique has no pass with shader." << endl;
     217                orxout(internal_warning) << "No technique " << parameter.technique_ << " in compositor \"" << this->compositorName_ << "\" or technique has no pass with shader." << endl;
    218218        }
    219219        this->parameters_.clear();
     
    228228        {
    229229            const Ogre::Root::PluginInstanceList& plugins = Ogre::Root::getSingleton().getInstalledPlugins();
    230             for (auto & plugin : plugins)
     230            for (Ogre::Plugin* plugin : plugins)
    231231                if (plugin->getName() == "Cg Program Manager")
    232232                    return true;
  • code/branches/cpp11_v2/src/libraries/util/DisplayStringConversions.h

    r10821 r10916  
    5151            {
    5252                Ogre::UTFString::code_point cp;
    53                 for (auto & elem : input)
     53                for (const char& character : input)
    5454                {
    55                   cp = elem;
     55                  cp = character;
    5656                  cp &= 0xFF;
    5757                  output->append(1, cp);
  • code/branches/cpp11_v2/src/libraries/util/Serialise.h

    r10821 r10916  
    672672    {
    673673        uint32_t tempsize = sizeof(uint32_t); // for the number of entries
    674         for(const auto & elem : *((std::set<T>*)(&variable)))
    675             tempsize += returnSize( elem );
     674        for(const T& element : *((std::set<T>*)(&variable)))
     675            tempsize += returnSize( element );
    676676        return tempsize;
    677677    }
  • code/branches/cpp11_v2/src/libraries/util/SignalHandler.cc

    r10821 r10916  
    8181    void SignalHandler::dontCatch()
    8282    {
    83       for (auto & elem : sigRecList)
    84       {
    85         signal( elem.signal, elem.handler );
     83      for (const SignalRec& sigRec : sigRecList)
     84      {
     85        signal( sigRec.signal, sigRec.handler );
    8686      }
    8787
     
    133133      }
    134134
    135       for (auto & elem : SignalHandler::getInstance().callbackList)
    136       {
    137         (*(elem.cb))( elem.someData );
     135      for (const SignalCallbackRec& callback : SignalHandler::getInstance().callbackList)
     136      {
     137        (*(callback.cb))( callback.someData );
    138138      }
    139139
  • code/branches/cpp11_v2/src/libraries/util/SmallObjectAllocator.cc

    r10821 r10916  
    5353    SmallObjectAllocator::~SmallObjectAllocator()
    5454    {
    55         for (auto & elem : this->blocks_)
    56             delete[] elem;
     55        for (char* block : this->blocks_)
     56            delete[] block;
    5757    }
    5858
  • code/branches/cpp11_v2/src/libraries/util/StringUtils.cc

    r10821 r10916  
    262262        std::string output(str.size() * 2, ' ');
    263263        size_t i = 0;
    264         for (auto & elem : str)
    265         {
    266             switch (elem)
     264        for (const char& character : str)
     265        {
     266            switch (character)
    267267            {
    268268            case '\\': output[i] = '\\'; output[i + 1] = '\\'; break;
     
    276276            case  '"': output[i] = '\\'; output[i + 1] =  '"'; break;
    277277            case '\0': output[i] = '\\'; output[i + 1] =  '0'; break;
    278             default  : output[i] = elem; ++i; continue;
     278            default  : output[i] = character; ++i; continue;
    279279            }
    280280            i += 2;
     
    336336    void lowercase(std::string* str)
    337337    {
    338         for (auto & elem : *str)
    339         {
    340             elem = static_cast<char>(tolower(elem));
     338        for (char& character : *str)
     339        {
     340            character = static_cast<char>(tolower(character));
    341341        }
    342342    }
     
    353353    void uppercase(std::string* str)
    354354    {
    355         for (auto & elem : *str)
    356         {
    357             elem = static_cast<char>(toupper(elem));
     355        for (char& character : *str)
     356        {
     357            character = static_cast<char>(toupper(character));
    358358        }
    359359    }
     
    460460    {
    461461        size_t j = 0;
    462         for (auto & elem : str)
    463         {
    464             if (elem == target)
     462        for (char& character : str)
     463        {
     464            if (character == target)
    465465            {
    466                 elem = replacement;
     466                character = replacement;
    467467                ++j;
    468468            }
  • code/branches/cpp11_v2/src/libraries/util/output/BaseWriter.cc

    r10821 r10916  
    116116
    117117        // iterate over all strings in the config-vector
    118         for (auto & full_name : this->configurableAdditionalContexts_)
     118        for (const std::string& full_name : this->configurableAdditionalContexts_)
    119119        {
    120            
    121 
    122120            // split the name into main-name and sub-name (if given; otherwise sub-name remains empty). both names are separated by ::
    123121            std::string name = full_name;
  • code/branches/cpp11_v2/src/libraries/util/output/MemoryWriter.cc

    r10821 r10916  
    6565    void MemoryWriter::resendOutput(OutputListener* listener) const
    6666    {
    67         for (auto & message : this->messages_)
     67        for (const Message& message : this->messages_)
    6868        {
    69            
    7069            listener->unfilteredOutput(message.level, *message.context, message.lines);
    7170        }
  • code/branches/cpp11_v2/src/libraries/util/output/OutputListener.cc

    r10821 r10916  
    111111        this->levelMask_ = mask;
    112112
    113         for (auto & elem : this->listeners_)
    114             elem->updatedLevelMask(this);
     113        for (AdditionalContextListener* listener : this->listeners_)
     114            listener->updatedLevelMask(this);
    115115    }
    116116
     
    142142        this->additionalContextsLevelMask_ = mask;
    143143
    144         for (auto & elem : this->listeners_)
    145             elem->updatedAdditionalContextsLevelMask(this);
     144        for (AdditionalContextListener* listener : this->listeners_)
     145            listener->updatedAdditionalContextsLevelMask(this);
    146146    }
    147147
     
    153153        this->additionalContextsMask_ = mask;
    154154
    155         for (auto & elem : this->listeners_)
    156             elem->updatedAdditionalContextsMask(this);
     155        for (AdditionalContextListener* listener : this->listeners_)
     156            listener->updatedAdditionalContextsMask(this);
    157157    }
    158158
  • code/branches/cpp11_v2/src/libraries/util/output/OutputManager.cc

    r10829 r10916  
    131131        vectorize(message, '\n', &lines);
    132132
    133         for (auto & elem : this->listeners_)
    134             elem->unfilteredOutput(level, context, lines);
     133        for (OutputListener* listener : this->listeners_)
     134            listener->unfilteredOutput(level, context, lines);
    135135    }
    136136
     
    178178    {
    179179        int mask = 0;
    180         for (auto & elem : this->listeners_)
    181             mask |= elem->getLevelMask();
     180        for (OutputListener* listener : this->listeners_)
     181            mask |= listener->getLevelMask();
    182182        this->combinedLevelMask_ = static_cast<OutputLevel>(mask);
    183183    }
     
    189189    {
    190190        int mask = 0;
    191         for (auto & elem : this->listeners_)
    192             mask |= elem->getAdditionalContextsLevelMask();
     191        for (OutputListener* listener : this->listeners_)
     192            mask |= listener->getAdditionalContextsLevelMask();
    193193        this->combinedAdditionalContextsLevelMask_ = static_cast<OutputLevel>(mask);
    194194    }
     
    200200    {
    201201        this->combinedAdditionalContextsMask_ = 0;
    202         for (auto & elem : this->listeners_)
    203             this->combinedAdditionalContextsMask_ |= elem->getAdditionalContextsMask();
     202        for (OutputListener* listener : this->listeners_)
     203            this->combinedAdditionalContextsMask_ |= listener->getAdditionalContextsMask();
    204204    }
    205205
  • code/branches/cpp11_v2/src/libraries/util/output/SubcontextOutputListener.cc

    r10821 r10916  
    7979
    8080        // compose the mask of subcontexts and build the set of sub-context-IDs
    81         for (const auto & subcontext : subcontexts)
     81        for (const OutputContextContainer* subcontext : subcontexts)
    8282        {
    83             this->subcontextsCheckMask_ |= (subcontext)->mask;
    84             this->subcontexts_.insert((subcontext)->sub_id);
     83            this->subcontextsCheckMask_ |= subcontext->mask;
     84            this->subcontexts_.insert(subcontext->sub_id);
    8585        }
    8686
Note: See TracChangeset for help on using the changeset viewer.