diff --git a/contrib/plugins/server-drivers/gtec-gipsa/src/ovasCDriverGTecGUSBamp.h b/contrib/plugins/server-drivers/gtec-gipsa/src/ovasCDriverGTecGUSBamp.h index 674c7b10ef3ed1a866b0c23c71a52e7470039147..a29477a5579456f9b52cdeecd335163bba1f35b3 100755 --- a/contrib/plugins/server-drivers/gtec-gipsa/src/ovasCDriverGTecGUSBamp.h +++ b/contrib/plugins/server-drivers/gtec-gipsa/src/ovasCDriverGTecGUSBamp.h @@ -20,8 +20,7 @@ #include <thread> #include <mutex> #include <condition_variable> - -#include <boost\scoped_ptr.hpp> +#include <memory> // unique_ptr #include <deque> using namespace std; @@ -134,7 +133,7 @@ namespace OpenViBEAcquisitionServer OpenViBE::uint32 m_ui32CurrentQueueIndex; - boost::scoped_ptr<std::thread> m_ThreadPtr; + std::unique_ptr<std::thread> m_ThreadPtr; OpenViBE::boolean m_bIsThreadRunning; std::mutex m_io_mutex; diff --git a/contrib/plugins/server-drivers/mbt-smarting/src/ovasCDriverMBTSmarting.h b/contrib/plugins/server-drivers/mbt-smarting/src/ovasCDriverMBTSmarting.h index be257191df4943d21b0afb6b933222ac0cc6c33c..3b3a5ec0a5dfa9b3d5cc3d01d496a76628a0fbc0 100755 --- a/contrib/plugins/server-drivers/mbt-smarting/src/ovasCDriverMBTSmarting.h +++ b/contrib/plugins/server-drivers/mbt-smarting/src/ovasCDriverMBTSmarting.h @@ -8,7 +8,6 @@ #include "../ovasCSettingsHelper.h" #include "../ovasCSettingsHelperOperators.h" -#include <boost/shared_ptr.hpp> #include "ovasCSmartingAmp.h" namespace OpenViBEAcquisitionServer @@ -73,7 +72,7 @@ namespace OpenViBEAcquisitionServer * Example : */ OpenViBE::uint32 m_ui32ConnectionID; - boost::shared_ptr< SmartingAmp > m_pSmartingAmp; + std::shared_ptr< SmartingAmp > m_pSmartingAmp; std::vector< unsigned char > m_byteArray; int sample_number; int latency; diff --git a/contrib/plugins/server-drivers/mbt-smarting/src/ovasCSmartingAmp.cpp b/contrib/plugins/server-drivers/mbt-smarting/src/ovasCSmartingAmp.cpp index 316d837f042e8c000fcd48f7cc26fd5d752b99a8..5ef8e62f08ba5c0f6e46097ef597d413b3d2cc86 100644 --- a/contrib/plugins/server-drivers/mbt-smarting/src/ovasCSmartingAmp.cpp +++ b/contrib/plugins/server-drivers/mbt-smarting/src/ovasCSmartingAmp.cpp @@ -256,7 +256,8 @@ bool SmartingAmp::start() acquire(); - auto f = boost::bind(&boost::asio::io_service::run, &m_io); + auto f = [this]() { this->m_io.run(); }; + // auto f = boost::bind(&boost::asio::io_service::run, &m_io); acquire_t.reset(new std::thread( f )); @@ -370,7 +371,7 @@ void SmartingAmp::read_with_timeout(int size, size_t timeout) m_bytes_readed = 0; - m_port->async_read_some( + m_port->async_read_some( boost::asio::buffer(m_commandReceiveBuffer, size), boost::bind( &SmartingAmp::read_complete, diff --git a/contrib/plugins/server-drivers/mbt-smarting/src/ovasCSmartingAmp.h b/contrib/plugins/server-drivers/mbt-smarting/src/ovasCSmartingAmp.h index d146187ff60f889a2a8458a03cf1ff12335d45ad..9883bd98bb9418f023ee3890dc34602024fc9a35 100644 --- a/contrib/plugins/server-drivers/mbt-smarting/src/ovasCSmartingAmp.h +++ b/contrib/plugins/server-drivers/mbt-smarting/src/ovasCSmartingAmp.h @@ -21,6 +21,8 @@ #include <boost/bind.hpp> #include <boost/utility.hpp> +#include <memory> // shared_ptr + #include <mutex> #include <thread> @@ -109,7 +111,7 @@ private: boost::asio::io_service m_io; - boost::shared_ptr< boost::asio::serial_port > m_port; + std::shared_ptr< boost::asio::serial_port > m_port; unsigned char m_receiveBuffer[MAX_PACKAGE_SIZE]; @@ -133,9 +135,9 @@ private: int m_receivedSamples; - boost::shared_ptr< std::thread > acquire_t; + std::shared_ptr< std::thread > acquire_t; - boost::shared_ptr< boost::asio::deadline_timer > m_timer; + std::shared_ptr< boost::asio::deadline_timer > m_timer; // read with timeout int m_bytes_readed; diff --git a/contrib/plugins/server-extensions/external-stimulations/ovasCPluginExternalStimulations.h b/contrib/plugins/server-extensions/external-stimulations/ovasCPluginExternalStimulations.h index 76d1cd3dd110b38564eb600d419ba0c39c909bd7..5931ac958a353b56d6b6571498252c0c5754adf4 100644 --- a/contrib/plugins/server-extensions/external-stimulations/ovasCPluginExternalStimulations.h +++ b/contrib/plugins/server-extensions/external-stimulations/ovasCPluginExternalStimulations.h @@ -15,8 +15,6 @@ #include <mutex> #include <condition_variable> -#include <boost/scoped_ptr.hpp> - #include <sys/timeb.h> #include "ovasIAcquisitionServerPlugin.h" @@ -75,7 +73,7 @@ namespace OpenViBEAcquisitionServer int m_iDebugStimulationsBuffered; //added for acquiring external stimulations - boost::scoped_ptr<std::thread> m_ESthreadPtr; + std::unique_ptr<std::thread> m_ESthreadPtr; OpenViBE::boolean m_bIsESThreadRunning; std::mutex m_es_mutex; std::condition_variable m_esAvailable; diff --git a/contrib/plugins/server-extensions/tcp-tagging/ovasCPluginTCPTagging.h b/contrib/plugins/server-extensions/tcp-tagging/ovasCPluginTCPTagging.h index fb12db4d618ec6fbf9bf7780574252d0418518ce..14030c46b7b078874c83eb70fd0cf9dc1d03f861 100644 --- a/contrib/plugins/server-extensions/tcp-tagging/ovasCPluginTCPTagging.h +++ b/contrib/plugins/server-extensions/tcp-tagging/ovasCPluginTCPTagging.h @@ -23,8 +23,6 @@ #include "ovasIAcquisitionServerPlugin.h" #include "ovasCTagStream.h" -#include <boost/scoped_ptr.hpp> - namespace OpenViBEAcquisitionServer { namespace OpenViBEAcquisitionServerPlugins @@ -49,7 +47,7 @@ namespace OpenViBEAcquisitionServer private: OpenViBE::uint64 m_previousPosixTime; OpenViBE::uint64 m_previousSampleTime; - boost::scoped_ptr<CTagStream> m_scopedTagStream; + std::unique_ptr<CTagStream> m_scopedTagStream; OpenViBE::CString m_port; }; diff --git a/contrib/plugins/server-extensions/tcp-tagging/ovasCTagStream.h b/contrib/plugins/server-extensions/tcp-tagging/ovasCTagStream.h index ee0e8d430e629c71ebacd27b27b6422de0b24921..50c00f88c960e40b05d8ac614c86447ccd90cf79 100644 --- a/contrib/plugins/server-extensions/tcp-tagging/ovasCTagStream.h +++ b/contrib/plugins/server-extensions/tcp-tagging/ovasCTagStream.h @@ -3,9 +3,6 @@ #include <queue> #include <boost/bind.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/scoped_ptr.hpp> -#include <boost/enable_shared_from_this.hpp> #include <boost/asio.hpp> #include <mutex> @@ -39,10 +36,10 @@ class CTagSession; // forward declaration of CTagSession to define SharedSession class CTagQueue; // forward declaration of CTagQueue to define SharedQueuePtr class CTagServer; // forward declaration of CTagServer to define ScopedServerPtr -typedef boost::shared_ptr<CTagQueue> SharedQueuePtr; -typedef boost::shared_ptr<CTagSession> SharedSessionPtr; -typedef boost::scoped_ptr<CTagServer> ScopedServerPtr; -typedef boost::scoped_ptr<std::thread> ScopedThreadPtr; +typedef std::shared_ptr<CTagQueue> SharedQueuePtr; +typedef std::shared_ptr<CTagSession> SharedSessionPtr; +typedef std::unique_ptr<CTagServer> ScopedServerPtr; +typedef std::unique_ptr<std::thread> ScopedThreadPtr; // A trivial implementation of a queue to store Tags with exclusive locking class CTagQueue @@ -62,7 +59,7 @@ private: // An instance of CTagSession is associated to every client connecting to the Tagging Server. // It contains a connection handle and data buffer. -class CTagSession : public boost::enable_shared_from_this<CTagSession> +class CTagSession : public std::enable_shared_from_this<CTagSession> { public: CTagSession(boost::asio::io_service& io_service, const SharedQueuePtr& queue);