summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/StreamStack/WhitespacePingLayer.h')
-rw-r--r--Swiften/StreamStack/WhitespacePingLayer.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/Swiften/StreamStack/WhitespacePingLayer.h b/Swiften/StreamStack/WhitespacePingLayer.h
new file mode 100644
index 0000000..18ea39a
--- /dev/null
+++ b/Swiften/StreamStack/WhitespacePingLayer.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "Swiften/StreamStack/StreamLayer.h"
+
+namespace Swift {
+ class Timer;
+ class TimerFactory;
+
+ class WhitespacePingLayer : public StreamLayer, boost::noncopyable {
+ public:
+ WhitespacePingLayer(TimerFactory* timerFactory);
+
+ void setActive();
+ void setInactive();
+ void writeData(const ByteArray& data);
+ void handleDataRead(const ByteArray& data);
+
+ bool getIsActive() const {
+ return isActive;
+ }
+
+ private:
+ void handleTimerTick();
+
+ private:
+ bool isActive;
+ boost::shared_ptr<Timer> timer;
+ };
+}