summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-12 19:48:32 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-12 20:41:59 (GMT)
commit8231ecc07c1c7d5e260a2795b0660de157501850 (patch)
tree935baa855914d632086fcac5f26330c2f0261216 /Swiften/Client
parent48bb7441f913144d6a20687ff79264e4631156f0 (diff)
downloadswift-8231ecc07c1c7d5e260a2795b0660de157501850.zip
swift-8231ecc07c1c7d5e260a2795b0660de157501850.tar.bz2
Created a TimerFactory, and abstracted Timer.
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/Client.cpp5
-rw-r--r--Swiften/Client/Client.h7
2 files changed, 7 insertions, 5 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index 6614bf7..2a6d8a0 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -8,6 +8,7 @@
#include "Swiften/StreamStack/PlatformTLSLayerFactory.h"
#include "Swiften/Network/Connector.h"
#include "Swiften/Network/BoostConnectionFactory.h"
+#include "Swiften/Network/BoostTimerFactory.h"
#include "Swiften/Network/DomainNameResolveException.h"
#include "Swiften/TLS/PKCS12Certificate.h"
#include "Swiften/Session/BasicSessionStream.h"
@@ -17,6 +18,7 @@ namespace Swift {
Client::Client(const JID& jid, const String& password) :
IQRouter(this), jid_(jid), password_(password) {
connectionFactory_ = new BoostConnectionFactory(&MainBoostIOServiceThread::getInstance().getIOService());
+ timerFactory_ = new BoostTimerFactory(&MainBoostIOServiceThread::getInstance().getIOService());
tlsLayerFactory_ = new PlatformTLSLayerFactory();
}
@@ -25,6 +27,7 @@ Client::~Client() {
std::cerr << "Warning: Client not disconnected properly" << std::endl;
}
delete tlsLayerFactory_;
+ delete timerFactory_;
delete connectionFactory_;
}
@@ -50,7 +53,7 @@ void Client::handleConnectorFinished(boost::shared_ptr<Connection> connection) {
connection_ = connection;
assert(!sessionStream_);
- sessionStream_ = boost::shared_ptr<BasicSessionStream>(new BasicSessionStream(connection_, &payloadParserFactories_, &payloadSerializers_, tlsLayerFactory_));
+ sessionStream_ = boost::shared_ptr<BasicSessionStream>(new BasicSessionStream(connection_, &payloadParserFactories_, &payloadSerializers_, tlsLayerFactory_, timerFactory_));
if (!certificate_.isEmpty()) {
sessionStream_->setTLSCertificate(PKCS12Certificate(certificate_, password_));
}
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h
index f09c916..444c136 100644
--- a/Swiften/Client/Client.h
+++ b/Swiften/Client/Client.h
@@ -1,5 +1,4 @@
-#ifndef SWIFTEN_Client_H
-#define SWIFTEN_Client_H
+#pragma once
#include <boost/signals.hpp>
#include <boost/shared_ptr.hpp>
@@ -21,6 +20,7 @@
namespace Swift {
class TLSLayerFactory;
class ConnectionFactory;
+ class TimerFactory;
class ClientSession;
class BasicSessionStream;
class Connector;
@@ -66,6 +66,7 @@ namespace Swift {
IDGenerator idGenerator_;
boost::shared_ptr<Connector> connector_;
ConnectionFactory* connectionFactory_;
+ TimerFactory* timerFactory_;
TLSLayerFactory* tlsLayerFactory_;
FullPayloadParserFactoryCollection payloadParserFactories_;
FullPayloadSerializerCollection payloadSerializers_;
@@ -75,5 +76,3 @@ namespace Swift {
String certificate_;
};
}
-
-#endif