[Orxonox-commit 6120] r10778 - code/branches/cpp11_v2/src/libraries/core/input

landauf at orxonox.net landauf at orxonox.net
Sun Nov 8 15:12:17 CET 2015


Author: landauf
Date: 2015-11-08 15:12:17 +0100 (Sun, 08 Nov 2015)
New Revision: 10778

Modified:
   code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
   code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc
Log:
use range-based-for-loop instead of BOOST_FOREACH

Modified: code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc	2015-11-08 10:16:22 UTC (rev 10777)
+++ code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc	2015-11-08 14:12:17 UTC (rev 10778)
@@ -38,7 +38,6 @@
 #include <climits>
 #include <ois/OISException.h>
 #include <ois/OISInputManager.h>
-#include <boost/foreach.hpp>
 #include <loki/ScopeGuard.h>
 
 #include "util/Clock.h"
@@ -309,7 +308,7 @@
     {
         orxout(verbose, context::input) << "InputManager: Destroying devices..." << endl;
 
-        BOOST_FOREACH(InputDevice*& device, devices_)
+        for (InputDevice*& device : devices_)
         {
             if (device == nullptr)
                 continue;
@@ -386,7 +385,7 @@
 
         // Capture all the input and collect the function calls
         // No event gets triggered here yet!
-        BOOST_FOREACH(InputDevice* device, devices_)
+        for  (InputDevice* device : devices_)
             if (device != nullptr)
                 device->update(time);
 
@@ -465,7 +464,7 @@
 
     void InputManager::clearBuffers()
     {
-        BOOST_FOREACH(InputDevice* device, devices_)
+        for (InputDevice* device : devices_)
             if (device != nullptr)
                 device->clearBuffers();
     }
@@ -475,7 +474,7 @@
         orxout(message) << "Move all joy stick axes fully in all directions." << '\n'
                         << "When done, put the axex in the middle position and press enter." << endl;
 
-        BOOST_FOREACH(InputDevice* device, devices_)
+        for (InputDevice* device : devices_)
             if (device != nullptr)
                 device->startCalibration();
 
@@ -486,7 +485,7 @@
     //! Tells all devices to stop the calibration and evaluate it. Buffers are being cleared as well!
     void InputManager::stopCalibration()
     {
-        BOOST_FOREACH(InputDevice* device, devices_)
+        for (InputDevice* device : devices_)
             if (device != nullptr)
                 device->stopCalibration();
 

Modified: code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc	2015-11-08 10:16:22 UTC (rev 10777)
+++ code/branches/cpp11_v2/src/libraries/core/input/JoyStick.cc	2015-11-08 14:12:17 UTC (rev 10778)
@@ -30,7 +30,6 @@
 
 #include <climits>
 #include <ois/OISJoyStick.h>
-#include <boost/foreach.hpp>
 
 #include "util/StringUtils.h"
 #include "core/config/ConfigFile.h"
@@ -72,7 +71,7 @@
         deviceName_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_POV));
         //deviceName_ += multi_cast<std::string>(oisDevice_->getNumberOfComponents(OIS::OIS_Vector3));
 
-        BOOST_FOREACH(std::string& idString, deviceNames_s)
+        for (const std::string& idString : deviceNames_s)
         {
             if (deviceName_ == idString)
             {
@@ -127,11 +126,11 @@
     void JoyStick::calibrationStarted()
     {
         // Set initial values
-        BOOST_FOREACH(int& minVal, configMinValues_)
+        for (int& minVal : configMinValues_)
             minVal = INT_MAX;
-        BOOST_FOREACH(int& minVal, configMaxValues_)
+        for (int& minVal : configMaxValues_)
             minVal = INT_MIN;
-        BOOST_FOREACH(int& zeroVal, configZeroValues_)
+        for (int& zeroVal : configZeroValues_)
             zeroVal = 0;
     }
 
@@ -208,7 +207,7 @@
             else
                 fValue *= negativeCoeffs_[axis];
 
-            BOOST_FOREACH(InputState* state, inputStates_)
+            for (InputState* state : inputStates_)
                 state->joyStickAxisMoved(this->getDeviceID(), axis, fValue);
         }
     }




More information about the Orxonox-commit mailing list