diff options
author | Tobias Markmann <tm@ayena.de> | 2016-04-05 13:17:19 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-04-05 19:42:39 (GMT) |
commit | 2b560b129b7a31fc8cc07f618e763c95a22bf832 (patch) | |
tree | 73e72cdc758b79d01485dc28dcedd48b26859ae8 /Swiften/Network | |
parent | 3c560e31b0f168da917e8d566db01fd1cd997d86 (diff) | |
download | swift-2b560b129b7a31fc8cc07f618e763c95a22bf832.zip swift-2b560b129b7a31fc8cc07f618e763c95a22bf832.tar.bz2 |
Migrate to Boost.Signals2 from Boost.Signals
Boost.Signals was deprecated and is not improved further.
This patch removes Boost.Signals from 3rdParty and adds
Boost.Signals2 and its dependencies.
Also removed the Qt signals compatibility file
Swiften/Base/boost_bsignals.h.
Test-Information:
Build and ran unit tests on OS X 10.11.4. Confirmed successful
login using Swift client.
Change-Id: Ie6e3b2d15aac2462cda95401582f5287a479fb54
Diffstat (limited to 'Swiften/Network')
21 files changed, 77 insertions, 53 deletions
diff --git a/Swiften/Network/BOSHConnection.h b/Swiften/Network/BOSHConnection.h index 485e86a..b75e51f 100644 --- a/Swiften/Network/BOSHConnection.h +++ b/Swiften/Network/BOSHConnection.h @@ -81,14 +81,14 @@ namespace Swift { std::vector<Certificate::ref> getPeerCertificateChain() const; CertificateVerificationError::ref getPeerCertificateVerificationError() const; - boost::signal<void (bool /* error */)> onConnectFinished; - boost::signal<void (bool /* error */)> onDisconnected; - boost::signal<void (BOSHError::ref)> onSessionTerminated; - boost::signal<void (const std::string& /*sid*/, size_t /*requests*/)> onSessionStarted; - boost::signal<void (const SafeByteArray&)> onXMPPDataRead; - boost::signal<void (const SafeByteArray&)> onBOSHDataRead; - boost::signal<void (const SafeByteArray&)> onBOSHDataWritten; - boost::signal<void (const std::string&)> onHTTPError; + boost::signals2::signal<void (bool /* error */)> onConnectFinished; + boost::signals2::signal<void (bool /* error */)> onDisconnected; + boost::signals2::signal<void (BOSHError::ref)> onSessionTerminated; + boost::signals2::signal<void (const std::string& /*sid*/, size_t /*requests*/)> onSessionStarted; + boost::signals2::signal<void (const SafeByteArray&)> onXMPPDataRead; + boost::signals2::signal<void (const SafeByteArray&)> onBOSHDataRead; + boost::signals2::signal<void (const SafeByteArray&)> onBOSHDataWritten; + boost::signals2::signal<void (const std::string&)> onHTTPError; private: friend class ::BOSHConnectionTest; diff --git a/Swiften/Network/BOSHConnectionPool.h b/Swiften/Network/BOSHConnectionPool.h index b288505..1a805de 100644 --- a/Swiften/Network/BOSHConnectionPool.h +++ b/Swiften/Network/BOSHConnectionPool.h @@ -24,7 +24,7 @@ namespace Swift { class CachingDomainNameResolver; class EventLoop; - class SWIFTEN_API BOSHConnectionPool : public boost::bsignals::trackable { + class SWIFTEN_API BOSHConnectionPool : public boost::signals2::trackable { public: BOSHConnectionPool(const URL& boshURL, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, XMLParserFactory* parserFactory, TLSContextFactory* tlsFactory, TimerFactory* timerFactory, EventLoop* eventLoop, const std::string& to, unsigned long long initialRID, const URL& boshHTTPConnectProxyURL, const SafeString& boshHTTPConnectProxyAuthID, const SafeString& boshHTTPConnectProxyAuthPassword, const TLSOptions& tlsOptions, std::shared_ptr<HTTPTrafficFilter> trafficFilter = std::shared_ptr<HTTPTrafficFilter>()); ~BOSHConnectionPool(); @@ -41,11 +41,11 @@ namespace Swift { std::vector<Certificate::ref> getPeerCertificateChain() const; std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const; - boost::signal<void (BOSHError::ref)> onSessionTerminated; - boost::signal<void ()> onSessionStarted; - boost::signal<void (const SafeByteArray&)> onXMPPDataRead; - boost::signal<void (const SafeByteArray&)> onBOSHDataRead; - boost::signal<void (const SafeByteArray&)> onBOSHDataWritten; + boost::signals2::signal<void (BOSHError::ref)> onSessionTerminated; + boost::signals2::signal<void ()> onSessionStarted; + boost::signals2::signal<void (const SafeByteArray&)> onXMPPDataRead; + boost::signals2::signal<void (const SafeByteArray&)> onBOSHDataRead; + boost::signals2::signal<void (const SafeByteArray&)> onBOSHDataWritten; private: void handleDataRead(const SafeByteArray& data); diff --git a/Swiften/Network/BoostConnectionServer.h b/Swiften/Network/BoostConnectionServer.h index b8a1c64..41fdbe2 100644 --- a/Swiften/Network/BoostConnectionServer.h +++ b/Swiften/Network/BoostConnectionServer.h @@ -11,9 +11,9 @@ #include <boost/asio/io_service.hpp> #include <boost/asio/ip/tcp.hpp> #include <boost/optional/optional_fwd.hpp> +#include <boost/signals2.hpp> #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/EventLoop/EventOwner.h> #include <Swiften/Network/BoostConnection.h> #include <Swiften/Network/ConnectionServer.h> @@ -37,7 +37,7 @@ namespace Swift { virtual HostAddressPort getAddressPort() const; - boost::signal<void (boost::optional<Error>)> onStopped; + boost::signals2::signal<void (boost::optional<Error>)> onStopped; private: BoostConnectionServer(int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop); diff --git a/Swiften/Network/ChainedConnector.h b/Swiften/Network/ChainedConnector.h index bba9bfa..a00d7e5 100644 --- a/Swiften/Network/ChainedConnector.h +++ b/Swiften/Network/ChainedConnector.h @@ -12,10 +12,10 @@ #include <vector> #include <boost/optional.hpp> +#include <boost/signals2.hpp> #include <Swiften/Base/API.h> #include <Swiften/Base/Error.h> -#include <Swiften/Base/boost_bsignals.h> namespace Swift { class Connection; @@ -33,7 +33,7 @@ namespace Swift { void start(); void stop(); - boost::signal<void (std::shared_ptr<Connection>, std::shared_ptr<Error>)> onConnectFinished; + boost::signals2::signal<void (std::shared_ptr<Connection>, std::shared_ptr<Error>)> onConnectFinished; private: void finish(std::shared_ptr<Connection> connection, std::shared_ptr<Error>); diff --git a/Swiften/Network/Connection.h b/Swiften/Network/Connection.h index 1ef5824..85f33a8 100644 --- a/Swiften/Network/Connection.h +++ b/Swiften/Network/Connection.h @@ -8,9 +8,10 @@ #include <memory> +#include <boost/signals2.hpp> + #include <Swiften/Base/API.h> #include <Swiften/Base/SafeByteArray.h> -#include <Swiften/Base/boost_bsignals.h> namespace Swift { class HostAddressPort; @@ -36,9 +37,9 @@ namespace Swift { virtual HostAddressPort getRemoteAddress() const = 0; public: - boost::signal<void (bool /* error */)> onConnectFinished; - boost::signal<void (const boost::optional<Error>&)> onDisconnected; - boost::signal<void (std::shared_ptr<SafeByteArray>)> onDataRead; - boost::signal<void ()> onDataWritten; + boost::signals2::signal<void (bool /* error */)> onConnectFinished; + boost::signals2::signal<void (const boost::optional<Error>&)> onDisconnected; + boost::signals2::signal<void (std::shared_ptr<SafeByteArray>)> onDataRead; + boost::signals2::signal<void ()> onDataWritten; }; } diff --git a/Swiften/Network/ConnectionServer.h b/Swiften/Network/ConnectionServer.h index ae510e5..0c8a000 100644 --- a/Swiften/Network/ConnectionServer.h +++ b/Swiften/Network/ConnectionServer.h @@ -9,9 +9,9 @@ #include <memory> #include <boost/optional/optional_fwd.hpp> +#include <boost/signals2.hpp> #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/Connection.h> #include <Swiften/Network/HostAddressPort.h> @@ -33,6 +33,6 @@ namespace Swift { virtual void stop() = 0; - boost::signal<void (std::shared_ptr<Connection>)> onNewConnection; + boost::signals2::signal<void (std::shared_ptr<Connection>)> onNewConnection; }; } diff --git a/Swiften/Network/Connector.h b/Swiften/Network/Connector.h index 8114dd1..d8a1b88 100644 --- a/Swiften/Network/Connector.h +++ b/Swiften/Network/Connector.h @@ -11,9 +11,9 @@ #include <string> #include <boost/optional.hpp> +#include <boost/signals2.hpp> #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/Connection.h> #include <Swiften/Network/DomainNameResolveError.h> #include <Swiften/Network/DomainNameServiceQuery.h> @@ -26,7 +26,7 @@ namespace Swift { class ConnectionFactory; class TimerFactory; - class SWIFTEN_API Connector : public boost::bsignals::trackable, public std::enable_shared_from_this<Connector> { + class SWIFTEN_API Connector : public boost::signals2::trackable, public std::enable_shared_from_this<Connector> { public: typedef std::shared_ptr<Connector> ref; @@ -43,7 +43,7 @@ namespace Swift { void start(); void stop(); - boost::signal<void (std::shared_ptr<Connection>, std::shared_ptr<Error>)> onConnectFinished; + boost::signals2::signal<void (std::shared_ptr<Connection>, std::shared_ptr<Error>)> onConnectFinished; private: Connector(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver*, ConnectionFactory*, TimerFactory*); diff --git a/Swiften/Network/DomainNameAddressQuery.h b/Swiften/Network/DomainNameAddressQuery.h index f6650c6..7f89546 100644 --- a/Swiften/Network/DomainNameAddressQuery.h +++ b/Swiften/Network/DomainNameAddressQuery.h @@ -9,8 +9,8 @@ #include <memory> #include <boost/optional.hpp> +#include <boost/signals2.hpp> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/DomainNameResolveError.h> #include <Swiften/Network/HostAddress.h> @@ -23,6 +23,6 @@ namespace Swift { virtual void run() = 0; - boost::signal<void (const std::vector<HostAddress>&, boost::optional<DomainNameResolveError>)> onResult; + boost::signals2::signal<void (const std::vector<HostAddress>&, boost::optional<DomainNameResolveError>)> onResult; }; } diff --git a/Swiften/Network/DomainNameServiceQuery.h b/Swiften/Network/DomainNameServiceQuery.h index b8e0e7c..b27f32e 100644 --- a/Swiften/Network/DomainNameServiceQuery.h +++ b/Swiften/Network/DomainNameServiceQuery.h @@ -11,9 +11,9 @@ #include <vector> #include <boost/optional.hpp> +#include <boost/signals2.hpp> #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/DomainNameResolveError.h> namespace Swift { @@ -36,6 +36,6 @@ namespace Swift { virtual void run() = 0; static void sortResults(std::vector<DomainNameServiceQuery::Result>& queries, RandomGenerator& generator); - boost::signal<void (const std::vector<Result>&)> onResult; + boost::signals2::signal<void (const std::vector<Result>&)> onResult; }; } diff --git a/Swiften/Network/DummyConnection.h b/Swiften/Network/DummyConnection.h index f7b9e29..e58edf6 100644 --- a/Swiften/Network/DummyConnection.h +++ b/Swiften/Network/DummyConnection.h @@ -41,7 +41,7 @@ namespace Swift { return remoteAddress; } - boost::signal<void (const SafeByteArray&)> onDataSent; + boost::signals2::signal<void (const SafeByteArray&)> onDataSent; EventLoop* eventLoop; HostAddressPort localAddress; diff --git a/Swiften/Network/NATTraversalForwardPortRequest.h b/Swiften/Network/NATTraversalForwardPortRequest.h index 0565b4c..0f9c62c 100644 --- a/Swiften/Network/NATTraversalForwardPortRequest.h +++ b/Swiften/Network/NATTraversalForwardPortRequest.h @@ -12,8 +12,9 @@ #pragma once +#include <boost/signals2.hpp> + #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/NATPortMapping.h> namespace Swift { @@ -24,6 +25,6 @@ namespace Swift { virtual void start() = 0; virtual void stop() = 0; - boost::signal<void (boost::optional<NATPortMapping>)> onResult; + boost::signals2::signal<void (boost::optional<NATPortMapping>)> onResult; }; } diff --git a/Swiften/Network/NATTraversalGetPublicIPRequest.h b/Swiften/Network/NATTraversalGetPublicIPRequest.h index 8cdc067..8b34e0f 100644 --- a/Swiften/Network/NATTraversalGetPublicIPRequest.h +++ b/Swiften/Network/NATTraversalGetPublicIPRequest.h @@ -5,15 +5,16 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include <boost/signals2.hpp> + #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/HostAddress.h> namespace Swift { @@ -24,6 +25,6 @@ namespace Swift { virtual void start() = 0; virtual void stop() = 0; - boost::signal<void (boost::optional<HostAddress>)> onResult; + boost::signals2::signal<void (boost::optional<HostAddress>)> onResult; }; } diff --git a/Swiften/Network/NATTraversalRemovePortForwardingRequest.h b/Swiften/Network/NATTraversalRemovePortForwardingRequest.h index 8200197..3db9ee1 100644 --- a/Swiften/Network/NATTraversalRemovePortForwardingRequest.h +++ b/Swiften/Network/NATTraversalRemovePortForwardingRequest.h @@ -5,15 +5,16 @@ */ /* - * Copyright (c) 2015 Isode Limited. + * Copyright (c) 2015-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include <boost/signals2.hpp> + #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/HostAddress.h> namespace Swift { @@ -37,6 +38,6 @@ namespace Swift { virtual void start() = 0; virtual void stop() = 0; - boost::signal<void (boost::optional<bool> /* failure */)> onResult; + boost::signals2::signal<void (boost::optional<bool> /* failure */)> onResult; }; } diff --git a/Swiften/Network/NetworkEnvironment.h b/Swiften/Network/NetworkEnvironment.h index c98a78f..0f68c29 100644 --- a/Swiften/Network/NetworkEnvironment.h +++ b/Swiften/Network/NetworkEnvironment.h @@ -4,12 +4,19 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once #include <vector> +#include <boost/signals2.hpp> + #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/NetworkInterface.h> namespace Swift { diff --git a/Swiften/Network/SolarisNetworkEnvironment.cpp b/Swiften/Network/SolarisNetworkEnvironment.cpp index 4a1012b..db8c740 100644 --- a/Swiften/Network/SolarisNetworkEnvironment.cpp +++ b/Swiften/Network/SolarisNetworkEnvironment.cpp @@ -21,6 +21,7 @@ #include <vector> #include <boost/optional.hpp> +#include <boost/signals2.hpp> #include <net/if.h> #include <sys/socket.h> @@ -28,7 +29,6 @@ #include <sys/types.h> #include <unistd.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/HostAddress.h> #include <Swiften/Network/NetworkInterface.h> diff --git a/Swiften/Network/SolarisNetworkEnvironment.h b/Swiften/Network/SolarisNetworkEnvironment.h index 6dc9673..199fc6f 100644 --- a/Swiften/Network/SolarisNetworkEnvironment.h +++ b/Swiften/Network/SolarisNetworkEnvironment.h @@ -14,7 +14,8 @@ #include <vector> -#include <Swiften/Base/boost_bsignals.h> +#include <boost/signals2.hpp> + #include <Swiften/Network/NetworkEnvironment.h> #include <Swiften/Network/NetworkInterface.h> diff --git a/Swiften/Network/TLSConnection.h b/Swiften/Network/TLSConnection.h index fdcdb6d..0c395d1 100644 --- a/Swiften/Network/TLSConnection.h +++ b/Swiften/Network/TLSConnection.h @@ -8,9 +8,10 @@ #include <memory> +#include <boost/signals2.hpp> + #include <Swiften/Base/API.h> #include <Swiften/Base/SafeByteArray.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/Connection.h> #include <Swiften/TLS/TLSOptions.h> diff --git a/Swiften/Network/Timer.h b/Swiften/Network/Timer.h index 501fbd8..977ed89 100644 --- a/Swiften/Network/Timer.h +++ b/Swiften/Network/Timer.h @@ -6,8 +6,9 @@ #pragma once +#include <boost/signals2.hpp> + #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> namespace Swift { /** @@ -36,6 +37,6 @@ namespace Swift { /** * Emitted when the timer expires. */ - boost::signal<void ()> onTick; + boost::signals2::signal<void ()> onTick; }; } diff --git a/Swiften/Network/UnixNetworkEnvironment.cpp b/Swiften/Network/UnixNetworkEnvironment.cpp index 91754ae..dc90589 100644 --- a/Swiften/Network/UnixNetworkEnvironment.cpp +++ b/Swiften/Network/UnixNetworkEnvironment.cpp @@ -12,20 +12,22 @@ #include <Swiften/Network/UnixNetworkEnvironment.h> +#include <map> #include <string> #include <vector> -#include <map> + #include <boost/optional.hpp> -#include <sys/types.h> -#include <sys/socket.h> +#include <boost/signals2.hpp> + #include <arpa/inet.h> #include <net/if.h> +#include <sys/socket.h> +#include <sys/types.h> #ifndef __ANDROID__ #include <ifaddrs.h> #endif -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/HostAddress.h> #include <Swiften/Network/NetworkInterface.h> diff --git a/Swiften/Network/UnixNetworkEnvironment.h b/Swiften/Network/UnixNetworkEnvironment.h index 4e31e35..89a01ab 100644 --- a/Swiften/Network/UnixNetworkEnvironment.h +++ b/Swiften/Network/UnixNetworkEnvironment.h @@ -14,7 +14,8 @@ #include <vector> -#include <Swiften/Base/boost_bsignals.h> +#include <boost/signals2.hpp> + #include <Swiften/Network/NetworkEnvironment.h> #include <Swiften/Network/NetworkInterface.h> diff --git a/Swiften/Network/WindowsNetworkEnvironment.h b/Swiften/Network/WindowsNetworkEnvironment.h index 2e3a641..81de826 100644 --- a/Swiften/Network/WindowsNetworkEnvironment.h +++ b/Swiften/Network/WindowsNetworkEnvironment.h @@ -4,12 +4,19 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + #pragma once #include <vector> +#include <boost/signals2.hpp> + #include <Swiften/Base/API.h> -#include <Swiften/Base/boost_bsignals.h> #include <Swiften/Network/NetworkEnvironment.h> namespace Swift { |