common: Make frequently called util methods more efficient
[quassel.git] / src / common / remotepeer.h
index b1c5bf4..0ce6493 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
+ *   Copyright (C) 2005-2016 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
 
 #include <QDateTime>
 
+#include "compressor.h"
 #include "peer.h"
 #include "protocol.h"
 #include "signalproxy.h"
 
-class QTcpSocket;
 class QTimer;
 
 class AuthHandler;
@@ -41,11 +41,10 @@ public:
     using Peer::handle;
     using Peer::dispatch;
 
-    RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, QObject *parent = 0);
+    RemotePeer(AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent = 0);
 
     void setSignalProxy(SignalProxy *proxy);
 
-    virtual Protocol::Type protocol() const = 0;
     virtual QString protocolName() const = 0;
     virtual QString description() const;
     virtual quint16 enabledFeatures() const { return 0; }
@@ -87,6 +86,7 @@ protected slots:
 
 private slots:
     void onReadyRead();
+    void onCompressionError(Compressor::Error error);
 
     void sendHeartBeat();
     void changeHeartBeatInterval(int secs);
@@ -96,6 +96,7 @@ private:
 
 private:
     QTcpSocket *_socket;
+    Compressor *_compressor;
     SignalProxy *_signalProxy;
     QTimer *_heartBeatTimer;
     int _heartBeatCount;