summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-14 19:33:05 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-14 19:33:05 (GMT)
commitd2625df30861a4caa984031a6990d19dfebc3367 (patch)
tree9f6b36168d2a417f0e4ef393b099428c2024223e /Swiften/StreamStack/ConnectionLayer.h
parentee3a46975986865fe5064f9d87a27277fc6c235a (diff)
downloadswift-d2625df30861a4caa984031a6990d19dfebc3367.zip
swift-d2625df30861a4caa984031a6990d19dfebc3367.tar.bz2
Make all Connection instances shared_ptrs.
Diffstat (limited to 'Swiften/StreamStack/ConnectionLayer.h')
-rw-r--r--Swiften/StreamStack/ConnectionLayer.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/Swiften/StreamStack/ConnectionLayer.h b/Swiften/StreamStack/ConnectionLayer.h
index 99873a0..7688f78 100644
--- a/Swiften/StreamStack/ConnectionLayer.h
+++ b/Swiften/StreamStack/ConnectionLayer.h
@@ -1,7 +1,7 @@
-#ifndef SWIFTEN_CONNECTIONLAYER_H
-#define SWIFTEN_CONNECTIONLAYER_H
+#pragma once
#include <boost/signal.hpp>
+#include <boost/shared_ptr.hpp>
#include "Swiften/StreamStack/LowLayer.h"
#include "Swiften/Network/Connection.h"
@@ -9,17 +9,15 @@
namespace Swift {
class ConnectionLayer : public LowLayer {
public:
- ConnectionLayer(Connection* connection) : connection_(connection) {
- connection_->onDataRead.connect(onDataRead);
+ ConnectionLayer(boost::shared_ptr<Connection> connection) : connection(connection) {
+ connection->onDataRead.connect(onDataRead);
}
void writeData(const ByteArray& data) {
- connection_->write(data);
+ connection->write(data);
}
private:
- Connection* connection_;
+ boost::shared_ptr<Connection> connection;
};
}
-
-#endif