diff options
Diffstat (limited to 'Swiften/Client/ClientSession.h')
-rw-r--r-- | Swiften/Client/ClientSession.h | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h index b1b6755..7309218 100644 --- a/Swiften/Client/ClientSession.h +++ b/Swiften/Client/ClientSession.h @@ -6,11 +6,9 @@ #pragma once +#include <memory> #include <string> -#include <boost/enable_shared_from_this.hpp> -#include <boost/shared_ptr.hpp> - #include <Swiften/Base/API.h> #include <Swiften/Base/Error.h> #include <Swiften/Base/boost_bsignals.h> @@ -26,7 +24,7 @@ namespace Swift { class IDNConverter; class CryptoProvider; - class SWIFTEN_API ClientSession : public boost::enable_shared_from_this<ClientSession> { + class SWIFTEN_API ClientSession : public std::enable_shared_from_this<ClientSession> { public: enum State { Initial, @@ -58,7 +56,7 @@ namespace Swift { TLSError, StreamError } type; - boost::shared_ptr<boost::system::error_code> errorCode; + std::shared_ptr<boost::system::error_code> errorCode; Error(Type type) : type(type) {} }; @@ -70,8 +68,8 @@ namespace Swift { ~ClientSession(); - static boost::shared_ptr<ClientSession> create(const JID& jid, boost::shared_ptr<SessionStream> stream, IDNConverter* idnConverter, CryptoProvider* crypto) { - return boost::shared_ptr<ClientSession>(new ClientSession(jid, stream, idnConverter, crypto)); + static std::shared_ptr<ClientSession> create(const JID& jid, std::shared_ptr<SessionStream> stream, IDNConverter* idnConverter, CryptoProvider* crypto) { + return std::shared_ptr<ClientSession>(new ClientSession(jid, stream, idnConverter, crypto)); } State getState() const { @@ -121,7 +119,7 @@ namespace Swift { } void sendCredentials(const SafeByteArray& password); - void sendStanza(boost::shared_ptr<Stanza>); + void sendStanza(std::shared_ptr<Stanza>); void setCertificateTrustChecker(CertificateTrustChecker* checker) { certificateTrustChecker = checker; @@ -142,19 +140,19 @@ namespace Swift { public: boost::signal<void ()> onNeedCredentials; boost::signal<void ()> onInitialized; - boost::signal<void (boost::shared_ptr<Swift::Error>)> onFinished; - boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaReceived; - boost::signal<void (boost::shared_ptr<Stanza>)> onStanzaAcked; + boost::signal<void (std::shared_ptr<Swift::Error>)> onFinished; + boost::signal<void (std::shared_ptr<Stanza>)> onStanzaReceived; + boost::signal<void (std::shared_ptr<Stanza>)> onStanzaAcked; private: ClientSession( const JID& jid, - boost::shared_ptr<SessionStream>, + std::shared_ptr<SessionStream>, IDNConverter* idnConverter, CryptoProvider* crypto); void finishSession(Error::Type error); - void finishSession(boost::shared_ptr<Swift::Error> error); + void finishSession(std::shared_ptr<Swift::Error> error); JID getRemoteJID() const { return JID("", localJID.getDomain()); @@ -162,9 +160,9 @@ namespace Swift { void sendStreamHeader(); - void handleElement(boost::shared_ptr<ToplevelElement>); + void handleElement(std::shared_ptr<ToplevelElement>); void handleStreamStart(const ProtocolHeader&); - void handleStreamClosed(boost::shared_ptr<Swift::Error>); + void handleStreamClosed(std::shared_ptr<Swift::Error>); void handleTLSEncrypted(); @@ -172,15 +170,15 @@ namespace Swift { void continueSessionInitialization(); void requestAck(); - void handleStanzaAcked(boost::shared_ptr<Stanza> stanza); + void handleStanzaAcked(std::shared_ptr<Stanza> stanza); void ack(unsigned int handledStanzasCount); void continueAfterTLSEncrypted(); - void checkTrustOrFinish(const std::vector<Certificate::ref>& certificateChain, boost::shared_ptr<CertificateVerificationError> error); + void checkTrustOrFinish(const std::vector<Certificate::ref>& certificateChain, std::shared_ptr<CertificateVerificationError> error); private: JID localJID; State state; - boost::shared_ptr<SessionStream> stream; + std::shared_ptr<SessionStream> stream; IDNConverter* idnConverter; CryptoProvider* crypto; bool allowPLAINOverNonTLS; @@ -192,9 +190,9 @@ namespace Swift { bool needAcking; bool rosterVersioningSupported; ClientAuthenticator* authenticator; - boost::shared_ptr<StanzaAckRequester> stanzaAckRequester_; - boost::shared_ptr<StanzaAckResponder> stanzaAckResponder_; - boost::shared_ptr<Swift::Error> error_; + std::shared_ptr<StanzaAckRequester> stanzaAckRequester_; + std::shared_ptr<StanzaAckResponder> stanzaAckResponder_; + std::shared_ptr<Swift::Error> error_; CertificateTrustChecker* certificateTrustChecker; bool singleSignOn; int authenticationPort; |