[Orxonox-commit 6117] r10775 - in code/branches/cpp11_v2/src: external/cpptcl external/cpptcl/details libraries/core libraries/core/command libraries/core/input libraries/network

landauf at orxonox.net landauf at orxonox.net
Sun Nov 8 10:40:46 CET 2015


Author: landauf
Date: 2015-11-08 10:40:44 +0100 (Sun, 08 Nov 2015)
New Revision: 10775

Modified:
   code/branches/cpp11_v2/src/external/cpptcl/cpptcl.h
   code/branches/cpp11_v2/src/external/cpptcl/details/methods.h
   code/branches/cpp11_v2/src/external/cpptcl/details/methods_v.h
   code/branches/cpp11_v2/src/libraries/core/GUIManager.cc
   code/branches/cpp11_v2/src/libraries/core/Thread.cc
   code/branches/cpp11_v2/src/libraries/core/ThreadWin.cc
   code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc
   code/branches/cpp11_v2/src/libraries/core/input/InputManager.h
   code/branches/cpp11_v2/src/libraries/core/input/InputState.h
   code/branches/cpp11_v2/src/libraries/network/TrafficControl.cc
Log:
using std::bind and std::function instead of boost::bind and boost::function respectively. use arg:: namespace for placeholders to avoid ambiguity with boost-placeholders

Modified: code/branches/cpp11_v2/src/external/cpptcl/cpptcl.h
===================================================================
--- code/branches/cpp11_v2/src/external/cpptcl/cpptcl.h	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/external/cpptcl/cpptcl.h	2015-11-08 09:40:44 UTC (rev 10775)
@@ -16,11 +16,12 @@
 #include <sstream>
 #include <map>
 #include <vector>
-#include <boost/bind.hpp>
+#include <memory>
+#include <functional>
 
-
 namespace Tcl
 {
+namespace arg = std::placeholders;
 
 // exception class used for reporting all Tcl errors
 

Modified: code/branches/cpp11_v2/src/external/cpptcl/details/methods.h
===================================================================
--- code/branches/cpp11_v2/src/external/cpptcl/details/methods.h	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/external/cpptcl/details/methods.h	2015-11-08 09:40:44 UTC (rev 10775)
@@ -26,11 +26,11 @@
           C *p = static_cast<C*>(pv);
           if (cmem_)
           {
-               dispatch<R>::do_dispatch(interp, boost::bind(cf_, p));
+               dispatch<R>::do_dispatch(interp, std::bind(cf_, p));
           }
           else
           {
-               dispatch<R>::do_dispatch(interp, boost::bind(f_, p));
+               dispatch<R>::do_dispatch(interp, std::bind(f_, p));
           }
      }
 
@@ -59,13 +59,13 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1>(
-                    interp, boost::bind(cf_, p, _1),
+                    interp, std::bind(cf_, p, arg::_1),
                     tcl_cast<T1>::from(interp, objv[2]));
           }
           else
           {
                dispatch<R>::template do_dispatch<T1>(
-                    interp, boost::bind(f_, p, _1),
+                    interp, std::bind(f_, p, arg::_1),
                     tcl_cast<T1>::from(interp, objv[2]));
           }
      }
@@ -95,14 +95,14 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2>(
-                    interp, boost::bind(cf_, p, _1, _2),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]));
           }
           else
           {
                dispatch<R>::template do_dispatch<T1, T2>(
-                    interp, boost::bind(f_, p, _1, _2),
+                    interp, std::bind(f_, p, arg::_1, arg::_2),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]));
           }
@@ -133,7 +133,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3>(
-                    interp, boost::bind(cf_, p, _1, _2, _3),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]));
@@ -141,7 +141,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3>(
-                    interp, boost::bind(f_, p, _1, _2, _3),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]));
@@ -174,7 +174,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4>(
-                    interp, boost::bind(cf_, p, _1, _2, _3, _4),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3, arg::_4),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -183,7 +183,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4>(
-                    interp, boost::bind(f_, p, _1, _2, _3, _4),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3, arg::_4),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -217,7 +217,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5>(
-                    interp, boost::bind(cf_, p, _1, _2, _3, _4, _5),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -227,7 +227,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5>(
-                    interp, boost::bind(f_, p, _1, _2, _3, _4, _5),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -262,7 +262,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5, T6>(
-                    interp, boost::bind(cf_, p, _1, _2, _3, _4, _5, _6),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -273,7 +273,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5, T6>(
-                    interp, boost::bind(f_, p, _1, _2, _3, _4, _5, _6),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -309,7 +309,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5, T6, T7>(
-                    interp, boost::bind(cf_, p, _1, _2, _3, _4, _5, _6, _7),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -321,7 +321,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5, T6, T7>(
-                    interp, boost::bind(f_, p, _1, _2, _3, _4, _5, _6, _7),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -359,8 +359,8 @@
           {
                dispatch<R>::template do_dispatch<
                     T1, T2, T3, T4, T5, T6, T7, T8>(
-                    interp, boost::bind(cf_, p,
-                         _1, _2, _3, _4, _5, _6, _7, _8),
+                    interp, std::bind(cf_, p,
+                         arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7, arg::_8),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -374,8 +374,8 @@
           {
                dispatch<R>::template do_dispatch<
                     T1, T2, T3, T4, T5, T6, T7, T8>(
-                    interp, boost::bind(f_, p,
-                         _1, _2, _3, _4, _5, _6, _7, _8),
+                    interp, std::bind(f_, p,
+                         arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7, arg::_8),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -415,8 +415,8 @@
           {
                dispatch<R>::template do_dispatch<
                     T1, T2, T3, T4, T5, T6, T7, T8, T9>(
-                    interp, boost::bind(cf_, p,
-                         _1, _2, _3, _4, _5, _6, _7, _8, _9),
+                    interp, std::bind(cf_, p,
+                         arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7, arg::_8, arg::_9),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -431,8 +431,8 @@
           {
                dispatch<R>::template do_dispatch<
                     T1, T2, T3, T4, T5, T6, T7, T8, T9>(
-                    interp, boost::bind(f_, p,
-                         _1, _2, _3, _4, _5, _6, _7, _8, _9),
+                    interp, std::bind(f_, p,
+                         arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7, arg::_8, arg::_9),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),

Modified: code/branches/cpp11_v2/src/external/cpptcl/details/methods_v.h
===================================================================
--- code/branches/cpp11_v2/src/external/cpptcl/details/methods_v.h	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/external/cpptcl/details/methods_v.h	2015-11-08 09:40:44 UTC (rev 10775)
@@ -32,13 +32,13 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1>(
-                    interp, boost::bind(cf_, p, _1),
+                    interp, std::bind(cf_, p, arg::_1),
                     t1);
           }
           else
           {
                dispatch<R>::template do_dispatch<T1>(
-                    interp, boost::bind(f_, p, _1),
+                    interp, std::bind(f_, p, arg::_1),
                     t1);
           }
      }
@@ -71,14 +71,14 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2>(
-                    interp, boost::bind(cf_, p, _1, _2),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2),
                     tcl_cast<T1>::from(interp, objv[2]),
                     t2);
           }
           else
           {
                dispatch<R>::template do_dispatch<T1, T2>(
-                    interp, boost::bind(f_, p, _1, _2),
+                    interp, std::bind(f_, p, arg::_1, arg::_2),
                     tcl_cast<T1>::from(interp, objv[2]),
                     t2);
           }
@@ -112,7 +112,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3>(
-                    interp, boost::bind(cf_, p, _1, _2, _3),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     t3);
@@ -120,7 +120,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3>(
-                    interp, boost::bind(f_, p, _1, _2, _3),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     t3);
@@ -155,7 +155,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4>(
-                    interp, boost::bind(cf_, p, _1, _2, _3, _4),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3, arg::_4),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -164,7 +164,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4>(
-                    interp, boost::bind(f_, p, _1, _2, _3, _4),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3, arg::_4),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -201,7 +201,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5>(
-                    interp, boost::bind(cf_, p, _1, _2, _3, _4, _5),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -211,7 +211,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5>(
-                    interp, boost::bind(f_, p, _1, _2, _3, _4, _5),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -250,7 +250,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5, T6>(
-                    interp, boost::bind(cf_, p, _1, _2, _3, _4, _5, _6),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -261,7 +261,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5, T6>(
-                    interp, boost::bind(f_, p, _1, _2, _3, _4, _5, _6),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -301,7 +301,7 @@
           if (cmem_)
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5, T6, T7>(
-                    interp, boost::bind(cf_, p, _1, _2, _3, _4, _5, _6, _7),
+                    interp, std::bind(cf_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -313,7 +313,7 @@
           else
           {
                dispatch<R>::template do_dispatch<T1, T2, T3, T4, T5, T6, T7>(
-                    interp, boost::bind(f_, p, _1, _2, _3, _4, _5, _6, _7),
+                    interp, std::bind(f_, p, arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -355,8 +355,8 @@
           {
                dispatch<R>::template do_dispatch<
                     T1, T2, T3, T4, T5, T6, T7, T8>(
-                    interp, boost::bind(cf_, p,
-                         _1, _2, _3, _4, _5, _6, _7, _8),
+                    interp, std::bind(cf_, p,
+                         arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7, arg::_8),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -370,8 +370,8 @@
           {
                dispatch<R>::template do_dispatch<
                     T1, T2, T3, T4, T5, T6, T7, T8>(
-                    interp, boost::bind(f_, p,
-                         _1, _2, _3, _4, _5, _6, _7, _8),
+                    interp, std::bind(f_, p,
+                         arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7, arg::_8),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -414,8 +414,8 @@
           {
                dispatch<R>::template do_dispatch<
                     T1, T2, T3, T4, T5, T6, T7, T8, T9>(
-                    interp, boost::bind(cf_, p,
-                         _1, _2, _3, _4, _5, _6, _7, _8, _9),
+                    interp, std::bind(cf_, p,
+                         arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7, arg::_8, arg::_9),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),
@@ -430,8 +430,8 @@
           {
                dispatch<R>::template do_dispatch<
                     T1, T2, T3, T4, T5, T6, T7, T8, T9>(
-                    interp, boost::bind(f_, p,
-                         _1, _2, _3, _4, _5, _6, _7, _8, _9),
+                    interp, std::bind(f_, p,
+                         arg::_1, arg::_2, arg::_3, arg::_4, arg::_5, arg::_6, arg::_7, arg::_8, arg::_9),
                     tcl_cast<T1>::from(interp, objv[2]),
                     tcl_cast<T2>::from(interp, objv[3]),
                     tcl_cast<T3>::from(interp, objv[4]),

Modified: code/branches/cpp11_v2/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/GUIManager.cc	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/libraries/core/GUIManager.cc	2015-11-08 09:40:44 UTC (rev 10775)
@@ -31,7 +31,7 @@
 
 #include <fstream>
 #include <memory>
-#include <boost/bind.hpp>
+#include <functional>
 #include <OgreRenderQueue.h>
 #include <OgreRenderWindow.h>
 
@@ -114,6 +114,8 @@
 
 namespace orxonox
 {
+    namespace arg = std::placeholders;
+
     static void key_esc()
         { GUIManager::getInstance().keyESC(); }
     SetConsoleCommand("keyESC", &key_esc);
@@ -450,7 +452,7 @@
     void GUIManager::preUpdate(const Clock& time)
     {
         assert(guiSystem_);
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectTimePulse, _1, time.getDeltaTime()));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectTimePulse, arg::_1, time.getDeltaTime()));
     }
 
     /**
@@ -626,20 +628,20 @@
     void GUIManager::buttonPressed(const KeyEvent& evt)
     {
 #if CEGUI_VERSION >= 0x000800
-        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectKeyDown, _1, (CEGUI::Key::Scan) evt.getKeyCode())); // TODO: will this cast always work?
-        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectChar, _1, evt.getText()));
+        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectKeyDown, arg::_1, (CEGUI::Key::Scan) evt.getKeyCode())); // TODO: will this cast always work?
+        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectChar, arg::_1, evt.getText()));
 #else
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectKeyDown, _1, evt.getKeyCode()));
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectChar, _1, evt.getText()));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectKeyDown, arg::_1, evt.getKeyCode()));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectChar, arg::_1, evt.getText()));
 #endif
     }
 
     void GUIManager::buttonReleased(const KeyEvent& evt)
     {
 #if CEGUI_VERSION >= 0x000800
-        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectKeyUp, _1, (CEGUI::Key::Scan) evt.getKeyCode())); // TODO: will this cast always work?
+        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectKeyUp, arg::_1, (CEGUI::Key::Scan) evt.getKeyCode())); // TODO: will this cast always work?
 #else
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectKeyUp, _1, evt.getKeyCode()));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectKeyUp, arg::_1, evt.getKeyCode()));
 #endif
     }
 
@@ -655,9 +657,9 @@
     void GUIManager::buttonPressed(MouseButtonCode::ByEnum id)
     {
 #if CEGUI_VERSION >= 0x000800
-        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseButtonDown, _1, convertButton(id)));
+        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectMouseButtonDown, arg::_1, convertButton(id)));
 #else
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseButtonDown, _1, convertButton(id)));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectMouseButtonDown, arg::_1, convertButton(id)));
 #endif
     }
 
@@ -673,27 +675,27 @@
     void GUIManager::buttonReleased(MouseButtonCode::ByEnum id)
     {
 #if CEGUI_VERSION >= 0x000800
-        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseButtonUp, _1, convertButton(id)));
+        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectMouseButtonUp, arg::_1, convertButton(id)));
 #else
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseButtonUp, _1, convertButton(id)));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectMouseButtonUp, arg::_1, convertButton(id)));
 #endif
     }
 
     void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
     {
 #if CEGUI_VERSION >= 0x000800
-        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMousePosition, _1, (float)abs.x, (float)abs.y));
+        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectMousePosition, arg::_1, (float)abs.x, (float)abs.y));
 #else
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMousePosition, _1, (float)abs.x, (float)abs.y));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectMousePosition, arg::_1, (float)abs.x, (float)abs.y));
 #endif
     }
 
     void GUIManager::mouseScrolled(int abs, int rel)
     {
 #if CEGUI_VERSION >= 0x000800
-        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
+        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectMouseWheelChange, arg::_1, (float)sgn(rel) * this->numScrollLines_));
 #else
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseWheelChange, _1, (float)sgn(rel) * this->numScrollLines_));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectMouseWheelChange, arg::_1, (float)sgn(rel) * this->numScrollLines_));
 #endif
     }
 
@@ -703,9 +705,9 @@
     void GUIManager::mouseLeft()
     {
 #if CEGUI_VERSION >= 0x000800
-        this->protectedCeguiContextCall(boost::bind(&CEGUI::GUIContext::injectMouseLeaves, _1));
+        this->protectedCeguiContextCall(std::bind(&CEGUI::GUIContext::injectMouseLeaves, arg::_1));
 #else
-        this->protectedCeguiSystemCall(boost::bind(&CEGUI::System::injectMouseLeaves, _1));
+        this->protectedCeguiSystemCall(std::bind(&CEGUI::System::injectMouseLeaves, arg::_1));
 #endif
     }
 
@@ -752,7 +754,7 @@
         be left in an undefined state. But otherwise one script error would
         terminate the whole program...
     @note
-        Your life gets easier if you use boost::bind to create the object/function.
+        Your life gets easier if you use std::bind to create the object/function.
     @param function
         Any callable object/function that takes this->guiSystem_ as its only parameter.
     @return

Modified: code/branches/cpp11_v2/src/libraries/core/Thread.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Thread.cc	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/libraries/core/Thread.cc	2015-11-08 09:40:44 UTC (rev 10775)
@@ -33,8 +33,8 @@
 #elif defined(ORXONOX_PLATFORM_UNIX)
 
 #include <cassert>
+#include <functional>
 #include <boost/thread/thread.hpp>
-#include <boost/bind.hpp>
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/thread_time.hpp>
 
@@ -54,7 +54,7 @@
         this->executorMutex_ = new boost::mutex;
         this->isWorkingMutex_ = new boost::mutex;
         this->stopThreadMutex_ = new boost::mutex;
-        this->workerThread_ = new boost::thread( boost::bind(&Thread::threadLoop, this) );
+        this->workerThread_ = new boost::thread( std::bind(&Thread::threadLoop, this) );
     }
 
     Thread::~Thread()

Modified: code/branches/cpp11_v2/src/libraries/core/ThreadWin.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/ThreadWin.cc	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/libraries/core/ThreadWin.cc	2015-11-08 09:40:44 UTC (rev 10775)
@@ -30,8 +30,8 @@
 #include "Thread.h"
 
 #include <cassert>
+// #include <functional>
 // #include <boost/thread/thread.hpp>
-// #include <boost/bind.hpp>
 // #include <boost/thread/mutex.hpp>
 // #include <boost/thread/thread_time.hpp>
 
@@ -51,7 +51,7 @@
 //         this->executorMutex_ = new boost::mutex;
 //         this->isWorkingMutex_ = new boost::mutex;
 //         this->stopThreadMutex_ = new boost::mutex;
-//         this->workerThread_ = new boost::thread( boost::bind(&Thread::threadLoop, this) );
+//         this->workerThread_ = new boost::thread( std::bind(&Thread::threadLoop, this) );
     }
 
     Thread::~Thread()

Modified: code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc	2015-11-08 09:40:44 UTC (rev 10775)
@@ -33,7 +33,7 @@
 
 #include "TclThreadManager.h"
 
-#include <boost/bind.hpp>
+#include <functional>
 #include <boost/thread/thread.hpp>
 #include <boost/thread/locks.hpp>
 #include <boost/thread/shared_mutex.hpp>
@@ -162,7 +162,7 @@
                                 if (bundle->queue_.try_pop_front(&command))
                                 {
                                     // Start a thread to execute the command
-                                    boost::thread(boost::bind(&tclThread, bundle, command));
+                                    boost::thread(std::bind(&tclThread, bundle, command));
                                 }
                                 else
                                 {
@@ -487,7 +487,7 @@
     */
     void TclThreadManager::source(const std::string& file)
     {
-        boost::thread(boost::bind(&sourceThread, file));
+        boost::thread(std::bind(&sourceThread, file));
     }
 
     /**

Modified: code/branches/cpp11_v2/src/libraries/core/input/InputManager.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/InputManager.h	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/libraries/core/input/InputManager.h	2015-11-08 09:40:44 UTC (rev 10775)
@@ -34,7 +34,7 @@
 #include <map>
 #include <string>
 #include <vector>
-#include <boost/function.hpp>
+#include <functional>
 
 #include "util/Singleton.h"
 #include "util/tribool.h"
@@ -185,7 +185,7 @@
         //-------------------------------
         // Function call caching
         //-------------------------------
-        void pushCall(const boost::function<void ()>& function)
+        void pushCall(const std::function<void ()>& function)
             { this->callBuffer_.push_back(function); }
 
         static InputManager& getInstance() { return Singleton<InputManager>::getInstance(); } // tolua_export
@@ -224,7 +224,7 @@
         std::map<int, InputState*>          activeStates_;         //!< Contains all active input states by priority (std::map is sorted!)
         std::vector<InputState*>            activeStatesTicked_;   //!< Like activeStates_, but only contains the ones that currently receive events
 
-        std::vector<boost::function<void ()>> callBuffer_;        //!< Caches all calls from InputStates to be executed afterwards (see preUpdate)
+        std::vector<std::function<void ()>> callBuffer_;        //!< Caches all calls from InputStates to be executed afterwards (see preUpdate)
 
         static InputManager*                singletonPtr_s;        //!< Pointer reference to the singleton
     }; // tolua_export

Modified: code/branches/cpp11_v2/src/libraries/core/input/InputState.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/InputState.h	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/libraries/core/input/InputState.h	2015-11-08 09:40:44 UTC (rev 10775)
@@ -34,8 +34,7 @@
 #include <cassert>
 #include <string>
 #include <vector>
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
+#include <functional>
 
 #include "util/tribool.h"
 #include "InputHandler.h"
@@ -43,7 +42,7 @@
 #include "JoyStickQuantityListener.h"
 
 #define INPUT_STATE_PUSH_CALL(deviceIndex, functionName, ...) \
-    InputManager::getInstance().pushCall(boost::function<void ()>(boost::bind(&InputHandler::functionName, handlers_[deviceIndex], __VA_ARGS__)))
+    InputManager::getInstance().pushCall(std::function<void ()>(std::bind(&InputHandler::functionName, handlers_[deviceIndex], __VA_ARGS__)))
 
 namespace orxonox
 {
@@ -211,7 +210,7 @@
         {
             // We have to store the function pointer to tell the compiler about its actual type because of overloading
             void (InputHandler::*function)(unsigned int, ButtonTypeParam, EventType) = &InputHandler::buttonEvent<ButtonTypeParam>;
-            InputManager::getInstance().pushCall(boost::function<void ()>(boost::bind(function, handlers_[device], device, button, EventType())));
+            InputManager::getInstance().pushCall(std::function<void ()>(std::bind(function, handlers_[device], device, button, EventType())));
         }
     }
 

Modified: code/branches/cpp11_v2/src/libraries/network/TrafficControl.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/TrafficControl.cc	2015-11-07 21:46:11 UTC (rev 10774)
+++ code/branches/cpp11_v2/src/libraries/network/TrafficControl.cc	2015-11-08 09:40:44 UTC (rev 10775)
@@ -29,7 +29,7 @@
 #include "TrafficControl.h"
 
 #include <cassert>
-#include <boost/bind.hpp>
+#include <functional>
 
 #include "core/CoreIncludes.h"
 #include "core/config/ConfigValueIncludes.h"
@@ -38,6 +38,7 @@
 namespace orxonox {
 
   static const unsigned int SCHED_PRIORITY_OFFSET = static_cast<unsigned int>(-1);
+  namespace arg = std::placeholders;
 
   objInfo::objInfo(uint32_t ID, uint32_t creatorID, int32_t curGsID, int32_t diffGsID, uint32_t size, unsigned int prioperm, unsigned int priosched)
   {
@@ -257,11 +258,11 @@
     //end compare listToProcess vs clientListPerm
 
       //sort copied list according to priorities
-      // use boost bind here because we need to pass a memberfunction to stl sort
-//       sort( list.begin(), list.end(), boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
-      list.sort( boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
+      // use std::bind here because we need to pass a memberfunction to stl sort
+//       sort( list.begin(), list.end(), std::bind(&TrafficControl::prioritySort, this, clientID, arg::_1, arg::_2) );
+      list.sort( std::bind(&TrafficControl::prioritySort, this, clientID, arg::_1, arg::_2) );
 
-//       list.sort(boost::bind(&TrafficControl::prioritySort, this, clientID, _1, _2) );
+//       list.sort(std::bind(&TrafficControl::prioritySort, this, clientID, arg::_1, arg::_2) );
 
       //now we check, that the creator of an object always exists on a client
       std::list<obj>::iterator itcreator;
@@ -274,8 +275,8 @@
 //       printList(list, clientID);
       cut(list, targetSize);
       //now sort again after objDataOffset
-//       sort(list.begin(), list.end(), boost::bind(&TrafficControl::dataSort, this, _1, _2) );
-      list.sort( boost::bind(&TrafficControl::dataSort, this, _1, _2) );
+//       sort(list.begin(), list.end(), std::bind(&TrafficControl::dataSort, this, arg::_1, arg::_2) );
+      list.sort( std::bind(&TrafficControl::dataSort, this, arg::_1, arg::_2) );
 
       //diese Funktion updateClientList muss noch gemacht werden
       updateClientListTemp(list);




More information about the Orxonox-commit mailing list