Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 5, 2015, 10:47:51 PM (9 years ago)
Author:
landauf
Message:

use range-based for-loop where it makes sense (e.g. ObjectList)

Location:
code/branches/cpp11_v2/src
Files:
91 edited

Legend:

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

    r10916 r10919  
    163163        this->setName(name);
    164164
    165         for (ObjectList<XMLNameListener>::iterator it = ObjectList<XMLNameListener>::begin(); it != ObjectList<XMLNameListener>::end(); ++it)
    166             it->loadedNewXMLName(this);
     165        for (XMLNameListener* listener : ObjectList<XMLNameListener>())
     166            listener->loadedNewXMLName(this);
    167167    }
    168168
  • code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc

    r10916 r10919  
    915915
    916916            // Iterate through all subnodes
    917             for (std::list<ClassTreeMaskNode*>::iterator it1 = node->subnodes_.begin(); it1 != node->subnodes_.end(); ++it1)
     917            for (ClassTreeMaskNode* subnode : node->subnodes_)
    918918            {
    919919                // Recursive call to this function with the subnode
    920                 this->create(*it1);
     920                this->create(subnode);
    921921
    922922                // Only execute the following code if the current node is included, meaning some of the subnodes might be included too
     
    926926
    927927                    // Iterate through all direct children
    928                     for (std::set<const Identifier*>::iterator it2 = directChildren.begin(); it2 != directChildren.end(); ++it2)
     928                    for (std::set<const Identifier*>::iterator it = directChildren.begin(); it != directChildren.end(); ++it)
    929929                    {
    930930                        // Check if the subnode (it1) is a child of the directChild (it2)
    931                         if ((*it1)->getClass()->isA(*it2))
     931                        if (subnode->getClass()->isA(*it))
    932932                        {
    933933                            // Yes it is - remove the directChild (it2) from the list, because it will already be handled by a recursive call to the create() function
    934                             directChildren.erase(it2);
     934                            directChildren.erase(it);
    935935
    936936                            // Check if the removed directChild was exactly the subnode
    937                             if (!(*it1)->getClass()->isExactlyA(*it2))
     937                            if (!subnode->getClass()->isExactlyA(*it))
    938938                            {
    939939                                // No, it wasn't exactly the subnode - therefore there are some classes between
    940940
    941941                                // Add the previously removed directChild (it2) to the subclass-list
    942                                 this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(*it2, true));
     942                                this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(*it, true));
    943943
    944944                                // Insert all directChildren of the directChild
    945                                 directChildren.insert((*it2)->getDirectChildren().begin(), (*it2)->getDirectChildren().end());
     945                                directChildren.insert((*it)->getDirectChildren().begin(), (*it)->getDirectChildren().end());
    946946
    947947                                // Restart the scan with the expanded set of directChildren
  • code/branches/cpp11_v2/src/libraries/core/Core.cc

    r10916 r10919  
    460460    {
    461461        // Update UpdateListeners before general ticking
    462         for (ObjectList<UpdateListener>::iterator it = ObjectList<UpdateListener>::begin(); it != ObjectList<UpdateListener>::end(); ++it)
    463             it->preUpdate(time);
     462        for (UpdateListener* listener : ObjectList<UpdateListener>())
     463            listener->preUpdate(time);
    464464        if (this->bGraphicsLoaded_)
    465465        {
     
    479479    {
    480480        // Update UpdateListeners just before rendering
    481         for (ObjectList<UpdateListener>::iterator it = ObjectList<UpdateListener>::begin(); it != ObjectList<UpdateListener>::end(); ++it)
    482             it->postUpdate(time);
     481        for (UpdateListener* listener : ObjectList<UpdateListener>())
     482            listener->postUpdate(time);
    483483        if (this->bGraphicsLoaded_)
    484484        {
  • code/branches/cpp11_v2/src/libraries/core/CoreConfig.cc

    r10813 r10919  
    108108    {
    109109        // Inform listeners
    110         ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin();
    111         for (; it != ObjectList<DevModeListener>::end(); ++it)
    112             it->devModeChanged(bDevMode_);
     110        for (DevModeListener* listener : ObjectList<DevModeListener>())
     111            listener->devModeChanged(bDevMode_);
    113112    }
    114113
  • code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc

    r10916 r10919  
    129129            {
    130130                // iterate over all contexts
    131                 for (ObjectList<Context>::iterator it_context = ObjectList<Context>::begin(); it_context != ObjectList<Context>::end(); ++it_context)
    132                     it_context->destroyObjectList(identifier);
     131                for (Context* context : ObjectList<Context>())
     132                    context->destroyObjectList(identifier);
    133133            }
    134134        }
  • code/branches/cpp11_v2/src/libraries/core/Game.cc

    r10918 r10919  
    115115
    116116        // After the core has been created, we can safely instantiate the GameStates that don't require graphics
    117         for (std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.begin();
    118             it != gameStateDeclarations_s.end(); ++it)
    119         {
    120             if (!it->second.bGraphicsMode)
    121                 constructedStates_[it->second.stateName] = GameStateFactory::fabricate(it->second);
     117        for (const auto& mapEntry : gameStateDeclarations_s)
     118        {
     119            if (!mapEntry.second.bGraphicsMode)
     120                constructedStates_[mapEntry.second.stateName] = GameStateFactory::fabricate(mapEntry.second);
    122121        }
    123122
     
    262261    {
    263262        // Note: The first element is the empty root state, which doesn't need ticking
    264         for (GameStateVector::const_iterator it = this->loadedStates_.begin() + 1;
    265             it != this->loadedStates_.end(); ++it)
     263        for (const std::shared_ptr<GameState>& state : this->loadedStates_)
    266264        {
    267265            try
     
    269267                // Add tick time for most of the states
    270268                uint64_t timeBeforeTick = 0;
    271                 if ((*it)->getInfo().bIgnoreTickTime)
     269                if (state->getInfo().bIgnoreTickTime)
    272270                    timeBeforeTick = this->gameClock_->getRealMicroseconds();
    273                 (*it)->update(*this->gameClock_);
    274                 if ((*it)->getInfo().bIgnoreTickTime)
     271                state->update(*this->gameClock_);
     272                if (state->getInfo().bIgnoreTickTime)
    275273                    this->subtractTickTime(static_cast<int32_t>(this->gameClock_->getRealMicroseconds() - timeBeforeTick));
    276274            }
    277275            catch (...)
    278276            {
    279                 orxout(user_error) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << endl;
     277                orxout(user_error) << "An exception occurred while updating '" << state->getName() << "': " << Exception::handleMessage() << endl;
    280278                orxout(user_error) << "This should really never happen!" << endl;
    281279                orxout(user_error) << "Unloading all GameStates depending on the one that crashed." << endl;
    282280                std::shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_;
    283                 while (current->name_ != (*it)->getName() && current)
     281                while (current->name_ != state->getName() && current)
    284282                    current = current->parent_.lock();
    285283                if (current && current->parent_.lock())
     
    520518
    521519            // Construct all the GameStates that require graphics
    522             for (std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.begin();
    523                 it != gameStateDeclarations_s.end(); ++it)
    524             {
    525                 if (it->second.bGraphicsMode)
     520            for (const auto& mapEntry : gameStateDeclarations_s)
     521            {
     522                if (mapEntry.second.bGraphicsMode)
    526523                {
    527524                    // Game state loading failure is serious --> don't catch
    528                     std::shared_ptr<GameState> gameState = GameStateFactory::fabricate(it->second);
     525                    std::shared_ptr<GameState> gameState = GameStateFactory::fabricate(mapEntry.second);
    529526                    if (!constructedStates_.insert(std::make_pair(
    530                         it->second.stateName, gameState)).second)
     527                        mapEntry.second.stateName, gameState)).second)
    531528                        assert(false); // GameState was already created!
    532529                }
  • code/branches/cpp11_v2/src/libraries/core/GraphicsManager.cc

    r10845 r10919  
    389389        GUIManager::getInstance().setCamera(camera);
    390390
    391         for (ObjectList<ViewportEventListener>::iterator it = ObjectList<ViewportEventListener>::begin(); it != ObjectList<ViewportEventListener>::end(); ++it)
    392             it->cameraChanged(this->viewport_, oldCamera);
     391        for (ViewportEventListener* listener : ObjectList<ViewportEventListener>())
     392            listener->cameraChanged(this->viewport_, oldCamera);
    393393    }
    394394
  • code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc

    r10917 r10919  
    149149
    150150            int i = 0;
    151             for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); i++, ++it)
     151            for (const auto& mapEntry : this->subnodes_)
    152152            {
    153153                if (i > 0)
    154154                    output += ", ";
    155155
    156                 output += it->second->toString();
     156                output += mapEntry.second->toString();
     157                i++;
    157158            }
    158159
  • code/branches/cpp11_v2/src/libraries/core/ThreadPool.cc

    r8394 r10919  
    8383    bool ThreadPool::passFunction( const ExecutorPtr& executor, bool addThread )
    8484    {
    85         std::vector<Thread*>::iterator it;
    86         for ( it=this->threadPool_.begin(); it!=this->threadPool_.end(); ++it )
     85        for ( Thread* thread : threadPool_ )
    8786        {
    88             if ( ! (*it)->isWorking() )
     87            if ( ! thread->isWorking() )
    8988            {
    9089                // If that fails, then there is some code error
    91                 OrxVerify( (*it)->evaluateExecutor( executor ), "ERROR: could not evaluate Executor" );
     90                OrxVerify( thread->evaluateExecutor( executor ), "ERROR: could not evaluate Executor" );
    9291                return true;
    9392            }
     
    105104    void ThreadPool::synchronise()
    106105    {
    107         std::vector<Thread*>::iterator it;
    108         for ( it=this->threadPool_.begin(); it!=this->threadPool_.end(); ++it )
     106        for ( Thread* thread : this->threadPool_ )
    109107        {
    110             (*it)->waitUntilFinished();
     108            thread->waitUntilFinished();
    111109        }
    112110    }
  • code/branches/cpp11_v2/src/libraries/core/WindowEventListener.cc

    r10624 r10919  
    4545    /*static*/ void WindowEventListener::moveWindow()
    4646    {
    47         for (ObjectList<WindowEventListener>::iterator it = ObjectList<WindowEventListener>::begin(); it; ++it)
    48             it->windowMoved();
     47        for (WindowEventListener* listener : ObjectList<WindowEventListener>())
     48            listener->windowMoved();
    4949    }
    5050
     
    5454        windowWidth_s = newWidth;
    5555        windowHeight_s = newHeight;
    56         for (ObjectList<WindowEventListener>::iterator it = ObjectList<WindowEventListener>::begin(); it; ++it)
    57             it->windowResized(newWidth, newHeight);
     56        for (WindowEventListener* listener : ObjectList<WindowEventListener>())
     57            listener->windowResized(newWidth, newHeight);
    5858    }
    5959
     
    6161    /*static*/ void WindowEventListener::changeWindowFocus(bool bFocus)
    6262    {
    63         for (ObjectList<WindowEventListener>::iterator it = ObjectList<WindowEventListener>::begin(); it; ++it)
    64             it->windowFocusChanged(bFocus);
     63        for (WindowEventListener* listener : ObjectList<WindowEventListener>())
     64            listener->windowFocusChanged(bFocus);
    6565    }
    6666}
  • code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc

    r10917 r10919  
    7979            delete this->factory_;
    8080
    81         for (std::list<const InheritsFrom*>::const_iterator it = this->manualDirectParents_.begin(); it != this->manualDirectParents_.end(); ++it)
    82             delete (*it);
     81        for (const InheritsFrom* manualDirectParent : this->manualDirectParents_)
     82            delete manualDirectParent;
    8383
    8484        // erase this Identifier from all related identifiers
    85         for (std::list<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
    86             const_cast<Identifier*>(*it)->children_.erase(this);
    87         for (std::list<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
    88             const_cast<Identifier*>(*it)->directChildren_.erase(this);
     85        for (const Identifier* parent : this->parents_)
     86            const_cast<Identifier*>(parent)->children_.erase(this);
     87        for (const Identifier* directParent : this->directParents_)
     88            const_cast<Identifier*>(directParent)->directChildren_.erase(this);
    8989        for (const Identifier* child : this->children_)
    9090            const_cast<Identifier*>(child)->parents_.remove(this);
     
    184184
    185185            // initialize all parents
    186             for (std::list<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
    187                 const_cast<Identifier*>(*it)->finishInitialization(); // initialize parent
     186            for (const Identifier* parent : this->parents_)
     187                const_cast<Identifier*>(parent)->finishInitialization(); // initialize parent
    188188
    189189            // parents of parents are no direct parents of this identifier
    190190            this->directParents_ = this->parents_;
    191             for (std::list<const Identifier*>::const_iterator it_parent = this->parents_.begin(); it_parent != this->parents_.end(); ++it_parent)
    192                 for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
    193                     this->directParents_.remove(*it_parent_parent);
     191            for (const Identifier* parent : this->parents_)
     192                for (const Identifier* parent_parent : const_cast<Identifier*>(parent)->parents_)
     193                    this->directParents_.remove(parent_parent);
    194194
    195195            this->verifyIdentifierTrace();
     
    200200
    201201            // initialize all direct parents
    202             for (std::list<const InheritsFrom*>::const_iterator it = this->manualDirectParents_.begin(); it != this->manualDirectParents_.end(); ++it)
     202            for (const InheritsFrom* manualDirectParent : this->manualDirectParents_)
    203203            {
    204                 Identifier* directParent = (*it)->getParent();
     204                Identifier* directParent = manualDirectParent->getParent();
    205205                this->directParents_.push_back(directParent);
    206206                directParent->finishInitialization(); // initialize parent
     
    208208
    209209            // direct parents and their parents are also parents of this identifier (but only add them once)
    210             for (std::list<const Identifier*>::const_iterator it_parent = this->directParents_.begin(); it_parent != this->directParents_.end(); ++it_parent)
     210            for (const Identifier* parent : this->directParents_)
    211211            {
    212                 for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
    213                     this->addIfNotExists(this->parents_, *it_parent_parent);
    214                 this->addIfNotExists(this->parents_, *it_parent);
     212                for (const Identifier* parent_parent : const_cast<Identifier*>(parent)->parents_)
     213                    this->addIfNotExists(this->parents_, parent_parent);
     214                this->addIfNotExists(this->parents_, parent);
    215215            }
    216216        }
     
    224224
    225225        // tell all parents that this identifier is a child
    226         for (std::list<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
    227             const_cast<Identifier*>(*it)->children_.insert(this);
     226        for (const Identifier* parent : this->parents_)
     227            const_cast<Identifier*>(parent)->children_.insert(this);
    228228
    229229        // tell all direct parents that this identifier is a direct child
    230         for (std::list<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
    231         {
    232             const_cast<Identifier*>(*it)->directChildren_.insert(this);
     230        for (const Identifier* directChild : this->directParents_)
     231        {
     232            const_cast<Identifier*>(directChild)->directChildren_.insert(this);
    233233
    234234            // Create the super-function dependencies
    235             (*it)->createSuperFunctionCaller();
     235            directChild->createSuperFunctionCaller();
    236236        }
    237237
     
    265265            if (parent->isVirtualBase())
    266266            {
    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)
    268                     this->addIfNotExists(expectedIdentifierTrace, *it_parent_parent);
     267                for (const Identifier* parent_parent : const_cast<Identifier*>(parent)->parents_)
     268                    this->addIfNotExists(expectedIdentifierTrace, parent_parent);
    269269                this->addIfNotExists(expectedIdentifierTrace, parent);
    270270            }
     
    274274        for (const Identifier* directParent : this->directParents_)
    275275        {
    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)
    277                 this->addIfNotExists(expectedIdentifierTrace, *it_parent_parent);
     276            for (const Identifier* parent_parent : const_cast<Identifier*>(directParent)->parents_)
     277                this->addIfNotExists(expectedIdentifierTrace, parent_parent);
    278278            this->addIfNotExists(expectedIdentifierTrace, directParent);
    279279        }
     
    290290
    291291            orxout(internal_warning) << "  Expected trace (according to class hierarchy definitions):" << endl << "    ";
    292             for (std::list<const Identifier*>::const_iterator it_parent = expectedIdentifierTrace.begin(); it_parent != expectedIdentifierTrace.end(); ++it_parent)
    293                 orxout(internal_warning) << " " << (*it_parent)->getName();
     292            for (const Identifier* parent : expectedIdentifierTrace)
     293                orxout(internal_warning) << " " << parent->getName();
    294294            orxout(internal_warning) << endl;
    295295
  • code/branches/cpp11_v2/src/libraries/core/class/Identifier.h

    r10918 r10919  
    458458            return;
    459459
    460         for (ObjectListIterator<T> it = ObjectList<T>::begin(); it; ++it)
    461             this->setConfigValues(*it, *it);
     460        for (T* object : ObjectList<T>())
     461            this->setConfigValues(object, object);
    462462
    463463        if (updateChildren)
  • code/branches/cpp11_v2/src/libraries/core/class/Super.h

    r10817 r10919  
    103103            { \
    104104                ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \
    105                 for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it) \
     105                for (const Identifier* child : identifier->getDirectChildren()) \
    106106                { \
    107                     if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
     107                    if (((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_) \
    108108                    { \
    109                         delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_; \
    110                         ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = nullptr; \
    111                         ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false; \
     109                        delete ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_; \
     110                        ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = nullptr; \
     111                        ((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ = false; \
    112112                    } \
    113113                    \
    114                     if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
     114                    if (!((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_) \
    115115                    { \
    116                         orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << endl; \
    117                         ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
     116                        orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)child)->getName() << endl; \
     117                        ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
    118118                    } \
    119                     else if (((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier()) \
    120                         orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)(*it))->getName() << " calls function of " << ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl; \
     119                    else if (((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier()) \
     120                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)child)->getName() << " calls function of " << ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl; \
    121121                } \
    122122            } \
     
    171171
    172172                // Iterate through all children
    173                 for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it)
     173                for (const Identifier* child : identifier->getDirectChildren())
    174174                {
    175175                    // Check if the caller is a fallback-caller
    176                     if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
     176                    if (((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_)
    177177                    {
    178178                        // Delete the fallback caller an prepare to get a real caller
    179                         delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_;
    180                         ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = nullptr;
    181                         ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false;
     179                        delete ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_;
     180                        ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = nullptr;
     181                        ((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ = false;
    182182                    }
    183183
    184184                    // Check if there's not already a caller
    185                     if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
     185                    if (!((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_)
    186186                    {
    187187                        // Add the SuperFunctionCaller
    188                         orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << endl;
    189                         ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
     188                        orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)child)->getName() << endl;
     189                        ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
    190190                    }
    191191
    192192                    // If there is already a caller, but for another parent, print a warning
    193                     else if (((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier())
    194                         orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)(*it))->getName() << " calls function of " << ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl;
     193                    else if (((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier())
     194                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)child)->getName() << " calls function of " << ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl;
    195195                }
    196196            }
  • code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc

    r10918 r10919  
    334334            ArgumentCompletionList threads;
    335335
    336             for (std::list<unsigned int>::const_iterator it = threadnumbers.begin(); it != threadnumbers.end(); ++it)
    337                 threads.emplace_back(multi_cast<std::string>(*it));
     336            for (unsigned int threadnumber : threadnumbers)
     337                threads.emplace_back(multi_cast<std::string>(threadnumber));
    338338
    339339            return threads;
  • code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc

    r10916 r10919  
    328328
    329329        // iterate through all groups and their commands and calculate the distance to the current command. keep the best.
    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;
     330        for (const auto& mapEntryGroup : ConsoleCommandManager::getInstance().getCommandsLC())
     331        {
     332            if (mapEntryGroup.first != "")
     333            {
     334                for (const auto& mapEntryName : mapEntryGroup.second)
     335                {
     336                    std::string command = mapEntryGroup.first + " " + mapEntryName.first;
    337337                    unsigned int distance = getLevenshteinDistance(command, token0_LC + " " + token1_LC);
    338338                    if (distance < nearestDistance)
  • code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc

    r10916 r10919  
    145145            {
    146146                boost::shared_lock<boost::shared_mutex> lock(*this->interpreterBundlesMutex_);
    147                 for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = this->interpreterBundles_.begin(); it != this->interpreterBundles_.end(); ++it)
     147                for (const auto& mapEntry : this->interpreterBundles_)
    148148                {
    149                     if (it->first == 0)
     149                    if (mapEntry.first == 0)
    150150                        continue; // We'll handle the default interpreter later (and without threads of course)
    151151
    152                     TclInterpreterBundle* bundle = it->second;
     152                    TclInterpreterBundle* bundle = mapEntry.second;
    153153                    if (!bundle->queue_.empty())
    154154                    {
  • code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc

    r10916 r10919  
    110110            {
    111111                // first shove all the shortcuts in a map
    112                 for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
    113                     it != cmdLineArgs_.end(); ++it)
     112                for (const auto& mapEntry : cmdLineArgs_)
    114113                {
    115                     OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
     114                    OrxAssert(cmdLineArgsShortcut_.find(mapEntry.second->getShortcut()) == cmdLineArgsShortcut_.end(),
    116115                        "Cannot have two command line shortcut with the same name.");
    117                     if (!it->second->getShortcut().empty())
    118                         cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
     116                    if (!mapEntry.second->getShortcut().empty())
     117                        cmdLineArgsShortcut_[mapEntry.second->getShortcut()] = mapEntry.second;
    119118                }
    120119                bFirstTimeParse_ = false;
     
    257256        // determine maximum name size
    258257        size_t maxNameSize = 0;
    259         for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
    260             it != inst.cmdLineArgs_.end(); ++it)
    261         {
    262             maxNameSize = std::max(it->second->getName().size(), maxNameSize);
     258        for (const auto& mapEntry : inst.cmdLineArgs_)
     259        {
     260            maxNameSize = std::max(mapEntry.second->getName().size(), maxNameSize);
    263261        }
    264262
     
    267265        infoStr << "Available options:" << endl;
    268266
    269         for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
    270             it != inst.cmdLineArgs_.end(); ++it)
    271         {
    272             if (!it->second->getShortcut().empty())
    273                 infoStr << " [-" << it->second->getShortcut() << "] ";
     267        for (const auto& mapEntry : inst.cmdLineArgs_)
     268        {
     269            if (!mapEntry.second->getShortcut().empty())
     270                infoStr << " [-" << mapEntry.second->getShortcut() << "] ";
    274271            else
    275272                infoStr << "      ";
    276             infoStr << "--" << it->second->getName() << ' ';
    277             if (it->second->getValue().isType<bool>())
     273            infoStr << "--" << mapEntry.second->getName() << ' ';
     274            if (mapEntry.second->getValue().isType<bool>())
    278275                infoStr << "    ";
    279276            else
    280277                infoStr << "ARG ";
    281278            // fill with the necessary amount of blanks
    282             infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
    283             infoStr << ": " << it->second->getInformation();
     279            infoStr << std::string(maxNameSize - mapEntry.second->getName().size(), ' ');
     280            infoStr << ": " << mapEntry.second->getInformation();
    284281            infoStr << endl;
    285282        }
  • code/branches/cpp11_v2/src/libraries/core/config/SettingsConfigFile.cc

    r10768 r10919  
    142142        // todo: can this be done more efficiently? looks like some identifiers will be updated multiple times.
    143143
    144         for (ContainerMap::const_iterator it = this->containers_.begin(); it != this->containers_.end(); ++it)
    145         {
    146             it->second.second->update();
    147             it->second.second->getIdentifier()->updateConfigValues();
     144        for (const auto& mapEntry : this->containers_)
     145        {
     146            mapEntry.second.second->update();
     147            mapEntry.second.second->getIdentifier()->updateConfigValues();
    148148        }
    149149    }
  • code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc

    r10916 r10919  
    7575    InputBuffer::~InputBuffer()
    7676    {
    77         for (std::list<BaseInputBufferListenerTuple*>::const_iterator it = this->listeners_.begin();
    78             it != this->listeners_.end(); ++it)
    79             delete *it;
     77        for (BaseInputBufferListenerTuple* listener : this->listeners_)
     78            delete listener;
    8079    }
    8180
  • code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc

    r10917 r10919  
    531531            {
    532532                // Make sure we don't add two high priority states with the same priority
    533                 for (std::map<std::string, InputState*>::const_iterator it = this->statesByName_.begin();
    534                     it != this->statesByName_.end(); ++it)
     533                for (const auto& mapEntry : this->statesByName_)
    535534                {
    536                     if (it->second->getPriority() == priority)
     535                    if (mapEntry.second->getPriority() == priority)
    537536                    {
    538537                        orxout(internal_warning, context::input) << "Could not add an InputState with the same priority '"
  • code/branches/cpp11_v2/src/libraries/core/input/JoyStickQuantityListener.cc

    r10624 r10919  
    4747    {
    4848        joyStickList_s = joyStickList;
    49         for (ObjectList<JoyStickQuantityListener>::iterator it = ObjectList<JoyStickQuantityListener>::begin(); it; ++it)
    50             it->JoyStickQuantityChanged(joyStickList);
     49        for (JoyStickQuantityListener* listener : ObjectList<JoyStickQuantityListener>())
     50            listener->JoyStickQuantityChanged(joyStickList);
    5151    }
    5252}
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc

    r10918 r10919  
    274274
    275275        // Parse bindings and create the ConfigValueContainers if necessary
    276         for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
    277         {
    278             it->second->readBinding(this->configFile_, this->fallbackConfigFile_);
    279             addButtonToCommand(it->second->bindingString_, it->second);
     276        for (const auto& mapEntry : allButtons_)
     277        {
     278            mapEntry.second->readBinding(this->configFile_, this->fallbackConfigFile_);
     279            addButtonToCommand(mapEntry.second->bindingString_, mapEntry.second);
    280280        }
    281281
     
    380380    void KeyBinder::clearBindings()
    381381    {
    382         for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
    383             it->second->clear();
     382        for (const auto& mapEntry : allButtons_)
     383            mapEntry.second->clear();
    384384
    385385        for (BufferedParamCommand* command : paramCommandBuffer_)
  • code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc

    r10829 r10919  
    7676    {
    7777        // Delete all remaining KeyBinders
    78         for (std::map<std::string, KeyBinder*>::const_iterator it = this->binders_.begin(); it != this->binders_.end(); ++it)
    79             delete it->second;
     78        for (const auto& mapEntry : this->binders_)
     79            delete mapEntry.second;
    8080
    8181        // Reset console commands
  • code/branches/cpp11_v2/src/libraries/core/input/KeyDetector.cc

    r10765 r10919  
    7070    {
    7171        // Assign every button/axis the same command, but with its name as argument
    72         for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
    73             it->second->parse(__CC_KeyDetector_callback_name + ' ' + it->second->groupName_ + "." + it->second->name_);
     72        for (const auto& mapEntry : allButtons_)
     73            mapEntry.second->parse(__CC_KeyDetector_callback_name + ' ' + mapEntry.second->groupName_ + "." + mapEntry.second->name_);
    7474    }
    7575
  • code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc

    r10917 r10919  
    7676        this->staticallyInitializedInstancesByType_.clear();
    7777        for (const auto& mapEntry : copy)
    78             for (std::set<StaticallyInitializedInstance*>::iterator it2 = mapEntry.second.begin(); it2 != mapEntry.second.end(); ++it2)
    79                 delete (*it2);
     78            for (StaticallyInitializedInstance* instance : mapEntry.second)
     79                delete instance;
    8080    }
    8181
  • code/branches/cpp11_v2/src/libraries/network/Client.cc

    r10624 r10919  
    161161        {
    162162          std::vector<packet::Gamestate*> gamestates = GamestateManager::getGamestates();
    163           std::vector<packet::Gamestate*>::iterator it;
    164           for( it = gamestates.begin(); it != gamestates.end(); ++it )
     163          for( packet::Gamestate* gamestate : gamestates )
    165164          {
    166             (*it)->send( static_cast<Host*>(this) );
     165            gamestate->send( static_cast<Host*>(this) );
    167166          }
    168167        }
  • code/branches/cpp11_v2/src/libraries/network/ClientConnectionListener.cc

    r10624 r10919  
    4444    void ClientConnectionListener::broadcastClientConnected(unsigned int clientID)
    4545    {
    46         for (ObjectList<ClientConnectionListener>::iterator it = ObjectList<ClientConnectionListener>::begin(); it != ObjectList<ClientConnectionListener>::end(); ++it)
    47             it->clientConnected(clientID);
     46        for (ClientConnectionListener* listener : ObjectList<ClientConnectionListener>())
     47            listener->clientConnected(clientID);
    4848    }
    4949
    5050    void ClientConnectionListener::broadcastClientDisconnected(unsigned int clientID)
    5151    {
    52         for (ObjectList<ClientConnectionListener>::iterator it = ObjectList<ClientConnectionListener>::begin(); it != ObjectList<ClientConnectionListener>::end(); ++it)
    53             it->clientDisconnected(clientID);
     52        for (ClientConnectionListener* listener : ObjectList<ClientConnectionListener>())
     53            listener->clientDisconnected(clientID);
    5454    }
    5555
  • code/branches/cpp11_v2/src/libraries/network/Connection.cc

    r10768 r10919  
    237237  void Connection::disconnectPeersInternal()
    238238  {
    239     std::map<uint32_t, ENetPeer*>::iterator it;
    240     for( it=this->peerMap_.begin(); it!=this->peerMap_.end(); ++it )
    241     {
    242       enet_peer_disconnect(it->second, 0);
     239    for( const auto& mapEntry : this->peerMap_ )
     240    {
     241      enet_peer_disconnect(mapEntry.second, 0);
    243242    }
    244243    uint32_t iterations = NETWORK_DISCONNECT_TIMEOUT/NETWORK_WAIT_TIMEOUT;
  • code/branches/cpp11_v2/src/libraries/network/FunctionCallManager.cc

    r10918 r10919  
    5454void FunctionCallManager::sendCalls(orxonox::Host* host)
    5555{
    56   std::map<uint32_t, packet::FunctionCalls*>::iterator it;
    57   for (it = FunctionCallManager::sPeerMap_.begin(); it != FunctionCallManager::sPeerMap_.end(); ++it )
     56  for (const auto& mapEntry : FunctionCallManager::sPeerMap_ )
    5857  {
    5958    assert(!FunctionCallManager::sPeerMap_.empty());
    60     it->second->send(host);
     59    mapEntry.second->send(host);
    6160  }
    6261  FunctionCallManager::sPeerMap_.clear();
  • code/branches/cpp11_v2/src/libraries/network/GamestateManager.cc

    r10769 r10919  
    7070  {
    7171    if( this->currentGamestate_ )
    72         delete this->currentGamestate_;std::map<unsigned int, packet::Gamestate*>::iterator it;
    73     for( it = gamestateQueue.begin(); it != gamestateQueue.end(); ++it )
    74       delete it->second;
    75     std::map<uint32_t, peerInfo>::iterator peerIt;
    76     std::map<uint32_t, packet::Gamestate*>::iterator gamestateIt;
    77     for( peerIt = peerMap_.begin(); peerIt != peerMap_.end(); ++peerIt )
    78     {
    79       for( gamestateIt = peerIt->second.gamestates.begin(); gamestateIt != peerIt->second.gamestates.end(); ++gamestateIt )
    80         delete gamestateIt->second;
     72        delete this->currentGamestate_;
     73    for( const auto& mapEntry : gamestateQueue )
     74      delete mapEntry.second;
     75    for( const auto& mapEntryPeer : peerMap_ )
     76    {
     77      for( const auto& mapEntryGamestate : mapEntryPeer.second.gamestates )
     78        delete mapEntryGamestate.second;
    8179    }
    8280//     this->trafficControl_->destroy();
     
    107105    if( this->gamestateQueue.empty() )
    108106        return true;
    109     std::map<unsigned int, packet::Gamestate*>::iterator it;
    110107    // now push only the most recent gamestates we received (ignore obsolete ones)
    111     for(it = gamestateQueue.begin(); it!=gamestateQueue.end(); it++)
    112     {
    113       OrxVerify(processGamestate(it->second), "ERROR: could not process Gamestate");
    114       sendAck( it->second->getID(), it->second->getPeerID() );
    115       delete it->second;
     108    for(const auto& mapEntry : gamestateQueue)
     109    {
     110      OrxVerify(processGamestate(mapEntry.second), "ERROR: could not process Gamestate");
     111      sendAck( mapEntry.second->getID(), mapEntry.second->getPeerID() );
     112      delete mapEntry.second;
    116113    }
    117114    // now clear the queue
     
    177174    std::vector<packet::Gamestate*> peerGamestates;
    178175   
    179     std::map<uint32_t, peerInfo>::iterator peerIt;
    180     for( peerIt=peerMap_.begin(); peerIt!=peerMap_.end(); ++peerIt )
    181     {
    182       if( !peerIt->second.isSynched )
     176    for( const auto& mapEntry : peerMap_ )
     177    {
     178      if( !mapEntry.second.isSynched )
    183179      {
    184180        orxout(verbose_more, context::network) << "Server: not sending gamestate" << endl;
    185181        continue;
    186182      }
    187       orxout(verbose_more, context::network) << "client id: " << peerIt->first << endl;
     183      orxout(verbose_more, context::network) << "client id: " << mapEntry.first << endl;
    188184      orxout(verbose_more, context::network) << "Server: doing gamestate gamestate preparation" << endl;
    189       int peerID = peerIt->first; //get client id
    190 
    191       unsigned int lastAckedGamestateID = peerIt->second.lastAckedGamestateID;
     185      int peerID = mapEntry.first; //get client id
     186
     187      unsigned int lastAckedGamestateID = mapEntry.second.lastAckedGamestateID;
    192188
    193189      packet::Gamestate* baseGamestate=nullptr;
     
    340336  {
    341337    assert(peerMap_.find(peerID)!=peerMap_.end());
    342     std::map<uint32_t, packet::Gamestate*>::iterator peerIt;
    343     for( peerIt = peerMap_[peerID].gamestates.begin(); peerIt!=peerMap_[peerID].gamestates.end(); ++peerIt )
    344     {
    345       delete peerIt->second;
     338    for( const auto& mapEntry : peerMap_[peerID].gamestates )
     339    {
     340      delete mapEntry.second;
    346341    }
    347342    peerMap_.erase(peerMap_.find(peerID));
  • code/branches/cpp11_v2/src/libraries/network/Host.cc

    r10916 r10919  
    107107  void Host::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
    108108  {
    109     for (ObjectList<NetworkChatListener>::iterator it = ObjectList<NetworkChatListener>::begin(); it != ObjectList<NetworkChatListener>::end(); ++it)
    110       it->incomingChat(message, sourceID);
     109    for (NetworkChatListener* listener : ObjectList<NetworkChatListener>())
     110      listener->incomingChat(message, sourceID);
    111111  }
    112112
  • code/branches/cpp11_v2/src/libraries/network/MasterServer.cc

    r10765 r10919  
    4949  MasterServer::listServers( void )
    5050  {
    51     /* get an iterator */
    52     std::list<ServerListElem>::iterator i;
    53 
    5451    /* print list header */
    5552    orxout(user_info) << "List of connected servers" << std::endl;
    5653
    5754    /* loop through list elements */
    58     for( i = MasterServer::getInstance()->mainlist.serverlist.begin();
    59       i != MasterServer::getInstance()->mainlist.serverlist.end(); ++i )
     55    for( const ServerListElem& elem : MasterServer::getInstance()->mainlist.serverlist )
    6056    {
    61       orxout(user_info) << "  " << (*i).ServerInfo.getServerIP() << std::endl;
     57      orxout(user_info) << "  " << elem.ServerInfo.getServerIP() << std::endl;
    6258    }
    6359
     
    112108  MasterServer::helper_sendlist( ENetEvent *event )
    113109  {
    114     /* get an iterator */
    115     std::list<ServerListElem>::iterator i;
    116 
    117110    /* packet holder */
    118111    ENetPacket *reply;
    119112
    120113    /* loop through list elements */
    121     for( i = mainlist.serverlist.begin(); i
    122         != mainlist.serverlist.end(); ++i )
     114    for( const ServerListElem& elem : mainlist.serverlist )
    123115    {
    124116      /* send this particular server */
    125117      /* build reply string */
    126       int packetlen = MSPROTO_SERVERLIST_ITEM_LEN + 1 + (*i).ServerInfo.getServerIP().length() + 1 + (*i).ServerInfo.getServerName().length() + 1 + sizeof((*i).ServerInfo.getClientNumber()) + 1;
     118      int packetlen = MSPROTO_SERVERLIST_ITEM_LEN + 1 + elem.ServerInfo.getServerIP().length() + 1 + elem.ServerInfo.getServerName().length() + 1 + sizeof(elem.ServerInfo.getClientNumber()) + 1;
    127119      char *tosend = (char *)calloc(packetlen ,1 );
    128120      if( !tosend )
     
    131123      }
    132124      sprintf( tosend, "%s %s %s %u", MSPROTO_SERVERLIST_ITEM,
    133           (*i).ServerInfo.getServerIP().c_str(), (*i).ServerInfo.getServerName().c_str(), (*i).ServerInfo.getClientNumber());
     125          elem.ServerInfo.getServerIP().c_str(), elem.ServerInfo.getServerName().c_str(), elem.ServerInfo.getClientNumber());
    134126
    135127      /* create packet from it */
     
    167159  MasterServer::helper_cleanupServers( void )
    168160  {
    169     /* get an iterator */
    170     std::list<ServerListElem>::iterator i;
    171 
    172161    if( mainlist.serverlist.size() == 0 )
    173162      return;
    174163
    175164    /* loop through list elements */
    176     for( i = mainlist.serverlist.begin(); i
    177         != mainlist.serverlist.end(); ++i )
     165    for( const ServerListElem& elem : mainlist.serverlist )
    178166    { /* see if we have a disconnected peer */
    179       if( (*i).peer &&
    180          ((*i).peer->state == ENET_PEER_STATE_DISCONNECTED ||
    181           (*i).peer->state == ENET_PEER_STATE_ZOMBIE ))
     167      if( elem.peer &&
     168         (elem.peer->state == ENET_PEER_STATE_DISCONNECTED ||
     169          elem.peer->state == ENET_PEER_STATE_ZOMBIE ))
    182170      {
    183171        /* Remove it from the list */
    184         orxout(internal_warning) << (char*)(*i).peer->data << " timed out.\n";
    185         mainlist.delServerByName( (*i).ServerInfo.getServerName() );
     172        orxout(internal_warning) << (char*)elem.peer->data << " timed out.\n";
     173        mainlist.delServerByName( elem.ServerInfo.getServerName() );
    186174
    187175        /* stop iterating, we manipulated the list */
  • code/branches/cpp11_v2/src/libraries/network/PeerList.cc

    r10765 r10919  
    6565  bool
    6666  PeerList::remPeerByAddr( ENetAddress addr )
    67   { /* get an iterator */
    68     std::list<ENetPeer *>::iterator i;
    69 
     67  {
    7068    /* loop through list elements */
    71     for( i = peerlist.begin(); i != peerlist.end(); ++i )
    72       if( !sub_compAddr((*i)->address, addr ) )
     69    for( ENetPeer* peer : peerlist )
     70      if( !sub_compAddr(peer->address, addr ) )
    7371      { /* found this name, remove and quit */
    74         this->peerlist.remove( *i );
     72        this->peerlist.remove( peer );
    7573        return true;
    7674      }
     
    8280  ENetPeer *
    8381  PeerList::findPeerByAddr( ENetAddress addr )
    84   { /* get an iterator */
    85     std::list<ENetPeer *>::iterator i;
    86 
     82  {
    8783    /* loop through list elements */
    88     for( i = peerlist.begin(); i != peerlist.end(); ++i )
    89       if( !sub_compAddr((*i)->address, addr ) )
     84    for( ENetPeer* peer : peerlist )
     85      if( !sub_compAddr(peer->address, addr ) )
    9086        /* found this name, remove and quit */
    91         return *i;
     87        return peer;
    9288
    9389    /* not found */
  • code/branches/cpp11_v2/src/libraries/network/Server.cc

    r10768 r10919  
    232232  {
    233233    std::vector<packet::Gamestate*> gamestates = GamestateManager::getGamestates();
    234     std::vector<packet::Gamestate*>::iterator it;
    235     for( it = gamestates.begin(); it != gamestates.end(); ++it )
     234    for( packet::Gamestate* gamestate : gamestates )
    236235    {
    237       (*it)->send(static_cast<Host*>(this));
     236      gamestate->send(static_cast<Host*>(this));
    238237    }
    239238    return true;
     
    434433      return true;
    435434
    436     std::vector<uint32_t>::iterator it;
    437     for( it=this->clientIDs_.begin(); it!=this->clientIDs_.end(); ++it )
    438       if( *it == targetID )
     435    for( uint32_t id : this->clientIDs_ )
     436      if( id == targetID )
    439437        return true;
    440438
  • code/branches/cpp11_v2/src/libraries/network/packet/ClassID.cc

    r10769 r10919  
    5555
    5656  //calculate total needed size (for all strings and integers)
    57   std::map<std::string, Identifier*>::const_iterator it = IdentifierManager::getInstance().getIdentifierByStringMap().begin();
    58   for(;it != IdentifierManager::getInstance().getIdentifierByStringMap().end();++it){
    59     id = it->second;
     57  for(const auto& mapEntry : IdentifierManager::getInstance().getIdentifierByStringMap()){
     58    id = mapEntry.second;
    6059    if(id == nullptr || !id->hasFactory())
    6160      continue;
  • code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc

    r10918 r10919  
    213213  {
    214214    std::list<uint32_t> v1;
    215     ObjectList<Synchronisable>::iterator it;
    216     for (it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ++it)
    217     {
    218       if (it->getObjectID() == OBJECTID_UNKNOWN)
    219       {
    220         if (it->objectMode_ != 0x0)
     215    for (Synchronisable* synchronisable : ObjectList<Synchronisable>())
     216    {
     217      if (synchronisable->getObjectID() == OBJECTID_UNKNOWN)
     218      {
     219        if (synchronisable->objectMode_ != 0x0)
    221220        {
    222221          orxout(user_error, context::packets) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << endl;
    223222          orxout(user_error, context::packets) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << endl;
    224           orxout(user_error, context::packets) << "Objects class: " << it->getIdentifier()->getName() << endl;
     223          orxout(user_error, context::packets) << "Objects class: " << synchronisable->getIdentifier()->getName() << endl;
    225224          assert(false);
    226225        }
     
    228227      else
    229228      {
    230         std::list<uint32_t>::iterator it2;
    231         for (it2 = v1.begin(); it2 != v1.end(); ++it2)
     229        for (uint32_t id : v1)
    232230        {
    233           if (it->getObjectID() == *it2)
     231          if (synchronisable->getObjectID() == id)
    234232          {
    235233            orxout(user_error, context::packets) << "Found duplicate objectIDs on the client!" << endl
     
    239237          }
    240238        }
    241         v1.push_back(it->getObjectID());
     239        v1.push_back(synchronisable->getObjectID());
    242240      }
    243241    }
     
    762760  uint32_t size = 0;
    763761  uint32_t nrOfVariables = 0;
    764     // get the start of the Synchronisable list
    765   ObjectList<Synchronisable>::iterator it;
    766762    // get total size of gamestate
    767   for(it = ObjectList<Synchronisable>::begin(); it; ++it){
    768     size+=it->getSize(id, mode); // size of the actual data of the synchronisable
    769     nrOfVariables += it->getNrOfVariables();
     763  for(Synchronisable* synchronisable : ObjectList<Synchronisable>()){
     764    size+=synchronisable->getSize(id, mode); // size of the actual data of the synchronisable
     765    nrOfVariables += synchronisable->getNrOfVariables();
    770766  }
    771767//   orxout() << "allocating " << nrOfVariables << " ints" << endl;
  • code/branches/cpp11_v2/src/libraries/network/packet/ServerInformation.h

    r10857 r10919  
    5050        void          send( ENetPeer* peer );
    5151        void          setServerName(std::string name) { this->serverName_ = name; }
    52         std::string   getServerName() { return this->serverName_; }
     52        std::string   getServerName() const { return this->serverName_; }
    5353        void          setServerIP( std::string IP ) { this->serverIP_ = IP; }
    54         std::string   getServerIP() { return this->serverIP_; }
     54        std::string   getServerIP() const { return this->serverIP_; }
    5555        void          setClientNumber( int clientNumber ) { this->clientNumber_ = clientNumber; }
    56         int           getClientNumber() { return this->clientNumber_; }
    57         uint32_t      getServerRTT() { return this->serverRTT_; }
     56        int           getClientNumber() const { return this->clientNumber_; }
     57        uint32_t      getServerRTT() const { return this->serverRTT_; }
    5858
    5959      private:
  • code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc

    r10916 r10919  
    266266    assert(this->classID_==this->getIdentifier()->getNetworkID());
    267267    assert(this->objectID_!=OBJECTID_UNKNOWN);
    268     std::vector<SynchronisableVariableBase*>::iterator i;
    269268
    270269    // start copy header
     
    276275//     orxout(verbose, context::network) << "objectid: " << this->objectID_ << ":";
    277276    // copy to location
    278     for(i=syncList_.begin(); i!=syncList_.end(); ++i)
    279     {
    280       uint32_t varsize = (*i)->getData( mem, mode );
     277    for(SynchronisableVariableBase* variable : syncList_)
     278    {
     279      uint32_t varsize = variable->getData( mem, mode );
    281280//       orxout(verbose, context::network) << " " << varsize;
    282281      tempsize += varsize;
     
    348347      assert( this->getContextID() == syncHeader2.getContextID() );
    349348      mem += SynchronisableHeader::getSize();
    350       std::vector<SynchronisableVariableBase *>::iterator i;
    351       for(i=syncList_.begin(); i!=syncList_.end(); ++i)
     349      for(SynchronisableVariableBase* variable : syncList_)
    352350      {
    353351        assert( mem <= data+syncHeader2.getDataSize()+SynchronisableHeader::getSize() ); // always make sure we don't exceed the datasize in our stream
    354         (*i)->putData( mem, mode, forceCallback );
     352        variable->putData( mem, mode, forceCallback );
    355353      }
    356354      assert(mem == data+syncHeaderLight.getDataSize()+SynchronisableHeader::getSize() );
     
    388386    assert( mode==state_ );
    389387    tsize += this->dataSize_;
    390     std::vector<SynchronisableVariableBase*>::iterator i;
    391     for(i=stringList_.begin(); i!=stringList_.end(); ++i)
    392     {
    393       tsize += (*i)->getSize( mode );
     388    for(SynchronisableVariableBase* variable : stringList_)
     389    {
     390      tsize += variable->getSize( mode );
    394391    }
    395392    return tsize;
  • code/branches/cpp11_v2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc

    r10624 r10919  
    6060        float oldFactor = TimeFactorListener::timefactor_s;
    6161        TimeFactorListener::timefactor_s = factor;
    62         for (ObjectList<TimeFactorListener>::iterator it = ObjectList<TimeFactorListener>::begin(); it != ObjectList<TimeFactorListener>::end(); ++it)
    63             it->changedTimeFactor(factor, oldFactor);
     62        for (TimeFactorListener* listener : ObjectList<TimeFactorListener>())
     63            listener->changedTimeFactor(factor, oldFactor);
    6464    }
    6565
  • code/branches/cpp11_v2/src/libraries/util/Serialise.h

    r10916 r10919  
    679679    template <class T> inline void saveAndIncrease(  const std::set<T>& variable, uint8_t*& mem )
    680680    {
    681         typename std::set<T>::const_iterator it = variable.begin();
    682681        saveAndIncrease( (uint32_t)variable.size(), mem );
    683         for( ; it!=variable.end(); ++it )
    684             saveAndIncrease( *it, mem );
     682        for( const T& elem : variable )
     683            saveAndIncrease( elem, mem );
    685684    }
    686685
  • code/branches/cpp11_v2/src/modules/docking/Dock.cc

    r10916 r10919  
    214214    {
    215215        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    216         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    217         {
    218             if(it->dock(player))
     216        for(Dock* dock : ObjectList<Dock>())
     217        {
     218            if(dock->dock(player))
    219219                break;
    220220        }
     
    224224    {
    225225        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    226         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    227         {
    228             if(it->undock(player))
     226        for(Dock* dock : ObjectList<Dock>())
     227        {
     228            if(dock->undock(player))
    229229                break;
    230230        }
     
    295295        int i = 0;
    296296        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    297         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    298         {
    299             if(it->candidates_.find(player) != it->candidates_.end())
     297        for(Dock* dock : ObjectList<Dock>())
     298        {
     299            if(dock->candidates_.find(player) != dock->candidates_.end())
    300300                i++;
    301301        }
     
    306306    {
    307307        PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
    308         for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
    309         {
    310             if(it->candidates_.find(player) != it->candidates_.end())
     308        for(Dock* dock : ObjectList<Dock>())
     309        {
     310            if(dock->candidates_.find(player) != dock->candidates_.end())
    311311            {
    312312                if(index == 0)
    313                     return *it;
     313                    return dock;
    314314                index--;
    315315            }
  • code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc

    r10916 r10919  
    6565
    6666    DockingTarget *DockingEffect::findTarget(std::string name) {
    67         for (ObjectList<DockingTarget>::iterator it = ObjectList<DockingTarget>::begin(); it != ObjectList<DockingTarget>::end(); ++it)
     67        for (DockingTarget* target : ObjectList<DockingTarget>())
    6868        {
    69             if ((*it)->getName().compare(name) == 0)
    70                 return (*it);
     69            if (target->getName().compare(name) == 0)
     70                return target;
    7171        }
    7272        return nullptr;
  • code/branches/cpp11_v2/src/modules/dodgerace/DodgeRace.cc

    r10768 r10919  
    136136        if (player == nullptr)
    137137        {
    138             for (ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it)
    139             {
    140                 player = *it;
     138            for (DodgeRaceShip* ship : ObjectList<DodgeRaceShip>())
     139            {
     140                player = ship;
    141141            }
    142142        }
  • code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceShip.cc

    r10818 r10919  
    154154        if (game == nullptr)
    155155        {
    156             for (ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it)
     156            for (DodgeRace* race : ObjectList<DodgeRace>())
    157157            {
    158                 game = *it;
     158                game = race;
    159159            }
    160160        }
  • code/branches/cpp11_v2/src/modules/gametypes/SpaceRace.cc

    r9804 r10919  
    8888            this->cantMove_ = true;
    8989
    90             for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
    91                 it->setActive(false);
     90            for (Engine* engine : ObjectList<Engine>())
     91                engine->setActive(false);
    9292        }
    9393
     
    9595        if (!this->isStartCountdownRunning() && this->cantMove_)
    9696        {
    97             for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
    98                 it->setActive(true);
     97            for (Engine* engine : ObjectList<Engine>())
     98                engine->setActive(true);
    9999
    100100            this->cantMove_= false;
  • code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc

    r10917 r10919  
    6161        if (ObjectList<SpaceRaceManager>::size() != 1)
    6262            orxout(internal_warning) << "Expected 1 instance of SpaceRaceManager but found " << ObjectList<SpaceRaceManager>::size() << endl;
    63         for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it != ObjectList<SpaceRaceManager>::end(); ++it)
    64         {
    65             checkpoints = it->getAllCheckpoints();
    66             nextRaceCheckpoint_ = it->findCheckpoint(0);
     63        for (SpaceRaceManager* manager : ObjectList<SpaceRaceManager>())
     64        {
     65            checkpoints = manager->getAllCheckpoints();
     66            nextRaceCheckpoint_ = manager->findCheckpoint(0);
    6767        }
    6868
     
    187187        {
    188188            int numberOfWays = 0; // counts number of ways from this Point to the last point
    189             for (std::set<int>::iterator it = currentCheckpoint->getNextCheckpoints().begin(); it!= currentCheckpoint->getNextCheckpoints().end(); ++it)
    190             {
    191                 if (currentCheckpoint == findCheckpoint(*it))
     189            for (int checkpointIndex : currentCheckpoint->getNextCheckpoints())
     190            {
     191                if (currentCheckpoint == findCheckpoint(checkpointIndex))
    192192                {
    193193                    //orxout() << currentCheckpoint->getCheckpointIndex()<<endl;
    194194                    continue;
    195195                }
    196                 if (findCheckpoint(*it) == nullptr)
    197                     orxout(internal_warning) << "Problematic Point: " << (*it) << endl;
     196                if (findCheckpoint(checkpointIndex) == nullptr)
     197                    orxout(internal_warning) << "Problematic Point: " << checkpointIndex << endl;
    198198                else
    199                     numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(*it), zaehler);
     199                    numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(checkpointIndex), zaehler);
    200200            }
    201201            zaehler[currentCheckpoint] += numberOfWays;
     
    255255        {
    256256            float minimum = std::numeric_limits<float>::max();
    257             for (std::set<int>::iterator it = currentCheckPoint->getNextCheckpoints().begin(); it != currentCheckPoint->getNextCheckpoints().end(); ++it)
     257            for (int checkpointIndex : currentCheckPoint->getNextCheckpoints())
    258258            {
    259259                int dist_currentCheckPoint_currentPosition = static_cast<int> ((currentPosition- currentCheckPoint->getPosition()).length());
    260260
    261                 minimum = std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(*it), currentCheckPoint->getPosition()));
     261                minimum = std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(checkpointIndex), currentCheckPoint->getPosition()));
    262262                // minimum of distanz from 'currentPosition' to the next static Checkpoint
    263263            }
  • code/branches/cpp11_v2/src/modules/invader/Invader.cc

    r10768 r10919  
    9898        if (player == nullptr)
    9999        {
    100             for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it)
    101                 player = *it;
     100            for (InvaderShip* ship : ObjectList<InvaderShip>())
     101                player = ship;
    102102        }
    103103        return player;
  • code/branches/cpp11_v2/src/modules/invader/InvaderEnemy.cc

    r10818 r10919  
    7575        if (game == nullptr)
    7676        {
    77             for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
    78                 game = *it;
     77            for (Invader* invader : ObjectList<Invader>())
     78                game = invader;
    7979        }
    8080        return game;
  • code/branches/cpp11_v2/src/modules/invader/InvaderShip.cc

    r10818 r10919  
    184184        if (game == nullptr)
    185185        {
    186             for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
    187                 game = *it;
     186            for (Invader* invader : ObjectList<Invader>())
     187                game = invader;
    188188        }
    189189        return game;
  • code/branches/cpp11_v2/src/modules/jump/JumpProjectile.cc

    r10768 r10919  
    6969        Vector3 projectilePosition = getPosition();
    7070
    71         for (ObjectList<JumpEnemy>::iterator it = ObjectList<JumpEnemy>::begin(); it != ObjectList<JumpEnemy>::end(); ++it)
     71        for (JumpEnemy* enemy : ObjectList<JumpEnemy>())
    7272        {
    73             Vector3 enemyPosition = it->getPosition();
    74             float enemyWidth = it->getWidth();
    75             float enemyHeight = it->getHeight();
     73            Vector3 enemyPosition = enemy->getPosition();
     74            float enemyWidth = enemy->getWidth();
     75            float enemyHeight = enemy->getHeight();
    7676
    7777            if(projectilePosition.x > enemyPosition.x-enemyWidth && projectilePosition.x < enemyPosition.x+enemyWidth && projectilePosition.z > enemyPosition.z-enemyHeight && projectilePosition.z < enemyPosition.z+enemyHeight)
    7878            {
    79                 it->dead_ = true;
     79                enemy->dead_ = true;
    8080            }
    8181        }
  • code/branches/cpp11_v2/src/modules/objects/Attacher.cc

    r10916 r10919  
    101101            return;
    102102
    103         for (ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it != ObjectList<WorldEntity>::end(); ++it)
     103        for (WorldEntity* worldEntity : ObjectList<WorldEntity>())
    104104        {
    105             if (it->getName() == this->targetname_)
     105            if (worldEntity->getName() == this->targetname_)
    106106            {
    107                 this->target_ = *it;
    108                 this->attachToParent(*it);
     107                this->target_ = worldEntity;
     108                this->attachToParent(worldEntity);
    109109            }
    110110        }
  • code/branches/cpp11_v2/src/modules/objects/ForceField.cc

    r9945 r10919  
    118118        {
    119119            // Iterate over all objects that could possibly be affected by the ForceField.
    120             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
     120            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
    121121            {
    122122                // The direction of the orientation of the force field.
     
    125125
    126126                // Vector from the center of the force field to the object its acting on.
    127                 Vector3 distanceVector = it->getWorldPosition() - (this->getWorldPosition() + (this->halfLength_ * direction));
     127                Vector3 distanceVector = mobileEntity->getWorldPosition() - (this->getWorldPosition() + (this->halfLength_ * direction));
    128128
    129129                // The object is outside a ball around the center with radius length/2 of the ForceField.
     
    132132
    133133                // The distance of the object form the orientation vector. (Or rather the smallest distance from the orientation vector)
    134                 float distanceFromDirectionVector = ((it->getWorldPosition() - this->getWorldPosition()).crossProduct(direction)).length();
     134                float distanceFromDirectionVector = ((mobileEntity->getWorldPosition() - this->getWorldPosition()).crossProduct(direction)).length();
    135135
    136136                // If the object in a tube of radius 'radius' around the direction of orientation.
     
    140140                // Apply a force to the object in the direction of the orientation.
    141141                // The force is highest when the object is directly on the direction vector, with a linear decrease, finally reaching zero, when distanceFromDirectionVector = radius.
    142                 it->applyCentralForce((this->radius_ - distanceFromDirectionVector)/this->radius_ * this->velocity_ * direction);
     142                mobileEntity->applyCentralForce((this->radius_ - distanceFromDirectionVector)/this->radius_ * this->velocity_ * direction);
    143143            }
    144144        }
     
    146146        {
    147147            // Iterate over all objects that could possibly be affected by the ForceField.
    148             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
    149             {
    150                 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
     148            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
     149            {
     150                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
    151151                float distance = distanceVector.length();
    152152                // If the object is within 'radius' distance.
     
    155155                    distanceVector.normalise();
    156156                    // Apply a force proportional to the velocity, with highest force at the origin of the sphere, linear decreasing until reaching a distance of 'radius' from the origin, where the force reaches zero.
    157                     it->applyCentralForce((this->radius_ - distance)/this->radius_ * this->velocity_ * distanceVector);
     157                    mobileEntity->applyCentralForce((this->radius_ - distance)/this->radius_ * this->velocity_ * distanceVector);
    158158                }
    159159            }
     
    162162        {
    163163            // Iterate over all objects that could possibly be affected by the ForceField.
    164             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
    165             {
    166                 Vector3 distanceVector = this->getWorldPosition() - it->getWorldPosition();
     164            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
     165            {
     166                Vector3 distanceVector = this->getWorldPosition() - mobileEntity->getWorldPosition();
    167167                float distance = distanceVector.length();
    168168                // If the object is within 'radius' distance and no more than 'length' away from the boundary of the sphere.
     
    172172                    distanceVector.normalise();
    173173                    // Apply a force proportional to the velocity, with highest force at the boundary of the sphere, linear decreasing until reaching a distance of 'radius-length' from the origin, where the force reaches zero.
    174                     it->applyCentralForce((distance-range)/range * this->velocity_ * distanceVector);
     174                    mobileEntity->applyCentralForce((distance-range)/range * this->velocity_ * distanceVector);
    175175                }
    176176            }
     
    179179        {
    180180            // Iterate over all objects that could possibly be affected by the ForceField.
    181             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
    182             {
    183                 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
     181            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
     182            {
     183                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
    184184                float distance = distanceVector.length();
    185185                // If the object is within 'radius' distance and especially further away than massRadius_
     
    197197                   
    198198                    // Note: this so called force is actually an acceleration!
    199                     it->applyCentralForce((-1) * (ForceField::attenFactor_ * ForceField::gravConstant_ * this->getMass()) / (distance * distance) * distanceVector);
     199                    mobileEntity->applyCentralForce((-1) * (ForceField::attenFactor_ * ForceField::gravConstant_ * this->getMass()) / (distance * distance) * distanceVector);
    200200                }
    201201            }
     
    204204        {
    205205            // Iterate over all objects that could possibly be affected by the ForceField.
    206             for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
    207             {
    208                 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
     206            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
     207            {
     208                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
    209209                float distance = distanceVector.length();
    210210                if (distance < this->radius_ && distance > this->massRadius_)
     
    212212                    // Add a Acceleration in forceDirection_.
    213213                    // Vector3(0,0,0) is the direction, where the force should work.
    214                     it->addAcceleration(forceDirection_ , Vector3(0,0,0));
     214                    mobileEntity->addAcceleration(forceDirection_ , Vector3(0,0,0));
    215215                }
    216216            }
  • code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc

    r10916 r10919  
    7373    {
    7474        pawnsIn_.clear();
    75         for(ObjectList<Pawn>::iterator current = ObjectList<Pawn>::begin(); current != ObjectList<Pawn>::end(); ++current)
    76         {
    77             Pawn* currentPawn = *current;
     75        for(Pawn* currentPawn : ObjectList<Pawn>())
     76        {
    7877            if( this->reaction_ == 0 )
    7978            {
  • code/branches/cpp11_v2/src/modules/objects/controllers/TurretController.cc

    r10818 r10919  
    103103        Pawn* minScorePawn = nullptr;
    104104
    105         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
    106         {
    107             Pawn* entity = orxonox_cast<Pawn*>(*it);
    108             if (!entity || FormationController::sameTeam(turret, entity, this->getGametype()))
     105        for (Pawn* pawn : ObjectList<Pawn>())
     106        {
     107            if (!pawn || FormationController::sameTeam(turret, pawn, this->getGametype()))
    109108                continue;
    110             tempScore = turret->isInRange(entity);
     109            tempScore = turret->isInRange(pawn);
    111110            if(tempScore != -1.f)
    112111            {
     
    114113                {
    115114                    minScore = tempScore;
    116                     minScorePawn = entity;
     115                    minScorePawn = pawn;
    117116                }
    118117            }
  • code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc

    r10916 r10919  
    7070        {
    7171            bool success = false;
    72             for (std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)
     72            for (EventName* name : this->names_)
    7373            {
    74                 if ((*it)->getName() == event.name_)
     74                if (name->getName() == event.name_)
    7575                {
    7676                    success = true;
  • code/branches/cpp11_v2/src/modules/objects/eventsystem/EventListener.cc

    r9667 r10919  
    7878            return;
    7979
    80         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    81             if (it->getName() == this->eventName_)
    82                 this->addEventSource(*it, "");
     80        for (BaseObject* object : ObjectList<BaseObject>())
     81            if (object->getName() == this->eventName_)
     82                this->addEventSource(object, "");
    8383    }
    8484
  • code/branches/cpp11_v2/src/modules/objects/eventsystem/EventTarget.cc

    r9667 r10919  
    7373        this->target_ = name;
    7474
    75         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    76             if (it->getName() == this->target_)
    77                 this->addEventTarget(*it);
     75        for (BaseObject* object : ObjectList<BaseObject>())
     76            if (object->getName() == this->target_)
     77                this->addEventTarget(object);
    7878    }
    7979
  • code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc

    r10916 r10919  
    346346    {
    347347        // Iterate over all Triggers.
    348         for (ObjectList<Trigger>::iterator it = ObjectList<Trigger>::begin(); it != ObjectList<Trigger>::end(); ++it)
    349             it->setVisible(bVisible);
     348        for (Trigger* trigger : ObjectList<Trigger>())
     349            trigger->setVisible(bVisible);
    350350    }
    351351
  • code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc

    r10917 r10919  
    165165    {
    166166        const std::set<RadarViewable*>& objectSet = this->getCreator()->getScene()->getRadar()->getRadarObjects();
    167         std::set<RadarViewable*>::const_iterator it;
    168         for( it=objectSet.begin(); it!=objectSet.end(); ++it )
    169             this->addObject(*it);
     167        for( RadarViewable* viewable : objectSet )
     168            this->addObject(viewable);
    170169        this->radarTick(0);
    171170    }
     
    183182
    184183        // update the distances for all objects
    185         std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it;
    186 
    187184
    188185        if(RadarMode_)
     
    201198        }
    202199
    203         for( it = this->radarObjects_.begin(); it != this->radarObjects_.end(); ++it )
     200        for( const auto& mapEntry : this->radarObjects_ )
    204201        {
    205202            // Make sure the object really is a WorldEntity
    206             const WorldEntity* wePointer = it->first->getWorldEntity();
     203            const WorldEntity* wePointer = mapEntry.first->getWorldEntity();
    207204            if( !wePointer )
    208205            {
     
    210207                assert(0);
    211208            }
    212             bool isFocus = (it->first == focusObject);
     209            bool isFocus = (mapEntry.first == focusObject);
    213210            // set size to fit distance...
    214211            float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length();
     
    217214            float size;
    218215            if(RadarMode_)
    219                 size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
     216                size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * mapEntry.first->getRadarObjectScale();
    220217            else
    221                 size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
    222             it->second->setDimensions(size, size);
     218                size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * mapEntry.first->getRadarObjectScale();
     219            mapEntry.second->setDimensions(size, size);
    223220
    224221            // calc position on radar...
     
    234231                int zOrder = determineMap3DZOrder(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), detectionLimit_);
    235232                if(overXZPlain == false /*&& (it->second->getZOrder() >  100 * this->overlay_->getZOrder())*/) // it appears that zOrder of attached Overlayelements is 100 times the zOrder of the Overlay
    236                     it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder);
     233                    mapEntry.second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder);
    237234                if(overXZPlain == true /*&& (it->second->getZOrder() <= 100 * this->overlay_->getZOrder())*/)
    238                     it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);
     235                    mapEntry.second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);
    239236            }
    240237            else
     
    242239
    243240            coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
    244             it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
     241            mapEntry.second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
    245242
    246243            if( distance < detectionLimit_ || detectionLimit_ < 0 )
    247                 it->second->show();
     244                mapEntry.second->show();
    248245            else
    249                 it->second->hide();
     246                mapEntry.second->hide();
    250247
    251248            // if this object is in focus, then set the focus marker
     
    255252                this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f);
    256253                if(RadarMode_)
    257                     this->marker_->_notifyZOrder(it->second->getZOrder() -1);
     254                    this->marker_->_notifyZOrder(mapEntry.second->getZOrder() -1);
    258255                this->marker_->show();
    259256            }
  • code/branches/cpp11_v2/src/modules/pickup/PickupSpawner.cc

    r10765 r10919  
    158158
    159159            // Iterate trough all Pawns.
    160             for(ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     160            for(Pawn* pawn : ObjectList<Pawn>())
    161161            {
    162162                if(spawner == nullptr) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute).
    163163                    break;
    164164
    165                 Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
    166                 PickupCarrier* carrier = static_cast<PickupCarrier*>(*it);
     165                Vector3 distance = pawn->getWorldPosition() - this->getWorldPosition();
     166                PickupCarrier* carrier = static_cast<PickupCarrier*>(pawn);
    167167                // If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawner, is in trigger-distance and the carrier is not blocked.
    168168                if(distance.length() < this->triggerDistance_ && carrier != nullptr && this->blocked_.find(carrier) == this->blocked_.end())
    169169                {
    170170                    if(carrier->isTarget(this->pickup_))
    171                         this->trigger(*it);
     171                        this->trigger(pawn);
    172172                }
    173173            }
  • code/branches/cpp11_v2/src/modules/tetris/Tetris.cc

    r10917 r10919  
    136136            return false;
    137137
    138         for(std::list<StrongPtr<TetrisStone>>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
    139         {
    140             const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     138        for(TetrisStone* someStone : this->stones_)
     139        {
     140            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    141141
    142142            if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
     
    192192
    193193        // check for collisions with all stones
    194         for(std::list<StrongPtr<TetrisStone>>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
     194        for(TetrisStone* someStone : this->stones_)
    195195        {
    196196            //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
    197             const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
     197            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    198198
    199199            //filter out cases where the falling stone is already below a steady stone
  • code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseEnemy.cc

    r10818 r10919  
    4949        if (game == nullptr)
    5050        {
    51             for (ObjectList<TowerDefense>::iterator it = ObjectList<TowerDefense>::begin(); it != ObjectList<TowerDefense>::end(); ++it)
    52                 game = *it;
     51            for (TowerDefense* towerDefense : ObjectList<TowerDefense>())
     52                game = towerDefense;
    5353        }
    5454        return game;
  • code/branches/cpp11_v2/src/modules/weapons/projectiles/GravityBombField.cc

    r10765 r10919  
    125125
    126126            //Check if any pawn is inside the shockwave and hit it with dammage proportional to the distance between explosion centre and pawn. Make sure, the same pawn is damaged only once.
    127             for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     127            for (Pawn* pawn : ObjectList<Pawn>())
    128128            {
    129                 Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
     129                Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition();
    130130                 //orxout(debug_output) << "Found Pawn:" << it->getWorldPosition() << endl;
    131131                if(distanceVector.length()< forceSphereRadius_)
    132132                {
    133133                    //orxout(debug_output) << "Force sphere radius is: " << forceSphereRadius_ << " Distance to Pawn is: " << distanceVector.length();
    134                     if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),*it) == victimsAlreadyDamaged_.end())
     134                    if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),pawn) == victimsAlreadyDamaged_.end())
    135135                    {
    136136                        //orxout(debug_output) << "Found Pawn to damage: " << it->getWorldPosition() << endl;
    137137                        float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS);
    138138                        //orxout(debug_output) << "Damage: " << damage << endl;
    139                         it->hit(shooter_, it->getWorldPosition(), nullptr, damage, 0,0);
    140                         victimsAlreadyDamaged_.push_back(*it);
     139                        pawn->hit(shooter_, pawn->getWorldPosition(), nullptr, damage, 0,0);
     140                        victimsAlreadyDamaged_.push_back(pawn);
    141141                    }
    142142                }
  • code/branches/cpp11_v2/src/orxonox/LevelManager.cc

    r10916 r10919  
    7878    {
    7979        // Delete all the LevelInfoItem objects because the LevelManager created them
    80         std::set<LevelInfoItem*, LevelInfoCompare>::iterator it = availableLevels_.begin();
    81         for (; it != availableLevels_.end(); ++it)
    82             delete *it;
     80        for (LevelInfoItem* info : availableLevels_)
     81            delete info;
    8382    }
    8483
     
    279278
    280279                // Find the LevelInfo object we've just loaded (if there was one)
    281                 for(ObjectList<LevelInfo>::iterator item = ObjectList<LevelInfo>::begin(); item != ObjectList<LevelInfo>::end(); ++item)
    282                     if(item->getXMLFilename() == *it)
    283                         info = item->copy();
     280                for(LevelInfo* levelInfo : ObjectList<LevelInfo>())
     281                    if(levelInfo->getXMLFilename() == *it)
     282                        info = levelInfo->copy();
    284283
    285284                // We don't need the loaded stuff anymore
  • code/branches/cpp11_v2/src/orxonox/MoodManager.cc

    r10624 r10919  
    103103    /*static*/ void MoodListener::changedMood(const std::string& mood)
    104104    {
    105         for (ObjectList<MoodListener>::iterator it = ObjectList<MoodListener>::begin(); it; ++it)
    106             it->moodChanged(mood);
     105        for (MoodListener* listener : ObjectList<MoodListener>())
     106            listener->moodChanged(mood);
    107107    }
    108108}
  • code/branches/cpp11_v2/src/orxonox/PlayerManager.cc

    r10768 r10919  
    111111        else
    112112        {
    113             for (ObjectList<PlayerInfo>::iterator it = ObjectList<PlayerInfo>::begin(); it != ObjectList<PlayerInfo>::end(); ++it)
    114                 if (it->getClientID() == clientID)
    115                     return (*it);
     113            for (PlayerInfo* info : ObjectList<PlayerInfo>())
     114                if (info->getClientID() == clientID)
     115                    return info;
    116116        }
    117117        return nullptr;
  • code/branches/cpp11_v2/src/orxonox/Radar.cc

    r10768 r10919  
    8484        this->radarObjects_.insert(rv);
    8585        // iterate through all radarlisteners and notify them
    86         for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
    87         {
    88             (*itListener)->addObject(rv);
     86        for (RadarListener* listener : ObjectList<RadarListener>())
     87        {
     88            listener->addObject(rv);
    8989        }
    9090    }
     
    9595        this->radarObjects_.erase(rv);
    9696        // iterate through all radarlisteners and notify them
    97         for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
    98         {
    99             (*itListener)->removeObject(rv);
     97        for (RadarListener* listener : ObjectList<RadarListener>())
     98        {
     99            listener->removeObject(rv);
    100100        }
    101101    }
     
    130130        }
    131131
    132         for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
    133         {
    134             (*itListener)->radarTick(dt);
     132        for (RadarListener* listener : ObjectList<RadarListener>())
     133        {
     134            listener->radarTick(dt);
    135135        }
    136136    }
     
    200200        // iterate through all Radar Objects
    201201        unsigned int i = 0;
    202         for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it, ++i)
    203         {
    204             orxout(debug_output) << i++ << ": " << (*it)->getRVWorldPosition() << endl;
     202        for (RadarViewable* viewable : ObjectList<RadarViewable>())
     203        {
     204            orxout(debug_output) << i++ << ": " << viewable->getRVWorldPosition() << endl;
     205            ++i;
    205206        }
    206207    }
     
    208209    void Radar::radarObjectChanged(RadarViewable* rv)
    209210    {
    210         for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
    211         {
    212           (*itListener)->objectChanged(rv);
     211        for (RadarListener* listener : ObjectList<RadarListener>())
     212        {
     213            listener->objectChanged(rv);
    213214        }
    214215    }
  • code/branches/cpp11_v2/src/orxonox/Scene.cc

    r10916 r10919  
    389389    /*static*/ void Scene::consoleCommand_debugDrawPhysics(bool bDraw, bool bFill, float fillAlpha)
    390390    {
    391         for (ObjectListIterator<Scene> it = ObjectList<Scene>::begin(); it != ObjectList<Scene>::end(); ++it)
    392             it->setDebugDrawPhysics(bDraw, bFill, fillAlpha);
     391        for (Scene* scene : ObjectList<Scene>())
     392            scene->setDebugDrawPhysics(bDraw, bFill, fillAlpha);
    393393    }
    394394}
  • code/branches/cpp11_v2/src/orxonox/chat/ChatHistory.cc

    r10818 r10919  
    160160  void ChatHistory::debug_printhist()
    161161  {
    162     /* create deque iterator */
    163     std::deque<std::string>::iterator it;
    164 
    165162    /* output all the strings */
    166     for( it = this->hist_buffer.begin(); it != this->hist_buffer.end();
    167       ++it )
    168       orxout(debug_output) << *it << endl;
     163    for( const std::string& hist : this->hist_buffer )
     164      orxout(debug_output) << hist << endl;
    169165
    170166    /* output size */
  • code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc

    r10917 r10919  
    200200        bool bEmpty = true; // Whether the CompoundCollisionShape is empty.
    201201        // Iterate over all CollisionShapes that belong to this CompoundCollisionShape.
    202         for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->attachedShapes_.begin(); it != this->attachedShapes_.end(); ++it)
     202        for (const auto& mapEntry : this->attachedShapes_)
    203203        {
    204204            // TODO: Make sure this is correct.
    205             if (it->second)
     205            if (mapEntry.second)
    206206            {
    207207                bEmpty = false;
    208                 if (!it->first->hasTransform() && bPrimitive)
    209                     primitive = it->second;
     208                if (!mapEntry.first->hasTransform() && bPrimitive)
     209                    primitive = mapEntry.second;
    210210                else
    211211                {
  • code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc

    r10916 r10919  
    9797            this->removeFromFormation();
    9898
    99             for (ObjectList<FormationController>::iterator it = ObjectList<FormationController>::begin(); it; ++it)
    100             {
    101                 if (*it != this)
     99            for (FormationController* controller : ObjectList<FormationController>())
     100            {
     101                if (controller != this)
    102102                {
    103                     if (it->myMaster_ == this)
     103                    if (controller->myMaster_ == this)
    104104                    {
    105                         orxout(internal_error) << this << " is still master in " << (*it) << endl;
    106                         it->myMaster_ = nullptr;
     105                        orxout(internal_error) << this << " is still master in " << controller << endl;
     106                        controller->myMaster_ = nullptr;
    107107                    }
    108108
    109109                    while (true)
    110110                    {
    111                         std::vector<FormationController*>::iterator it2 = std::find(it->slaves_.begin(), it->slaves_.end(), this);
    112                         if (it2 != it->slaves_.end())
     111                        std::vector<FormationController*>::iterator it2 = std::find(controller->slaves_.begin(), controller->slaves_.end(), this);
     112                        if (it2 != controller->slaves_.end())
    113113                        {
    114                             orxout(internal_error) << this << " is still slave in " << (*it) << endl;
    115                             it->slaves_.erase(it2);
     114                            orxout(internal_error) << this << " is still slave in " << controller << endl;
     115                            controller->slaves_.erase(it2);
    116116                        }
    117117                        else
     
    140140    void FormationController::formationflight(const bool form)
    141141    {
    142         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
     142        for (Pawn* pawn : ObjectList<Pawn>())
    143143        {
    144144            Controller* controller = nullptr;
    145145
    146             if (it->getController())
    147                 controller = it->getController();
    148             else if (it->getXMLController())
    149                 controller = it->getXMLController();
     146            if (pawn->getController())
     147                controller = pawn->getController();
     148            else if (pawn->getXMLController())
     149                controller = pawn->getXMLController();
    150150
    151151            if (!controller)
     
    171171    void FormationController::masteraction(const int action)
    172172    {
    173         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
     173        for (Pawn* pawn : ObjectList<Pawn>())
    174174        {
    175175            Controller* controller = nullptr;
    176176
    177             if (it->getController())
    178                 controller = it->getController();
    179             else if (it->getXMLController())
    180                 controller = it->getXMLController();
     177            if (pawn->getController())
     178                controller = pawn->getController();
     179            else if (pawn->getXMLController())
     180                controller = pawn->getXMLController();
    181181
    182182            if (!controller)
     
    201201    void FormationController::passivebehaviour(const bool passive)
    202202    {
    203         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
     203        for (Pawn* pawn : ObjectList<Pawn>())
    204204        {
    205205            Controller* controller = nullptr;
    206206
    207             if (it->getController())
    208                 controller = it->getController();
    209             else if (it->getXMLController())
    210                 controller = it->getXMLController();
     207            if (pawn->getController())
     208                controller = pawn->getController();
     209            else if (pawn->getXMLController())
     210                controller = pawn->getXMLController();
    211211
    212212            if (!controller)
     
    228228    void FormationController::formationsize(const int size)
    229229    {
    230         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
     230        for (Pawn* pawn : ObjectList<Pawn>())
    231231        {
    232232            Controller* controller = nullptr;
    233233
    234             if (it->getController())
    235                 controller = it->getController();
    236             else if (it->getXMLController())
    237                 controller = it->getXMLController();
     234            if (pawn->getController())
     235                controller = pawn->getController();
     236            else if (pawn->getXMLController())
     237                controller = pawn->getXMLController();
    238238
    239239            if (!controller)
     
    398398        int teamSize = 0;
    399399        //go through all pawns
    400         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
     400        for (Pawn* pawn : ObjectList<Pawn>())
    401401        {
    402402
     
    405405            if (!gt)
    406406            {
    407                 gt=it->getGametype();
    408             }
    409             if (!FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it),gt))
     407                gt=pawn->getGametype();
     408            }
     409            if (!FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(pawn),gt))
    410410                continue;
    411411
     
    413413            Controller* controller = nullptr;
    414414
    415             if (it->getController())
    416                 controller = it->getController();
    417             else if (it->getXMLController())
    418                 controller = it->getXMLController();
     415            if (pawn->getController())
     416                controller = pawn->getController();
     417            else if (pawn->getXMLController())
     418                controller = pawn->getXMLController();
    419419
    420420            if (!controller)
     
    422422
    423423            //is pawn oneself?
    424             if (orxonox_cast<ControllableEntity*>(*it) == this->getControllableEntity())
     424            if (orxonox_cast<ControllableEntity*>(pawn) == this->getControllableEntity())
    425425                continue;
    426426
     
    433433                continue;
    434434
    435             float distance = (it->getPosition() - this->getControllableEntity()->getPosition()).length();
     435            float distance = (pawn->getPosition() - this->getControllableEntity()->getPosition()).length();
    436436
    437437            // is pawn in range?
     
    520520            newMaster->myMaster_ = nullptr;
    521521
    522             for(std::vector<FormationController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++)
    523             {
    524                 (*it)->myMaster_ = newMaster;
     522            for(FormationController* slave : newMaster->slaves_)
     523            {
     524                slave->myMaster_ = newMaster;
    525525            }
    526526        }
     
    549549                newMaster->myMaster_ = nullptr;
    550550
    551                 for(std::vector<FormationController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++)
     551                for(FormationController* slave : newMaster->slaves_)
    552552                {
    553                     (*it)->myMaster_ = newMaster;
     553                    slave->myMaster_ = newMaster;
    554554                }
    555555            }
     
    777777        std::vector<FormationController*> allMasters;
    778778
    779         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
     779        for (Pawn* pawn : ObjectList<Pawn>())
    780780        {
    781781            Controller* controller = nullptr;
    782782
    783             if (it->getController())
    784                 controller = it->getController();
    785             else if (it->getXMLController())
    786                 controller = it->getXMLController();
     783            if (pawn->getController())
     784                controller = pawn->getController();
     785            else if (pawn->getXMLController())
     786                controller = pawn->getXMLController();
    787787
    788788            if (!controller)
     
    791791            currentHumanController = orxonox_cast<NewHumanController*>(controller);
    792792
    793             if(currentHumanController) humanPawn = *it;
     793            if(currentHumanController) humanPawn = pawn;
    794794
    795795            FormationController *aiController = orxonox_cast<FormationController*>(controller);
     
    808808            int i = 0;
    809809
    810             for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
    811             {
    812                 if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
    813                 distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
     810            for(FormationController* master : allMasters)
     811            {
     812                if (!FormationController::sameTeam(master->getControllableEntity(), humanPawn, master->getGametype())) continue;
     813                distance = posHuman - master->getControllableEntity()->getPosition().length();
    814814                if(distance < minDistance) index = i;
     815                i++;
    815816            }
    816817            allMasters[index]->followInit(humanPawn);
     
    847848        NewHumanController *currentHumanController = nullptr;
    848849
    849         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
    850         {
    851             if (!it->getController())
    852                 continue;
    853 
    854             currentHumanController = orxonox_cast<NewHumanController*>(it->getController());
     850        for (Pawn* pawn : ObjectList<Pawn>())
     851        {
     852            if (!pawn->getController())
     853                continue;
     854
     855            currentHumanController = orxonox_cast<NewHumanController*>(pawn->getController());
    855856            if(currentHumanController)
    856857            {
    857                 if (!FormationController::sameTeam(this->getControllableEntity(), *it, this->getGametype())) continue;
    858                 humanPawn = *it;
     858                if (!FormationController::sameTeam(this->getControllableEntity(), pawn, this->getGametype())) continue;
     859                humanPawn = pawn;
    859860                break;
    860861            }
     
    918919        this->forgetTarget();
    919920
    920         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
    921         {
    922             if (FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
     921        for (Pawn* pawn : ObjectList<Pawn>())
     922        {
     923            if (FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(pawn), this->getGametype()))
    923924                continue;
    924925
    925926            /* So AI won't choose invisible Spaceships as target */
    926             if (!it->getRadarVisibility())
    927                 continue;
    928 
    929             if (static_cast<ControllableEntity*>(*it) != this->getControllableEntity())
     927            if (!pawn->getRadarVisibility())
     928                continue;
     929
     930            if (static_cast<ControllableEntity*>(pawn) != this->getControllableEntity())
    930931            {
    931932                float speed = this->getControllableEntity()->getVelocity().length();
    932933                Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition();
    933                 Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition();
    934                 if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi)
     934                Vector3 distanceNew = pawn->getPosition() - this->getControllableEntity()->getPosition();
     935                if (!this->target_ || pawn->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi)
    935936                        < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / math::twoPi) + rnd(-250, 250))
    936937                {
    937                     this->setTarget(*it);
     938                    this->setTarget(pawn);
    938939                }
    939940            }
  • code/branches/cpp11_v2/src/orxonox/controllers/ScriptController.cc

    r10765 r10919  
    121121
    122122      /* Debugging: print all the scriptcontroller object pointers */
    123       for(ObjectList<ScriptController>::iterator it =
    124         ObjectList<ScriptController>::begin();
    125         it != ObjectList<ScriptController>::end(); ++it)
    126       { orxout(verbose) << "Have object in list: " << *it << endl; }
     123      for(ScriptController* controller : ObjectList<ScriptController>())
     124      { orxout(verbose) << "Have object in list: " << controller << endl; }
    127125
    128126      /* Find the first one with a nonzero ID */
    129       for(ObjectList<ScriptController>::iterator it =
    130         ObjectList<ScriptController>::begin();
    131         it != ObjectList<ScriptController>::end(); ++it)
     127      for(ScriptController* controller : ObjectList<ScriptController>())
    132128      {
    133129        // TODO: do some selection here. Currently just returns the first one
    134         if( (*it)->getID() > 0 )
    135         { orxout(verbose) << "Controller to return: " << *it << endl;
    136           return *it;
     130        if( controller->getID() > 0 )
     131        { orxout(verbose) << "Controller to return: " << controller << endl;
     132          return controller;
    137133        }
    138134     
  • code/branches/cpp11_v2/src/orxonox/controllers/WaypointPatrolController.cc

    r10768 r10919  
    8787        float shortestsqdistance = (float)static_cast<unsigned int>(-1);
    8888
    89         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     89        for (Pawn* pawn : ObjectList<Pawn>())
    9090        {
    91             if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
     91            if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(pawn), this->getGametype()))
    9292                continue;
    9393
    94             float sqdistance = it->getPosition().squaredDistance(myposition);
     94            float sqdistance = pawn->getPosition().squaredDistance(myposition);
    9595            if (sqdistance < shortestsqdistance)
    9696            {
    9797                shortestsqdistance = sqdistance;
    98                 this->target_ = (*it);
     98                this->target_ = pawn;
    9999            }
    100100        }
  • code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc

    r10916 r10919  
    164164        // Note: Temporarily moved to GSRoot.
    165165        //// Call the scene objects
    166         //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
    167         //    it->tick(time.getDeltaTime() * this->timeFactor_);
     166        //for (Tickable* tickable : ObjectList<Tickable>())
     167        //    tickable->tick(time.getDeltaTime() * this->timeFactor_);
    168168    }
    169169
    170170    void GSLevel::prepareObjectTracking()
    171171    {
    172         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    173             this->staticObjects_.insert(*it);
     172        for (BaseObject* baseObject : ObjectList<BaseObject>())
     173            this->staticObjects_.insert(baseObject);
    174174    }
    175175
     
    178178        orxout(internal_info) << "Remaining objects:" << endl;
    179179        unsigned int i = 0;
    180         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
    181         {
    182             std::set<BaseObject*>::const_iterator find = this->staticObjects_.find(*it);
     180        for (BaseObject* baseObject : ObjectList<BaseObject>())
     181        {
     182            std::set<BaseObject*>::const_iterator find = this->staticObjects_.find(baseObject);
    183183            if (find == this->staticObjects_.end())
    184184            {
    185                 orxout(internal_warning) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl;
     185                orxout(internal_warning) << ++i << ": " << baseObject->getIdentifier()->getName() << " (" << baseObject << "), references: " << baseObject->getReferenceCount() << endl;
    186186            }
    187187        }
     
    235235        // export all states
    236236        std::vector<GSLevelMementoState*> states;
    237         for (ObjectList<GSLevelMemento>::iterator it = ObjectList<GSLevelMemento>::begin(); it != ObjectList<GSLevelMemento>::end(); ++it)
    238         {
    239             GSLevelMementoState* state = it->exportMementoState();
     237        for (GSLevelMemento* memento : ObjectList<GSLevelMemento>())
     238        {
     239            GSLevelMementoState* state = memento->exportMementoState();
    240240            if (state)
    241241                states.push_back(state);
     
    247247
    248248        // import all states
    249         for (ObjectList<GSLevelMemento>::iterator it = ObjectList<GSLevelMemento>::begin(); it != ObjectList<GSLevelMemento>::end(); ++it)
    250             it->importMementoState(states);
     249        for (GSLevelMemento* memento : ObjectList<GSLevelMemento>())
     250            memento->importMementoState(states);
    251251
    252252        // delete states
  • code/branches/cpp11_v2/src/orxonox/gamestates/GSRoot.cc

    r10818 r10919  
    7474    {
    7575        unsigned int nr=0;
    76         for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it)
    77         {
    78             Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(*it);
     76        for (BaseObject* baseObject : ObjectList<BaseObject>())
     77        {
     78            Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(baseObject);
    7979            if (synchronisable)
    80                 orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
     80                orxout(debug_output) << "object: " << baseObject->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
    8181            else
    82                 orxout(debug_output) << "object: " << it->getIdentifier()->getName() << endl;
     82                orxout(debug_output) << "object: " << baseObject->getIdentifier()->getName() << endl;
    8383            nr++;
    8484        }
  • code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc

    r10917 r10919  
    571571        // find correct scene
    572572        Scene* scene = nullptr;
    573         for (ObjectList<Scene>::iterator it = ObjectList<Scene>::begin(); it != ObjectList<Scene>::end(); ++it)
    574         {
    575             if (it->getName() == state->sceneName_)
    576             {
    577                 scene = *it;
     573        for (Scene* someScene : ObjectList<Scene>())
     574        {
     575            if (someScene->getName() == state->sceneName_)
     576            {
     577                scene = someScene;
    578578                break;
    579579            }
  • code/branches/cpp11_v2/src/orxonox/gametypes/Mission.cc

    r10624 r10919  
    101101    void Mission::setTeams()
    102102    { //Set pawn-colours
    103         for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
     103        for (Pawn* pawn : ObjectList<Pawn>())
    104104        {
    105             Pawn* pawn = static_cast<Pawn*>(*it);
    106105            if (!pawn)
    107106                continue;
     
    111110    void Mission::endMission(bool accomplished)
    112111    {
    113         for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
     112        for (Mission* mission : ObjectList<Mission>())
    114113        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
    115             it->setMissionAccomplished(accomplished);
    116             it->end();
     114            mission->setMissionAccomplished(accomplished);
     115            mission->end();
    117116        }
    118117    }
     
    120119    void Mission::setLivesWrapper(unsigned int amount)
    121120    {
    122         for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
     121        for (Mission* mission : ObjectList<Mission>())
    123122        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
    124             it->setLives(amount);
     123            mission->setLives(amount);
    125124        }
    126125    }
  • code/branches/cpp11_v2/src/orxonox/infos/GametypeInfo.cc

    r10624 r10919  
    461461    void GametypeInfo::dispatchAnnounceMessage(const std::string& message) const
    462462    {
    463         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    464             it->announcemessage(this, message);
     463        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     464            listener->announcemessage(this, message);
    465465    }
    466466
    467467    void GametypeInfo::dispatchKillMessage(const std::string& message) const
    468468    {
    469         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    470             it->killmessage(this, message);
     469        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     470            listener->killmessage(this, message);
    471471    }
    472472
    473473    void GametypeInfo::dispatchDeathMessage(const std::string& message) const
    474474    {
    475         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    476             it->deathmessage(this, message);
     475        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     476            listener->deathmessage(this, message);
    477477    }
    478478
    479479     void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour) const
    480480    {
    481         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    482             it->staticmessage(this, message, colour);
     481        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     482            listener->staticmessage(this, message, colour);
    483483    }
    484484
    485485     void GametypeInfo::dispatchFadingMessage(const std::string& message) const
    486486    {
    487         for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
    488             it->fadingmessage(this, message);
     487        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
     488            listener->fadingmessage(this, message);
    489489    }
    490490}
  • code/branches/cpp11_v2/src/orxonox/interfaces/NotificationListener.cc

    r10624 r10919  
    108108    {
    109109        // Iterate through all NotificationListeners and notify them by calling the method they overloaded.
    110         for(ObjectList<NotificationListener>::iterator it = ObjectList<NotificationListener>::begin(); it != ObjectList<NotificationListener>::end(); ++it)
     110        for(NotificationListener* listener : ObjectList<NotificationListener>())
    111111        {
    112112            // If the notification is a message.
    113113            if(!isCommand)
    114                 it->registerNotification(message, sender, notificationMessageType::Value(messageType));
     114                listener->registerNotification(message, sender, notificationMessageType::Value(messageType));
    115115
    116116            // If the notification is a command.
     
    119119                notificationCommand::Value command = str2Command(message);
    120120                if(command != notificationCommand::none)
    121                     it->executeCommand(command, sender);
     121                    listener->executeCommand(command, sender);
    122122            }
    123123        }
  • code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc

    r10916 r10919  
    101101        // Go recursively through all children to check whether they are a target.
    102102        std::vector<PickupCarrier*>* children = this->getCarrierChildren();
    103         for(std::vector<PickupCarrier*>::const_iterator it = children->begin(); it != children->end(); it++)
     103        for(PickupCarrier* carrier : *children)
    104104        {
    105             if((*it)->isTarget(pickup))
     105            if(carrier->isTarget(pickup))
    106106            {
    107107                isTarget = true;
  • code/branches/cpp11_v2/src/orxonox/interfaces/PickupListener.cc

    r10624 r10919  
    7474
    7575        // Iterate through all PickupListeners and notify them by calling the method they overloaded.
    76         for(ObjectList<PickupListener>::iterator it = ObjectList<PickupListener>::begin(); it != ObjectList<PickupListener>::end(); ++it)
    77             it->pickupChangedUsed(pickup, used);
     76        for(PickupListener* listener : ObjectList<PickupListener>())
     77            listener->pickupChangedUsed(pickup, used);
    7878    }
    7979
     
    9292
    9393        // Iterate through all PickupListeners and notify them by calling the method they overloaded.
    94         for(ObjectList<PickupListener>::iterator it = ObjectList<PickupListener>::begin(); it != ObjectList<PickupListener>::end(); ++it)
    95             it->pickupChangedPickedUp(pickup, pickedUp);
     94        for(PickupListener* listener : ObjectList<PickupListener>())
     95            listener->pickupChangedPickedUp(pickup, pickedUp);
    9696    }
    9797
  • code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc

    r10916 r10919  
    8585            {
    8686                // We have no ship, so the effects are not attached and won't be destroyed automatically
    87                 for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
    88                     for (std::vector<WorldEntity*>::const_iterator it2 = (*it)->getEffectsBegin(); it2 != (*it)->getEffectsBegin(); ++it2)
    89                         (*it2)->destroy();
     87                for (EffectContainer* container : this->effectContainers_)
     88                    for (std::vector<WorldEntity*>::const_iterator it = container->getEffectsBegin(); it != container->getEffectsBegin(); ++it)
     89                        (*it)->destroy();
    9090                if (this->defEngineSndNormal_)
    9191                    this->defEngineSndNormal_->destroy();
     
    178178
    179179                // Update all effect conditions
    180                 for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
    181                     (*it)->updateCondition();
     180                for (EffectContainer* container : this->effectContainers_)
     181                    container->updateCondition();
    182182            }
    183183        }
     
    198198            this->getShip()->attach(defEngineSndBoost_);
    199199
    200         for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
    201             for (std::vector<WorldEntity*>::const_iterator it2 = (*it)->getEffectsBegin(); it2 != (*it)->getEffectsEnd(); ++it2)
    202                 this->getShip()->attach(*it2);
     200        for (EffectContainer* container : this->effectContainers_)
     201            for (std::vector<WorldEntity*>::const_iterator it = container->getEffectsBegin(); it != container->getEffectsEnd(); ++it)
     202                this->getShip()->attach(*it);
    203203    }
    204204
  • code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc

    r10916 r10919  
    170170    /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
    171171    {
    172         for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
    173         {
    174             if ((*it)->getName() == name)
    175                 (*it)->setVisible(!((*it)->isVisible()));
     172        for (OverlayGroup* group : ObjectList<OverlayGroup>())
     173        {
     174            if (group->getName() == name)
     175                group->setVisible(!(group->isVisible()));
    176176        }
    177177    }
     
    185185    /*static*/ void OverlayGroup::show(const std::string& name)
    186186    {
    187         for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
    188         {
    189             if ((*it)->getName() == name)
     187        for (OverlayGroup* group : ObjectList<OverlayGroup>())
     188        {
     189            if (group->getName() == name)
    190190            {
    191                 if((*it)->isVisible())
    192                     (*it)->changedVisibility();
     191                if(group->isVisible())
     192                    group->changedVisibility();
    193193                else
    194                     (*it)->setVisible(!((*it)->isVisible()));
     194                    group->setVisible(!(group->isVisible()));
    195195            }
    196196        }
     
    208208    /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale)
    209209    {
    210         for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
    211         {
    212             if ((*it)->getName() == name)
    213                 (*it)->scale(Vector2(scale, scale));
     210        for (OverlayGroup* group : ObjectList<OverlayGroup>())
     211        {
     212            if (group->getName() == name)
     213                group->scale(Vector2(scale, scale));
    214214        }
    215215    }
     
    226226    /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll)
    227227    {
    228         for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
    229         {
    230             if ((*it)->getName() == name)
    231                 (*it)->scroll(scroll);
     228        for (OverlayGroup* group : ObjectList<OverlayGroup>())
     229        {
     230            if (group->getName() == name)
     231                group->scroll(scroll);
    232232        }
    233233    }
  • code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc

    r10918 r10919  
    294294        {
    295295        case SoundType::All:
    296             for (ObjectList<BaseSound>::iterator it = ObjectList<BaseSound>::begin(); it != ObjectList<BaseSound>::end(); ++it)
    297                 (*it)->updateVolume();
     296            for (BaseSound* sound : ObjectList<BaseSound>())
     297                sound->updateVolume();
    298298            break;
    299299        case SoundType::Music:
    300             for (ObjectList<AmbientSound>::iterator it = ObjectList<AmbientSound>::begin(); it != ObjectList<AmbientSound>::end(); ++it)
    301                 (*it)->updateVolume();
     300            for (AmbientSound* sound : ObjectList<AmbientSound>())
     301                sound->updateVolume();
    302302            break;
    303303        case SoundType::Effects:
    304             for (ObjectList<WorldSound>::iterator it = ObjectList<WorldSound>::begin(); it != ObjectList<WorldSound>::end(); ++it)
    305                 (*it)->updateVolume();
     304            for (WorldSound* sound : ObjectList<WorldSound>())
     305                sound->updateVolume();
    306306            break;
    307307        default:
  • code/branches/cpp11_v2/src/orxonox/sound/WorldAmbientSound.cc

    r10918 r10919  
    114114
    115115        //HACK: Assuption - there is only one WorldAmbientSound in a level and only one level is used.
    116         for (ObjectList<WorldAmbientSound>::iterator it = ObjectList<WorldAmbientSound>::begin();
    117              it != ObjectList<WorldAmbientSound>::end(); ++it)
     116        for (WorldAmbientSound* sound : ObjectList<WorldAmbientSound>())
    118117        {
    119             while(it->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
     118            while(sound->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
    120119                WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
    121120            }
  • code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc

    r10916 r10919  
    153153    void WeaponPack::notifyWeapons()
    154154    {
    155         for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
    156             (*it)->setWeaponPack(this);
     155        for (Weapon* weapon : this->weapons_)
     156            weapon->setWeaponPack(this);
    157157    }
    158158}
  • code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc

    r10916 r10919  
    108108                this->camera_->destroy();
    109109
    110             for (std::list<StrongPtr<CameraPosition>>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
    111                 (*it)->destroy();
     110            for (CameraPosition* cameraPosition : this->cameraPositions_)
     111                cameraPosition->destroy();
    112112
    113113            if (this->getScene()->getSceneManager())
  • code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc

    r10916 r10919  
    103103            bool result = (bool)lua_toboolean(this->lua_->getInternalLuaState(), -1);
    104104            lua_pop(this->lua_->getInternalLuaState(), 1);
    105             for (std::vector<WorldEntity*>::const_iterator it = this->effects_.begin(); it != this->effects_.end(); ++it)
     105            for (WorldEntity* effect : this->effects_)
    106106            {
    107                 (*it)->setMainState(result);
     107                effect->setMainState(result);
    108108            }
    109109        }
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc

    r10916 r10919  
    174174    void ModularSpaceShip::killShipPartStatic(std::string name)
    175175    {
    176         for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_s->begin(); it != ModularSpaceShip::partMap_s->end(); ++it)
    177         {
    178             if (it->second->getName() == name)
    179             {
    180                 it->second->death();
     176        for (const auto& mapEntry : *ModularSpaceShip::partMap_s)
     177        {
     178            if (mapEntry.second->getName() == name)
     179            {
     180                mapEntry.second->death();
    181181                return;
    182182            }
     
    193193    void ModularSpaceShip::killShipPart(std::string name)
    194194    {
    195         for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_.begin(); it != ModularSpaceShip::partMap_.end(); ++it)
    196         {
    197             if (it->second->getName() == name)
    198             {
    199                 it->second->death();
     195        for (const auto& mapEntry : ModularSpaceShip::partMap_)
     196        {
     197            if (mapEntry.second->getName() == name)
     198            {
     199                mapEntry.second->death();
    200200                return;
    201201            }
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/Pawn.cc

    r10768 r10919  
    574574    bool Pawn::hasSlaves()
    575575    {
    576         for (ObjectList<FormationController>::iterator it =
    577              ObjectList<FormationController>::begin();
    578              it != ObjectList<FormationController>::end(); ++it )
     576        for (FormationController* controller : ObjectList<FormationController>())
    579577        {
    580578            // checks if the pawn's controller has a slave
    581             if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
     579            if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController())
    582580                return true;
    583581        }
     
    587585    // A function that returns a slave of the pawn's controller
    588586    Controller* Pawn::getSlave(){
    589         for (ObjectList<FormationController>::iterator it =
    590                 ObjectList<FormationController>::begin();
    591                 it != ObjectList<FormationController>::end(); ++it )
    592         {
    593             if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
    594                 return it->getController();
     587        for (FormationController* controller : ObjectList<FormationController>())
     588        {
     589            if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController())
     590                return controller->getController();
    595591        }
    596592        return nullptr;
  • code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc

    r10916 r10919  
    9292
    9393        // Call this so bots stop shooting at the base after they converted it
    94         for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it)
    95             it->abandonTarget(this);
     94        for (ArtificialController* controller : ObjectList<ArtificialController>())
     95            controller->abandonTarget(this);
    9696    }
    9797}
Note: See TracChangeset for help on using the changeset viewer.