summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-10-07 18:09:30 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-10-07 18:09:30 (GMT)
commit6b98253a4127c975bd59b6a49ddb203337a8c32b (patch)
tree546a24e1687f50e403215152d65e21971568f166 /Swiften/Network
parentb2f58c4f3eb93e3a32062670df5eb6682aed273a (diff)
downloadswift-contrib-6b98253a4127c975bd59b6a49ddb203337a8c32b.zip
swift-contrib-6b98253a4127c975bd59b6a49ddb203337a8c32b.tar.bz2
Hoist XML parser factory creation out of Swiften.
Diffstat (limited to 'Swiften/Network')
-rw-r--r--Swiften/Network/BoostNetworkFactories.cpp3
-rw-r--r--Swiften/Network/BoostNetworkFactories.h5
-rw-r--r--Swiften/Network/NetworkFactories.h2
3 files changed, 10 insertions, 0 deletions
diff --git a/Swiften/Network/BoostNetworkFactories.cpp b/Swiften/Network/BoostNetworkFactories.cpp
index 315290c..56be2b7 100644
--- a/Swiften/Network/BoostNetworkFactories.cpp
+++ b/Swiften/Network/BoostNetworkFactories.cpp
@@ -10,6 +10,7 @@
#include <Swiften/Network/PlatformDomainNameResolver.h>
#include <Swiften/Network/BoostConnectionServerFactory.h>
#include <Swiften/Network/PlatformNATTraversalWorker.h>
+#include <Swiften/Parser/PlatformXMLParserFactory.h>
#include <Swiften/Network/NullNATTraverser.h>
namespace Swift {
@@ -24,9 +25,11 @@ BoostNetworkFactories::BoostNetworkFactories(EventLoop* eventLoop) {
#else
natTraverser = new NullNATTraverser(eventLoop);
#endif
+ xmlParserFactory = new PlatformXMLParserFactory();
}
BoostNetworkFactories::~BoostNetworkFactories() {
+ delete xmlParserFactory;
delete natTraverser;
delete connectionServerFactory;
delete domainNameResolver;
diff --git a/Swiften/Network/BoostNetworkFactories.h b/Swiften/Network/BoostNetworkFactories.h
index bc7a963..c9ecb59 100644
--- a/Swiften/Network/BoostNetworkFactories.h
+++ b/Swiften/Network/BoostNetworkFactories.h
@@ -42,6 +42,10 @@ namespace Swift {
return natTraverser;
}
+ virtual XMLParserFactory* getXMLParserFactory() const {
+ return xmlParserFactory;
+ }
+
private:
BoostIOServiceThread ioServiceThread;
TimerFactory* timerFactory;
@@ -49,5 +53,6 @@ namespace Swift {
DomainNameResolver* domainNameResolver;
ConnectionServerFactory* connectionServerFactory;
NATTraverser* natTraverser;
+ XMLParserFactory* xmlParserFactory;
};
}
diff --git a/Swiften/Network/NetworkFactories.h b/Swiften/Network/NetworkFactories.h
index 05ddfe3..42c9f6a 100644
--- a/Swiften/Network/NetworkFactories.h
+++ b/Swiften/Network/NetworkFactories.h
@@ -12,6 +12,7 @@ namespace Swift {
class DomainNameResolver;
class ConnectionServerFactory;
class NATTraverser;
+ class XMLParserFactory;
/**
* An interface collecting network factories.
@@ -25,5 +26,6 @@ namespace Swift {
virtual DomainNameResolver* getDomainNameResolver() const = 0;
virtual ConnectionServerFactory* getConnectionServerFactory() const = 0;
virtual NATTraverser* getNATTraverser() const = 0;
+ virtual XMLParserFactory* getXMLParserFactory() const = 0;
};
}