summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-04-01 17:23:49 (GMT)
committerTobias Markmann <tm@ayena.de>2016-04-04 08:28:23 (GMT)
commit741c45b74d5f634622eb5f757c49323274fb8937 (patch)
treeb9cfa6c2fe2e79e03cc8cb7c1ca1e9cf45aa5328 /Swiften/LinkLocal/DNSSD
parenteddd92ed76ae68cb1e202602fd3ebd11b69191a2 (diff)
downloadswift-741c45b74d5f634622eb5f757c49323274fb8937.zip
swift-741c45b74d5f634622eb5f757c49323274fb8937.tar.bz2
Modernize code to use C++11 shared_ptr instead of Boost's
This change was done by applying the following 'gsed' replacement calls to all source files: 's/\#include <boost\/shared_ptr\.hpp>/\#include <memory>/g' 's/\#include <boost\/enable_shared_from_this\.hpp>/\#include <memory>/g' 's/\#include <boost\/smart_ptr\/make_shared\.hpp>/\#include <memory>/g' 's/\#include <boost\/make_shared\.hpp>/\#include <memory>/g' 's/\#include <boost\/weak_ptr\.hpp>/\#include <memory>/g' 's/boost::make_shared/std::make_shared/g' 's/boost::dynamic_pointer_cast/std::dynamic_pointer_cast/g' 's/boost::shared_ptr/std::shared_ptr/g' 's/boost::weak_ptr/std::weak_ptr/g' 's/boost::enable_shared_from_this/std::enable_shared_from_this/g' The remaining issues have been fixed manually. Test-Information: Code builds on OS X 10.11.4 and unit tests pass. Change-Id: Ia7ae34eab869fb9ad6387a1348426b71ae4acd5f
Diffstat (limited to 'Swiften/LinkLocal/DNSSD')
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp16
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h13
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h9
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp24
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h19
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h10
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/DNSSDQuerier.h12
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp42
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h32
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp2
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h9
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h2
-rw-r--r--Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp10
-rw-r--r--Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h6
28 files changed, 114 insertions, 120 deletions
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
index 767ee1d..a227613 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiBrowseQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class AvahiBrowseQuery : public DNSSDBrowseQuery, public AvahiQuery {
public:
- AvahiBrowseQuery(boost::shared_ptr<AvahiQuerier> q, EventLoop* eventLoop) : AvahiQuery(q, eventLoop), browser(NULL) {
+ AvahiBrowseQuery(std::shared_ptr<AvahiQuerier> q, EventLoop* eventLoop) : AvahiQuery(q, eventLoop), browser(NULL) {
}
void startBrowsing();
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
index 11f1650..1b79946 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.cpp
@@ -21,20 +21,20 @@ AvahiQuerier::AvahiQuerier(EventLoop* eventLoop) : eventLoop(eventLoop), client(
AvahiQuerier::~AvahiQuerier() {
}
-boost::shared_ptr<DNSSDBrowseQuery> AvahiQuerier::createBrowseQuery() {
- return boost::shared_ptr<DNSSDBrowseQuery>(new AvahiBrowseQuery(shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDBrowseQuery> AvahiQuerier::createBrowseQuery() {
+ return std::make_shared<AvahiBrowseQuery>(shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDRegisterQuery> AvahiQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
- return boost::shared_ptr<DNSSDRegisterQuery>(new AvahiRegisterQuery(name, port, info, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDRegisterQuery> AvahiQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
+ return std::make_shared<AvahiRegisterQuery>(name, port, info, shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDResolveServiceQuery> AvahiQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
- return boost::shared_ptr<DNSSDResolveServiceQuery>(new AvahiResolveServiceQuery(service, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDResolveServiceQuery> AvahiQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
+ return std::make_shared<AvahiResolveServiceQuery>(service, shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDResolveHostnameQuery> AvahiQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
- return boost::shared_ptr<DNSSDResolveHostnameQuery>(new AvahiResolveHostnameQuery(hostname, interfaceIndex, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDResolveHostnameQuery> AvahiQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
+ return std::make_shared<AvahiResolveHostnameQuery>(hostname, interfaceIndex, shared_from_this(), eventLoop);
}
void AvahiQuerier::start() {
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h
index fa9580e..5dce19d 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuerier.h
@@ -6,8 +6,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <avahi-client/client.h>
#include <avahi-client/lookup.h>
@@ -24,17 +23,17 @@ namespace Swift {
class AvahiQuerier :
public DNSSDQuerier,
- public boost::enable_shared_from_this<AvahiQuerier> {
+ public std::enable_shared_from_this<AvahiQuerier> {
public:
AvahiQuerier(EventLoop* eventLoop);
~AvahiQuerier();
- boost::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
- boost::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
+ std::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
+ std::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
const std::string& name, int port, const ByteArray& info);
- boost::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
+ std::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
const DNSSDServiceID&);
- boost::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
+ std::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
const std::string& hostname, int interfaceIndex);
void start();
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp
index 97a7912..08997f6 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.cpp
@@ -10,7 +10,7 @@
namespace Swift {
-AvahiQuery::AvahiQuery(boost::shared_ptr<AvahiQuerier> q, EventLoop* eventLoop) : querier(q), eventLoop(eventLoop) {
+AvahiQuery::AvahiQuery(std::shared_ptr<AvahiQuerier> q, EventLoop* eventLoop) : querier(q), eventLoop(eventLoop) {
}
AvahiQuery::~AvahiQuery() {
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h
index 5752003..1b98bbf 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiQuery.h
@@ -6,8 +6,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/EventLoop/EventOwner.h>
@@ -17,13 +16,13 @@ namespace Swift {
class AvahiQuery :
public EventOwner,
- public boost::enable_shared_from_this<AvahiQuery> {
+ public std::enable_shared_from_this<AvahiQuery> {
public:
- AvahiQuery(boost::shared_ptr<AvahiQuerier>, EventLoop* eventLoop);
+ AvahiQuery(std::shared_ptr<AvahiQuerier>, EventLoop* eventLoop);
virtual ~AvahiQuery();
protected:
- boost::shared_ptr<AvahiQuerier> querier;
+ std::shared_ptr<AvahiQuerier> querier;
EventLoop* eventLoop;
};
}
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h
index 5570559..68281d0 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiRegisterQuery.h
@@ -18,7 +18,7 @@ namespace Swift {
class AvahiRegisterQuery : public DNSSDRegisterQuery, public AvahiQuery {
public:
- AvahiRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), name(name), port(port), txtRecord(txtRecord), group(0) {
+ AvahiRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), name(name), port(port), txtRecord(txtRecord), group(0) {
}
void registerService();
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
index af1a048..6510275 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.cpp
@@ -12,7 +12,7 @@
namespace Swift {
-AvahiResolveHostnameQuery::AvahiResolveHostnameQuery(const std::string& hostname, int, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), hostname(hostname) {
+AvahiResolveHostnameQuery::AvahiResolveHostnameQuery(const std::string& hostname, int, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), hostname(hostname) {
std::cout << "Resolving hostname " << hostname << std::endl;
}
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
index 9d21bf9..5498285 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveHostnameQuery.h
@@ -20,7 +20,7 @@ namespace Swift {
class AvahiResolveHostnameQuery : public DNSSDResolveHostnameQuery, public AvahiQuery {
public:
- AvahiResolveHostnameQuery(const std::string& hostname, int, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop);
+ AvahiResolveHostnameQuery(const std::string& hostname, int, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop);
void run();
diff --git a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
index c95d131..c05c73e 100644
--- a/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Avahi/AvahiResolveServiceQuery.h
@@ -19,7 +19,7 @@ namespace Swift {
class AvahiResolveServiceQuery : public DNSSDResolveServiceQuery, public AvahiQuery {
public:
- AvahiResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), service(service), resolver(NULL) {
+ AvahiResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr<AvahiQuerier> querier, EventLoop* eventLoop) : AvahiQuery(querier, eventLoop), service(service), resolver(NULL) {
}
void start();
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
index 988f025..c049ed2 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourBrowseQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class BonjourBrowseQuery : public DNSSDBrowseQuery, public BonjourQuery {
public:
- BonjourBrowseQuery(boost::shared_ptr<BonjourQuerier> q, EventLoop* eventLoop) : BonjourQuery(q, eventLoop) {
+ BonjourBrowseQuery(std::shared_ptr<BonjourQuerier> q, EventLoop* eventLoop) : BonjourQuery(q, eventLoop) {
DNSServiceErrorType result = DNSServiceBrowse(
&sdRef, 0, 0, "_presence._tcp", nullptr,
&BonjourBrowseQuery::handleServiceDiscoveredStatic, this);
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp
index fda5032..e6d8b94 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp
@@ -33,23 +33,23 @@ BonjourQuerier::~BonjourQuerier() {
assert(!thread);
}
-boost::shared_ptr<DNSSDBrowseQuery> BonjourQuerier::createBrowseQuery() {
- return boost::shared_ptr<DNSSDBrowseQuery>(new BonjourBrowseQuery(shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDBrowseQuery> BonjourQuerier::createBrowseQuery() {
+ return std::make_shared<BonjourBrowseQuery>(shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDRegisterQuery> BonjourQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
- return boost::shared_ptr<DNSSDRegisterQuery>(new BonjourRegisterQuery(name, port, info, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDRegisterQuery> BonjourQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
+ return std::make_shared<BonjourRegisterQuery>(name, port, info, shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDResolveServiceQuery> BonjourQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
- return boost::shared_ptr<DNSSDResolveServiceQuery>(new BonjourResolveServiceQuery(service, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDResolveServiceQuery> BonjourQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
+ return std::make_shared<BonjourResolveServiceQuery>(service, shared_from_this(), eventLoop);
}
-boost::shared_ptr<DNSSDResolveHostnameQuery> BonjourQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
- return boost::shared_ptr<DNSSDResolveHostnameQuery>(new BonjourResolveHostnameQuery(hostname, interfaceIndex, shared_from_this(), eventLoop));
+std::shared_ptr<DNSSDResolveHostnameQuery> BonjourQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
+ return std::make_shared<BonjourResolveHostnameQuery>(hostname, interfaceIndex, shared_from_this(), eventLoop);
}
-void BonjourQuerier::addRunningQuery(boost::shared_ptr<BonjourQuery> query) {
+void BonjourQuerier::addRunningQuery(std::shared_ptr<BonjourQuery> query) {
{
boost::lock_guard<boost::mutex> lock(runningQueriesMutex);
runningQueries.push_back(query);
@@ -58,7 +58,7 @@ void BonjourQuerier::addRunningQuery(boost::shared_ptr<BonjourQuery> query) {
interruptSelect();
}
-void BonjourQuerier::removeRunningQuery(boost::shared_ptr<BonjourQuery> query) {
+void BonjourQuerier::removeRunningQuery(std::shared_ptr<BonjourQuery> query) {
{
boost::lock_guard<boost::mutex> lock(runningQueriesMutex);
erase(runningQueries, query);
@@ -106,7 +106,7 @@ void BonjourQuerier::run() {
maxSocket = interruptSelectReadSocket;
FD_SET(interruptSelectReadSocket, &fdSet);
- foreach(const boost::shared_ptr<BonjourQuery>& query, runningQueries) {
+ foreach(const std::shared_ptr<BonjourQuery>& query, runningQueries) {
int socketID = query->getSocketID();
maxSocket = std::max(maxSocket, socketID);
FD_SET(socketID, &fdSet);
@@ -124,7 +124,7 @@ void BonjourQuerier::run() {
{
boost::lock_guard<boost::mutex> lock(runningQueriesMutex);
- foreach(boost::shared_ptr<BonjourQuery> query, runningQueries) {
+ foreach(std::shared_ptr<BonjourQuery> query, runningQueries) {
if (FD_ISSET(query->getSocketID(), &fdSet)) {
query->processResult();
}
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h
index 74140ac..199eeb2 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.h
@@ -7,9 +7,8 @@
#pragma once
#include <list>
+#include <memory>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
@@ -20,17 +19,17 @@
namespace Swift {
class BonjourQuerier :
public DNSSDQuerier,
- public boost::enable_shared_from_this<BonjourQuerier> {
+ public std::enable_shared_from_this<BonjourQuerier> {
public:
BonjourQuerier(EventLoop* eventLoop);
~BonjourQuerier();
- boost::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
- boost::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
+ std::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
+ std::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
const std::string& name, int port, const ByteArray& info);
- boost::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
+ std::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
const DNSSDServiceID&);
- boost::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
+ std::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
const std::string& hostname, int interfaceIndex);
void start();
@@ -39,8 +38,8 @@ namespace Swift {
private:
friend class BonjourQuery;
- void addRunningQuery(boost::shared_ptr<BonjourQuery>);
- void removeRunningQuery(boost::shared_ptr<BonjourQuery>);
+ void addRunningQuery(std::shared_ptr<BonjourQuery>);
+ void removeRunningQuery(std::shared_ptr<BonjourQuery>);
void interruptSelect();
void run();
@@ -49,7 +48,7 @@ namespace Swift {
bool stopRequested;
boost::thread* thread;
boost::mutex runningQueriesMutex;
- std::list< boost::shared_ptr<BonjourQuery> > runningQueries;
+ std::list< std::shared_ptr<BonjourQuery> > runningQueries;
int interruptSelectReadSocket;
int interruptSelectWriteSocket;
boost::condition_variable runningQueriesAvailableEvent;
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp
index fa4b6fe..5f9a98f 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.cpp
@@ -10,7 +10,7 @@
namespace Swift {
-BonjourQuery::BonjourQuery(boost::shared_ptr<BonjourQuerier> q, EventLoop* eventLoop) : eventLoop(eventLoop), querier(q), sdRef(nullptr) {
+BonjourQuery::BonjourQuery(std::shared_ptr<BonjourQuerier> q, EventLoop* eventLoop) : eventLoop(eventLoop), querier(q), sdRef(nullptr) {
}
BonjourQuery::~BonjourQuery() {
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h
index 2e3eb80..5520158 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuery.h
@@ -6,8 +6,8 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
+
#include <boost/thread/mutex.hpp>
#include <dns_sd.h>
@@ -20,9 +20,9 @@ namespace Swift {
class BonjourQuery :
public EventOwner,
- public boost::enable_shared_from_this<BonjourQuery> {
+ public std::enable_shared_from_this<BonjourQuery> {
public:
- BonjourQuery(boost::shared_ptr<BonjourQuerier>, EventLoop* eventLoop);
+ BonjourQuery(std::shared_ptr<BonjourQuerier>, EventLoop* eventLoop);
virtual ~BonjourQuery();
void processResult();
@@ -34,7 +34,7 @@ namespace Swift {
protected:
EventLoop* eventLoop;
- boost::shared_ptr<BonjourQuerier> querier;
+ std::shared_ptr<BonjourQuerier> querier;
mutable boost::mutex sdRefMutex;
DNSServiceRef sdRef;
};
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h
index 67c96bd..776b434 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourRegisterQuery.h
@@ -19,7 +19,7 @@ namespace Swift {
class BonjourRegisterQuery : public DNSSDRegisterQuery, public BonjourQuery {
public:
- BonjourRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, boost::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
+ BonjourRegisterQuery(const std::string& name, int port, const ByteArray& txtRecord, std::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
DNSServiceErrorType result = DNSServiceRegister(
&sdRef, 0, 0, name.c_str(), "_presence._tcp", nullptr, nullptr, boost::numeric_cast<unsigned short>(port),
boost::numeric_cast<unsigned short>(txtRecord.size()), vecptr(txtRecord),
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h
index adc5486..dbf3f0e 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveHostnameQuery.h
@@ -22,7 +22,7 @@ namespace Swift {
class BonjourResolveHostnameQuery : public DNSSDResolveHostnameQuery, public BonjourQuery {
public:
- BonjourResolveHostnameQuery(const std::string& hostname, int interfaceIndex, boost::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
+ BonjourResolveHostnameQuery(const std::string& hostname, int interfaceIndex, std::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
DNSServiceErrorType result = DNSServiceGetAddrInfo(
&sdRef, 0, boost::numeric_cast<unsigned int>(interfaceIndex), kDNSServiceProtocol_IPv4,
hostname.c_str(),
diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h
index ee20a25..86b6015 100644
--- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourResolveServiceQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class BonjourResolveServiceQuery : public DNSSDResolveServiceQuery, public BonjourQuery {
public:
- BonjourResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
+ BonjourResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr<BonjourQuerier> querier, EventLoop* eventLoop) : BonjourQuery(querier, eventLoop) {
DNSServiceErrorType result = DNSServiceResolve(
&sdRef, 0, boost::numeric_cast<unsigned int>(service.getNetworkInterfaceID()),
service.getName().c_str(), service.getType().c_str(),
diff --git a/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h b/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h
index 85051fe..8f3c3ec 100644
--- a/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/DNSSDQuerier.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/ByteArray.h>
@@ -24,12 +24,12 @@ namespace Swift {
virtual void start() = 0;
virtual void stop() = 0;
- virtual boost::shared_ptr<DNSSDBrowseQuery> createBrowseQuery() = 0;
- virtual boost::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
+ virtual std::shared_ptr<DNSSDBrowseQuery> createBrowseQuery() = 0;
+ virtual std::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
const std::string& name, int port, const ByteArray& info) = 0;
- virtual boost::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
+ virtual std::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
const DNSSDServiceID&) = 0;
- virtual boost::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
+ virtual std::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
const std::string& hostname, int interfaceIndex) = 0;
};
}
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h
index 860de41..15d8128 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDBrowseQuery.h
@@ -14,7 +14,7 @@ namespace Swift {
class FakeDNSSDBrowseQuery : public DNSSDBrowseQuery, public FakeDNSSDQuery {
public:
- FakeDNSSDBrowseQuery(boost::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier) {
+ FakeDNSSDBrowseQuery(std::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier) {
}
void startBrowsing() {
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
index 89698a6..63ad3b8 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.cpp
@@ -29,42 +29,42 @@ FakeDNSSDQuerier::~FakeDNSSDQuerier() {
}
}
-boost::shared_ptr<DNSSDBrowseQuery> FakeDNSSDQuerier::createBrowseQuery() {
- return boost::shared_ptr<DNSSDBrowseQuery>(new FakeDNSSDBrowseQuery(shared_from_this()));
+std::shared_ptr<DNSSDBrowseQuery> FakeDNSSDQuerier::createBrowseQuery() {
+ return std::make_shared<FakeDNSSDBrowseQuery>(shared_from_this());
}
-boost::shared_ptr<DNSSDRegisterQuery> FakeDNSSDQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
- return boost::shared_ptr<DNSSDRegisterQuery>(new FakeDNSSDRegisterQuery(name, port, info, shared_from_this()));
+std::shared_ptr<DNSSDRegisterQuery> FakeDNSSDQuerier::createRegisterQuery(const std::string& name, int port, const ByteArray& info) {
+ return std::make_shared<FakeDNSSDRegisterQuery>(name, port, info, shared_from_this());
}
-boost::shared_ptr<DNSSDResolveServiceQuery> FakeDNSSDQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
- return boost::shared_ptr<DNSSDResolveServiceQuery>(new FakeDNSSDResolveServiceQuery(service, shared_from_this()));
+std::shared_ptr<DNSSDResolveServiceQuery> FakeDNSSDQuerier::createResolveServiceQuery(const DNSSDServiceID& service) {
+ return std::make_shared<FakeDNSSDResolveServiceQuery>(service, shared_from_this());
}
-boost::shared_ptr<DNSSDResolveHostnameQuery> FakeDNSSDQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
- return boost::shared_ptr<DNSSDResolveHostnameQuery>(new FakeDNSSDResolveHostnameQuery(hostname, interfaceIndex, shared_from_this()));
+std::shared_ptr<DNSSDResolveHostnameQuery> FakeDNSSDQuerier::createResolveHostnameQuery(const std::string& hostname, int interfaceIndex) {
+ return std::make_shared<FakeDNSSDResolveHostnameQuery>(hostname, interfaceIndex, shared_from_this());
}
-void FakeDNSSDQuerier::addRunningQuery(boost::shared_ptr<FakeDNSSDQuery> query) {
+void FakeDNSSDQuerier::addRunningQuery(std::shared_ptr<FakeDNSSDQuery> query) {
runningQueries.push_back(query);
allQueriesEverRun.push_back(query);
- if (boost::shared_ptr<FakeDNSSDBrowseQuery> browseQuery = boost::dynamic_pointer_cast<FakeDNSSDBrowseQuery>(query)) {
+ if (std::shared_ptr<FakeDNSSDBrowseQuery> browseQuery = std::dynamic_pointer_cast<FakeDNSSDBrowseQuery>(query)) {
foreach(const DNSSDServiceID& service, services) {
eventLoop->postEvent(boost::bind(boost::ref(browseQuery->onServiceAdded), service), shared_from_this());
}
}
- else if (boost::shared_ptr<FakeDNSSDResolveServiceQuery> resolveQuery = boost::dynamic_pointer_cast<FakeDNSSDResolveServiceQuery>(query)) {
+ else if (std::shared_ptr<FakeDNSSDResolveServiceQuery> resolveQuery = std::dynamic_pointer_cast<FakeDNSSDResolveServiceQuery>(query)) {
for(ServiceInfoMap::const_iterator i = serviceInfo.begin(); i != serviceInfo.end(); ++i) {
if (i->first == resolveQuery->service) {
eventLoop->postEvent(boost::bind(boost::ref(resolveQuery->onServiceResolved), i->second), shared_from_this());
}
}
}
- else if (boost::shared_ptr<FakeDNSSDRegisterQuery> registerQuery = boost::dynamic_pointer_cast<FakeDNSSDRegisterQuery>(query)) {
+ else if (std::shared_ptr<FakeDNSSDRegisterQuery> registerQuery = std::dynamic_pointer_cast<FakeDNSSDRegisterQuery>(query)) {
DNSSDServiceID service(registerQuery->name, domain);
eventLoop->postEvent(boost::bind(boost::ref(registerQuery->onRegisterFinished), service), shared_from_this());
}
- else if (boost::shared_ptr<FakeDNSSDResolveHostnameQuery> resolveHostnameQuery = boost::dynamic_pointer_cast<FakeDNSSDResolveHostnameQuery>(query)) {
+ else if (std::shared_ptr<FakeDNSSDResolveHostnameQuery> resolveHostnameQuery = std::dynamic_pointer_cast<FakeDNSSDResolveHostnameQuery>(query)) {
std::map<std::string,boost::optional<HostAddress> >::const_iterator i = addresses.find(resolveHostnameQuery->hostname);
if (i != addresses.end()) {
eventLoop->postEvent(
@@ -75,13 +75,13 @@ void FakeDNSSDQuerier::addRunningQuery(boost::shared_ptr<FakeDNSSDQuery> query)
}
}
-void FakeDNSSDQuerier::removeRunningQuery(boost::shared_ptr<FakeDNSSDQuery> query) {
+void FakeDNSSDQuerier::removeRunningQuery(std::shared_ptr<FakeDNSSDQuery> query) {
erase(runningQueries, query);
}
void FakeDNSSDQuerier::addService(const DNSSDServiceID& id) {
services.insert(id);
- foreach(const boost::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
eventLoop->postEvent(boost::bind(boost::ref(query->onServiceAdded), id), shared_from_this());
}
}
@@ -89,7 +89,7 @@ void FakeDNSSDQuerier::addService(const DNSSDServiceID& id) {
void FakeDNSSDQuerier::removeService(const DNSSDServiceID& id) {
services.erase(id);
serviceInfo.erase(id);
- foreach(const boost::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
eventLoop->postEvent(boost::bind(boost::ref(query->onServiceRemoved), id), shared_from_this());
}
}
@@ -99,7 +99,7 @@ void FakeDNSSDQuerier::setServiceInfo(const DNSSDServiceID& id, const DNSSDResol
if (!r.second) {
r.first->second = info;
}
- foreach(const boost::shared_ptr<FakeDNSSDResolveServiceQuery>& query, getQueries<FakeDNSSDResolveServiceQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDResolveServiceQuery>& query, getQueries<FakeDNSSDResolveServiceQuery>()) {
if (query->service == id) {
eventLoop->postEvent(boost::bind(boost::ref(query->onServiceResolved), info), shared_from_this());
}
@@ -107,7 +107,7 @@ void FakeDNSSDQuerier::setServiceInfo(const DNSSDServiceID& id, const DNSSDResol
}
bool FakeDNSSDQuerier::isServiceRegistered(const std::string& name, int port, const ByteArray& info) {
- foreach(const boost::shared_ptr<FakeDNSSDRegisterQuery>& query, getQueries<FakeDNSSDRegisterQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDRegisterQuery>& query, getQueries<FakeDNSSDRegisterQuery>()) {
if (query->name == name && query->port == port && query->info == info) {
return true;
}
@@ -116,20 +116,20 @@ bool FakeDNSSDQuerier::isServiceRegistered(const std::string& name, int port, co
}
void FakeDNSSDQuerier::setBrowseError() {
- foreach(const boost::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDBrowseQuery>& query, getQueries<FakeDNSSDBrowseQuery>()) {
eventLoop->postEvent(boost::ref(query->onError), shared_from_this());
}
}
void FakeDNSSDQuerier::setRegisterError() {
- foreach(const boost::shared_ptr<FakeDNSSDRegisterQuery>& query, getQueries<FakeDNSSDRegisterQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDRegisterQuery>& query, getQueries<FakeDNSSDRegisterQuery>()) {
eventLoop->postEvent(boost::bind(boost::ref(query->onRegisterFinished), boost::optional<DNSSDServiceID>()), shared_from_this());
}
}
void FakeDNSSDQuerier::setAddress(const std::string& hostname, boost::optional<HostAddress> address) {
addresses[hostname] = address;
- foreach(const boost::shared_ptr<FakeDNSSDResolveHostnameQuery>& query, getQueries<FakeDNSSDResolveHostnameQuery>()) {
+ foreach(const std::shared_ptr<FakeDNSSDResolveHostnameQuery>& query, getQueries<FakeDNSSDResolveHostnameQuery>()) {
if (query->hostname == hostname) {
eventLoop->postEvent(boost::bind(
boost::ref(query->onHostnameResolved), address), shared_from_this());
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
index 536bf90..85fdc3a 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuerier.h
@@ -7,12 +7,10 @@
#pragma once
#include <list>
+#include <memory>
#include <set>
#include <string>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/EventLoop/EventOwner.h>
@@ -28,7 +26,7 @@ namespace Swift {
class SWIFTEN_API FakeDNSSDQuerier :
public DNSSDQuerier,
public EventOwner,
- public boost::enable_shared_from_this<FakeDNSSDQuerier> {
+ public std::enable_shared_from_this<FakeDNSSDQuerier> {
public:
FakeDNSSDQuerier(const std::string& domain, EventLoop* eventLoop);
~FakeDNSSDQuerier();
@@ -40,16 +38,16 @@ namespace Swift {
allQueriesEverRun.clear();
}
- boost::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
- boost::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
+ std::shared_ptr<DNSSDBrowseQuery> createBrowseQuery();
+ std::shared_ptr<DNSSDRegisterQuery> createRegisterQuery(
const std::string& name, int port, const ByteArray& info);
- boost::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
+ std::shared_ptr<DNSSDResolveServiceQuery> createResolveServiceQuery(
const DNSSDServiceID&);
- boost::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
+ std::shared_ptr<DNSSDResolveHostnameQuery> createResolveHostnameQuery(
const std::string& hostname, int interfaceIndex);
- void addRunningQuery(boost::shared_ptr<FakeDNSSDQuery>);
- void removeRunningQuery(boost::shared_ptr<FakeDNSSDQuery>);
+ void addRunningQuery(std::shared_ptr<FakeDNSSDQuery>);
+ void removeRunningQuery(std::shared_ptr<FakeDNSSDQuery>);
void addService(const DNSSDServiceID& id);
void removeService(const DNSSDServiceID& id);
@@ -62,10 +60,10 @@ namespace Swift {
public:
template<typename T>
- std::vector< boost::shared_ptr<T> > getAllQueriesEverRun() const {
- std::vector< boost::shared_ptr<T> > result;
+ std::vector< std::shared_ptr<T> > getAllQueriesEverRun() const {
+ std::vector< std::shared_ptr<T> > result;
for (QueryList::const_iterator i = allQueriesEverRun.begin(); i != allQueriesEverRun.end(); ++i) {
- if (boost::shared_ptr<T> resultQuery = boost::dynamic_pointer_cast<T>(*i)) {
+ if (std::shared_ptr<T> resultQuery = std::dynamic_pointer_cast<T>(*i)) {
result.push_back(resultQuery);
}
}
@@ -74,10 +72,10 @@ namespace Swift {
private:
template<typename T>
- std::vector< boost::shared_ptr<T> > getQueries() const {
- std::vector< boost::shared_ptr<T> > result;
+ std::vector< std::shared_ptr<T> > getQueries() const {
+ std::vector< std::shared_ptr<T> > result;
for (QueryList::const_iterator i = runningQueries.begin(); i != runningQueries.end(); ++i) {
- if (boost::shared_ptr<T> resultQuery = boost::dynamic_pointer_cast<T>(*i)) {
+ if (std::shared_ptr<T> resultQuery = std::dynamic_pointer_cast<T>(*i)) {
result.push_back(resultQuery);
}
}
@@ -87,7 +85,7 @@ namespace Swift {
private:
std::string domain;
EventLoop* eventLoop;
- typedef std::list< boost::shared_ptr<FakeDNSSDQuery> > QueryList;
+ typedef std::list< std::shared_ptr<FakeDNSSDQuery> > QueryList;
QueryList runningQueries;
QueryList allQueriesEverRun;
std::set<DNSSDServiceID> services;
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp
index 980b757..0e05968 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.cpp
@@ -10,7 +10,7 @@
namespace Swift {
-FakeDNSSDQuery::FakeDNSSDQuery(boost::shared_ptr<FakeDNSSDQuerier> querier) : querier(querier) {
+FakeDNSSDQuery::FakeDNSSDQuery(std::shared_ptr<FakeDNSSDQuerier> querier) : querier(querier) {
}
FakeDNSSDQuery::~FakeDNSSDQuery() {
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h
index 0d7dedc..5d869d4 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDQuery.h
@@ -6,8 +6,7 @@
#pragma once
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/EventLoop/EventOwner.h>
@@ -16,9 +15,9 @@ namespace Swift {
class FakeDNSSDQuery :
public EventOwner,
- public boost::enable_shared_from_this<FakeDNSSDQuery> {
+ public std::enable_shared_from_this<FakeDNSSDQuery> {
public:
- FakeDNSSDQuery(boost::shared_ptr<FakeDNSSDQuerier>);
+ FakeDNSSDQuery(std::shared_ptr<FakeDNSSDQuerier>);
virtual ~FakeDNSSDQuery();
protected:
@@ -26,6 +25,6 @@ namespace Swift {
void finish();
protected:
- boost::shared_ptr<FakeDNSSDQuerier> querier;
+ std::shared_ptr<FakeDNSSDQuerier> querier;
};
}
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h
index 484b2c2..7478841 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDRegisterQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class FakeDNSSDRegisterQuery : public DNSSDRegisterQuery, public FakeDNSSDQuery {
public:
- FakeDNSSDRegisterQuery(const std::string& name, int port, const ByteArray& info, boost::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), name(name), port(port), info(info) {
+ FakeDNSSDRegisterQuery(const std::string& name, int port, const ByteArray& info, std::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), name(name), port(port), info(info) {
}
void registerService() {
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h
index 0b6a95d..60dc144 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveHostnameQuery.h
@@ -17,7 +17,7 @@ namespace Swift {
class FakeDNSSDResolveHostnameQuery : public DNSSDResolveHostnameQuery, public FakeDNSSDQuery {
public:
- FakeDNSSDResolveHostnameQuery(const std::string& hostname, int interfaceIndex, boost::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), hostname(hostname), interfaceIndex(interfaceIndex) {
+ FakeDNSSDResolveHostnameQuery(const std::string& hostname, int interfaceIndex, std::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), hostname(hostname), interfaceIndex(interfaceIndex) {
}
void run() {
diff --git a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h
index 180fbb2..8a02e7b 100644
--- a/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h
+++ b/Swiften/LinkLocal/DNSSD/Fake/FakeDNSSDResolveServiceQuery.h
@@ -15,7 +15,7 @@ namespace Swift {
class FakeDNSSDResolveServiceQuery : public DNSSDResolveServiceQuery, public FakeDNSSDQuery {
public:
- FakeDNSSDResolveServiceQuery(const DNSSDServiceID& service, boost::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), service(service) {
+ FakeDNSSDResolveServiceQuery(const DNSSDServiceID& service, std::shared_ptr<FakeDNSSDQuerier> querier) : FakeDNSSDQuery(querier), service(service) {
}
void start() {
diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp
index f2bfa2e..e20326b 100644
--- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp
+++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2015 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -18,14 +18,14 @@ namespace Swift {
PlatformDNSSDQuerierFactory::PlatformDNSSDQuerierFactory(EventLoop* eventLoop) : eventLoop(eventLoop) {
}
-boost::shared_ptr<DNSSDQuerier> PlatformDNSSDQuerierFactory::createQuerier() {
+std::shared_ptr<DNSSDQuerier> PlatformDNSSDQuerierFactory::createQuerier() {
#if defined(HAVE_BONJOUR)
- return boost::shared_ptr<DNSSDQuerier>(new BonjourQuerier(eventLoop));
+ return std::make_shared<BonjourQuerier>(eventLoop);
#elif defined(HAVE_AVAHI)
- return boost::shared_ptr<DNSSDQuerier>(new AvahiQuerier(eventLoop));
+ return std::make_shared<AvahiQuerier>(eventLoop);
#else
(void)eventLoop;
- return boost::shared_ptr<DNSSDQuerier>();
+ return std::shared_ptr<DNSSDQuerier>();
#endif
}
diff --git a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
index dc40d01..68e10cf 100644
--- a/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
+++ b/Swiften/LinkLocal/DNSSD/PlatformDNSSDQuerierFactory.h
@@ -1,12 +1,12 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
@@ -18,7 +18,7 @@ namespace Swift {
public:
PlatformDNSSDQuerierFactory(EventLoop* eventLoop);
- boost::shared_ptr<DNSSDQuerier> createQuerier();
+ std::shared_ptr<DNSSDQuerier> createQuerier();
bool canCreate();