diff options
author | Tobias Markmann <tm@ayena.de> | 2016-04-01 17:23:49 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-04-04 08:28:23 (GMT) |
commit | 741c45b74d5f634622eb5f757c49323274fb8937 (patch) | |
tree | b9cfa6c2fe2e79e03cc8cb7c1ca1e9cf45aa5328 /Sluift/SluiftClient.h | |
parent | eddd92ed76ae68cb1e202602fd3ebd11b69191a2 (diff) | |
download | swift-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 'Sluift/SluiftClient.h')
-rw-r--r-- | Sluift/SluiftClient.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Sluift/SluiftClient.h b/Sluift/SluiftClient.h index d7c3b32..42a59e9 100644 --- a/Sluift/SluiftClient.h +++ b/Sluift/SluiftClient.h @@ -45,18 +45,18 @@ namespace Swift { PubSubEventType }; - Event(boost::shared_ptr<Message> stanza) : type(MessageType), stanza(stanza) {} - Event(boost::shared_ptr<Presence> stanza) : type(PresenceType), stanza(stanza) {} - Event(const JID& from, boost::shared_ptr<PubSubEventPayload> payload) : type(PubSubEventType), from(from), pubsubEvent(payload) {} + Event(std::shared_ptr<Message> stanza) : type(MessageType), stanza(stanza) {} + Event(std::shared_ptr<Presence> stanza) : type(PresenceType), stanza(stanza) {} + Event(const JID& from, std::shared_ptr<PubSubEventPayload> payload) : type(PubSubEventType), from(from), pubsubEvent(payload) {} Type type; // Message & Presence - boost::shared_ptr<Stanza> stanza; + std::shared_ptr<Stanza> stanza; // PubSubEvent JID from; - boost::shared_ptr<PubSubEventPayload> pubsubEvent; + std::shared_ptr<PubSubEventPayload> pubsubEvent; }; SluiftClient( @@ -82,7 +82,7 @@ namespace Swift { template<typename T> Sluift::Response sendPubSubRequest( - IQ::Type type, const JID& jid, boost::shared_ptr<T> payload, int timeout) { + IQ::Type type, const JID& jid, std::shared_ptr<T> payload, int timeout) { return sendRequest(client->getPubSubManager()->createRequest( type, jid, payload), timeout); } @@ -97,7 +97,7 @@ namespace Swift { template<typename REQUEST_TYPE> Sluift::Response sendVoidRequest(REQUEST_TYPE request, int timeout) { boost::signals::scoped_connection c = request->onResponse.connect( - boost::bind(&SluiftClient::handleRequestResponse, this, boost::shared_ptr<Payload>(), _1)); + boost::bind(&SluiftClient::handleRequestResponse, this, std::shared_ptr<Payload>(), _1)); return doSendRequest(request, timeout); } @@ -108,13 +108,13 @@ namespace Swift { std::vector<XMPPRosterItem> getRoster(int timeout); private: - Sluift::Response doSendRequest(boost::shared_ptr<Request> request, int timeout); + Sluift::Response doSendRequest(std::shared_ptr<Request> request, int timeout); - void handleIncomingMessage(boost::shared_ptr<Message> stanza); - void handleIncomingPresence(boost::shared_ptr<Presence> stanza); - void handleIncomingPubSubEvent(const JID& from, boost::shared_ptr<PubSubEventPayload> event); + void handleIncomingMessage(std::shared_ptr<Message> stanza); + void handleIncomingPresence(std::shared_ptr<Presence> stanza); + void handleIncomingPubSubEvent(const JID& from, std::shared_ptr<PubSubEventPayload> event); void handleInitialRosterPopulated(); - void handleRequestResponse(boost::shared_ptr<Payload> response, boost::shared_ptr<ErrorPayload> error); + void handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error); void handleDisconnected(const boost::optional<ClientError>& error); private: @@ -127,7 +127,7 @@ namespace Swift { std::deque<Event> pendingEvents; boost::optional<ClientError> disconnectedError; bool requestResponseReceived; - boost::shared_ptr<Payload> requestResponse; - boost::shared_ptr<ErrorPayload> requestError; + std::shared_ptr<Payload> requestResponse; + std::shared_ptr<ErrorPayload> requestError; }; } |