summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2018-08-01 15:07:35 (GMT)
committerTobias Markmann <tm@ayena.de>2018-08-01 15:07:35 (GMT)
commit80f74201f0a35718642e434c58b631b238fd85df (patch)
tree0143d469fa2dc8bcae535e6cec59d5a01924bed3
parent07b3b882ade8ed454e304963e4f238e867608c46 (diff)
downloadswift-80f74201f0a35718642e434c58b631b238fd85df.zip
swift-80f74201f0a35718642e434c58b631b238fd85df.tar.bz2
Use interfaces for top and bottom layer in StreamStack
Test-Information: Builds, unit and integration tests pass on macOS with clang 7.0 master Change-Id: Idb9648c1293adbe6f4b79af3ad619ebb0630e48d
-rw-r--r--Swiften/StreamStack/StreamStack.cpp14
-rw-r--r--Swiften/StreamStack/StreamStack.h12
2 files changed, 13 insertions, 13 deletions
diff --git a/Swiften/StreamStack/StreamStack.cpp b/Swiften/StreamStack/StreamStack.cpp
index f14f95c..75fb1ce 100644
--- a/Swiften/StreamStack/StreamStack.cpp
+++ b/Swiften/StreamStack/StreamStack.cpp
@@ -10,23 +10,23 @@
#include <Swiften/StreamStack/LowLayer.h>
#include <Swiften/StreamStack/StreamLayer.h>
-#include <Swiften/StreamStack/XMPPLayer.h>
+#include <Swiften/StreamStack/HighLayer.h>
namespace Swift {
-StreamStack::StreamStack(XMPPLayer* xmppLayer, LowLayer* physicalLayer) : xmppLayer_(xmppLayer), physicalLayer_(physicalLayer) {
- physicalLayer_->setParentLayer(xmppLayer_);
- xmppLayer_->setChildLayer(physicalLayer_);
+StreamStack::StreamStack(HighLayer* topLayer, LowLayer* bottomLayer) : topLayer_(topLayer), bottomLayer_(bottomLayer) {
+ bottomLayer_->setParentLayer(topLayer_);
+ topLayer_->setChildLayer(bottomLayer_);
}
StreamStack::~StreamStack() {
}
void StreamStack::addLayer(std::unique_ptr<StreamLayer> streamLayer) {
- LowLayer* lowLayer = layers_.empty() ? physicalLayer_ : layers_.rbegin()->get();
+ LowLayer* lowLayer = layers_.empty() ? bottomLayer_ : layers_.rbegin()->get();
- xmppLayer_->setChildLayer(streamLayer.get());
- streamLayer->setParentLayer(xmppLayer_);
+ topLayer_->setChildLayer(streamLayer.get());
+ streamLayer->setParentLayer(topLayer_);
lowLayer->setParentLayer(streamLayer.get());
streamLayer->setChildLayer(lowLayer);
diff --git a/Swiften/StreamStack/StreamStack.h b/Swiften/StreamStack/StreamStack.h
index 5b77085..bd95811 100644
--- a/Swiften/StreamStack/StreamStack.h
+++ b/Swiften/StreamStack/StreamStack.h
@@ -15,19 +15,19 @@
#include <Swiften/Elements/Stanza.h>
namespace Swift {
- class XMPPLayer;
+ class HighLayer;
class LowLayer;
class StreamLayer;
class SWIFTEN_API StreamStack {
public:
- StreamStack(XMPPLayer* xmppLayer, LowLayer* physicalLayer);
+ StreamStack(HighLayer* topLayer, LowLayer* bottomLayer);
~StreamStack();
void addLayer(std::unique_ptr<StreamLayer> /* streamLayer */);
- XMPPLayer* getXMPPLayer() const {
- return xmppLayer_;
+ HighLayer* getTopLayer() const {
+ return topLayer_;
}
template<typename T> T* getLayer() const {
@@ -41,8 +41,8 @@ namespace Swift {
}
private:
- XMPPLayer* xmppLayer_;
- LowLayer* physicalLayer_;
+ HighLayer* topLayer_;
+ LowLayer* bottomLayer_;
std::vector<std::unique_ptr<StreamLayer>> layers_;
};
}