Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
DataStreamPeer Class Reference

#include </tmp/quassel/src/common/protocols/datastream/datastreampeer.h>

Inheritance diagram for DataStreamPeer:
Collaboration diagram for DataStreamPeer:

Public Types

enum  RequestType {
  Sync = 1, RpcCall, InitRequest, InitData,
  HeartBeat, HeartBeatReply
}

Public Slots

void close (const QString &reason=QString())

Signals

void protocolError (const QString &errorString)
void transferProgress (int current, int max)
void socketError (QAbstractSocket::SocketError error, const QString &errorString)
void statusMessage (const QString &msg)
void disconnected ()
void secureStateChanged (bool secure=true)
void lagUpdated (int msecs)

Public Member Functions

 DataStreamPeer (AuthHandler *authHandler, QTcpSocket *socket, quint16 features, Compressor::CompressionLevel level, QObject *parent=0)
Protocol::Type protocol () const
QString protocolName () const
quint16 enabledFeatures () const
void dispatch (const Protocol::RegisterClient &msg)
void dispatch (const Protocol::ClientDenied &msg)
void dispatch (const Protocol::ClientRegistered &msg)
void dispatch (const Protocol::SetupData &msg)
void dispatch (const Protocol::SetupFailed &msg)
void dispatch (const Protocol::SetupDone &msg)
void dispatch (const Protocol::Login &msg)
void dispatch (const Protocol::LoginFailed &msg)
void dispatch (const Protocol::LoginSuccess &msg)
void dispatch (const Protocol::SessionState &msg)
void dispatch (const Protocol::SyncMessage &msg)
void dispatch (const Protocol::RpcCall &msg)
void dispatch (const Protocol::InitRequest &msg)
void dispatch (const Protocol::InitData &msg)
void dispatch (const Protocol::HeartBeat &msg)
void dispatch (const Protocol::HeartBeatReply &msg)
void setSignalProxy (SignalProxy *proxy)
virtual QString description () const
bool isOpen () const
bool isSecure () const
bool isLocal () const
int lag () const
bool compressionEnabled () const
void setCompressionEnabled (bool enabled)
QTcpSocket * socket () const
AuthHandlerauthHandler () const

Static Public Member Functions

static quint16 supportedFeatures ()
static bool acceptsFeatures (quint16 peerFeatures)

Protected Slots

virtual void onSocketStateChanged (QAbstractSocket::SocketState state)
virtual void onSocketError (QAbstractSocket::SocketError error)

Protected Member Functions

SignalProxysignalProxy () const
void writeMessage (const QByteArray &msg)
void handle (const Protocol::HeartBeat &heartBeat)
void handle (const Protocol::HeartBeatReply &heartBeatReply)
template<typename T >
void handle (const T &protoMessage)

Private Member Functions

void writeMessage (const QVariantMap &handshakeMsg)
void writeMessage (const QVariantList &sigProxyMsg)
void processMessage (const QByteArray &msg)
void handleHandshakeMessage (const QVariantList &mapData)
void handlePackedFunc (const QVariantList &packedFunc)
void dispatchPackedFunc (const QVariantList &packedFunc)

Detailed Description

Definition at line 28 of file datastreampeer.h.

Member Enumeration Documentation

Enumerator:
Sync 
RpcCall 
InitRequest 
InitData 
HeartBeat 
HeartBeatReply 

Definition at line 33 of file datastreampeer.h.

Constructor & Destructor Documentation

DataStreamPeer ( AuthHandler authHandler,
QTcpSocket *  socket,
quint16  features,
Compressor::CompressionLevel  level,
QObject *  parent = 0 
)

Definition at line 30 of file datastreampeer.cpp.

Member Function Documentation

Protocol::Type protocol ( ) const
inlinevirtual

Implements Peer.

Definition at line 44 of file datastreampeer.h.

References Protocol::DataStreamProtocol.

QString protocolName ( ) const
inlinevirtual

Implements RemotePeer.

Definition at line 45 of file datastreampeer.h.

quint16 supportedFeatures ( )
static

Definition at line 37 of file datastreampeer.cpp.

Referenced by PeerFactory::supportedProtocols().

bool acceptsFeatures ( quint16  peerFeatures)
static

Definition at line 43 of file datastreampeer.cpp.

Referenced by PeerFactory::createPeer().

quint16 enabledFeatures ( ) const
virtual

Reimplemented from RemotePeer.

Definition at line 50 of file datastreampeer.cpp.

void dispatch ( const Protocol::RegisterClient msg)
virtual

Implements Peer.

Definition at line 166 of file datastreampeer.cpp.

References RegisterClient::buildDate, RegisterClient::clientVersion, and writeMessage().

void dispatch ( const Protocol::ClientDenied msg)
virtual

Implements Peer.

Definition at line 176 of file datastreampeer.cpp.

References ClientDenied::errorString, and writeMessage().

void dispatch ( const Protocol::ClientRegistered msg)
virtual
void dispatch ( const Protocol::SetupData msg)
virtual
void dispatch ( const Protocol::SetupFailed msg)
virtual

Implements Peer.

Definition at line 212 of file datastreampeer.cpp.

References SetupFailed::errorString, and writeMessage().

void dispatch ( const Protocol::SetupDone msg)
virtual

Implements Peer.

Definition at line 222 of file datastreampeer.cpp.

References writeMessage().

void dispatch ( const Protocol::Login msg)
virtual

Implements Peer.

Definition at line 233 of file datastreampeer.cpp.

References Login::password, Login::user, and writeMessage().

void dispatch ( const Protocol::LoginFailed msg)
virtual

Implements Peer.

Definition at line 244 of file datastreampeer.cpp.

References LoginFailed::errorString, and writeMessage().

void dispatch ( const Protocol::LoginSuccess msg)
virtual

Implements Peer.

Definition at line 254 of file datastreampeer.cpp.

References writeMessage().

void dispatch ( const Protocol::SessionState msg)
virtual
void dispatch ( const Protocol::SyncMessage msg)
virtual
void dispatch ( const Protocol::RpcCall msg)
virtual

Implements Peer.

Definition at line 366 of file datastreampeer.cpp.

References dispatchPackedFunc(), RpcCall::params, and RpcCall::slotName.

void dispatch ( const Protocol::InitRequest msg)
virtual

Implements Peer.

Definition at line 372 of file datastreampeer.cpp.

References InitRequest::className, dispatchPackedFunc(), and InitRequest::objectName.

void dispatch ( const Protocol::InitData msg)
virtual
void dispatch ( const Protocol::HeartBeat msg)
virtual

Implements RemotePeer.

Definition at line 390 of file datastreampeer.cpp.

References dispatchPackedFunc(), and HeartBeat::timestamp.

void dispatch ( const Protocol::HeartBeatReply msg)
virtual

Implements RemotePeer.

Definition at line 396 of file datastreampeer.cpp.

References dispatchPackedFunc(), and HeartBeatReply::timestamp.

void protocolError ( const QString &  errorString)
signal

Referenced by handleHandshakeMessage().

void writeMessage ( const QVariantMap &  handshakeMsg)
private

Definition at line 75 of file datastreampeer.cpp.

Referenced by dispatch(), dispatchPackedFunc(), and writeMessage().

void writeMessage ( const QVariantList &  sigProxyMsg)
private

Definition at line 88 of file datastreampeer.cpp.

References writeMessage().

void processMessage ( const QByteArray &  msg)
private
void handleHandshakeMessage ( const QVariantList &  mapData)
private

Definition at line 106 of file datastreampeer.cpp.

References RemotePeer::handle(), and protocolError().

Referenced by processMessage().

void handlePackedFunc ( const QVariantList &  packedFunc)
private

Definition at line 282 of file datastreampeer.cpp.

References RemotePeer::handle(), and Sync.

Referenced by processMessage().

void dispatchPackedFunc ( const QVariantList &  packedFunc)
private

Definition at line 402 of file datastreampeer.cpp.

References writeMessage().

Referenced by dispatch().

QString description ( ) const
virtualinherited
bool isOpen ( ) const
virtualinherited

Implements Peer.

Definition at line 174 of file remotepeer.cpp.

References RemotePeer::socket().

Referenced by RemotePeer::setSignalProxy().

bool isSecure ( ) const
virtualinherited

Implements Peer.

Definition at line 149 of file remotepeer.cpp.

References RemotePeer::isLocal(), and RemotePeer::socket().

bool isLocal ( ) const
virtualinherited

Implements Peer.

Definition at line 164 of file remotepeer.cpp.

References RemotePeer::socket().

Referenced by CoreAuthHandler::handle(), and RemotePeer::isSecure().

int lag ( ) const
virtualinherited

Implements Peer.

Definition at line 137 of file remotepeer.cpp.

References RemotePeer::_lag.

bool compressionEnabled ( ) const
inherited
void setCompressionEnabled ( bool  enabled)
inherited
void transferProgress ( int  current,
int  max 
)
signalinherited

Referenced by RemotePeer::readMessage().

void socketError ( QAbstractSocket::SocketError  error,
const QString &  errorString 
)
signalinherited
void statusMessage ( const QString &  msg)
signalinherited
SignalProxy * signalProxy ( ) const
protectedvirtualinherited
void writeMessage ( const QByteArray &  msg)
protectedinherited

Definition at line 238 of file remotepeer.cpp.

References RemotePeer::_compressor, Compressor::NoFlush, and Compressor::write().

void handle ( const Protocol::HeartBeat heartBeat)
protectedinherited
void handle ( const Protocol::HeartBeatReply heartBeatReply)
protectedinherited
void handle ( const T &  protoMessage)
inlineprotectedinherited

Definition at line 97 of file peer.h.

References Protocol::AuthHandler, and Protocol::SignalProxy.

Referenced by InternalPeer::customEvent(), and InternalPeer::dispatch().

void onSocketStateChanged ( QAbstractSocket::SocketState  state)
protectedvirtualslotinherited

Definition at line 66 of file remotepeer.cpp.

References RemotePeer::statusMessage().

Referenced by RemotePeer::RemotePeer().

void onSocketError ( QAbstractSocket::SocketError  error)
protectedvirtualslotinherited

Definition at line 74 of file remotepeer.cpp.

References RemotePeer::socket(), and RemotePeer::socketError().

Referenced by RemotePeer::RemotePeer().

AuthHandler * authHandler ( ) const
inherited

Definition at line 31 of file peer.cpp.

References Peer::_authHandler.

void secureStateChanged ( bool  secure = true)
signalinherited

Referenced by RemotePeer::RemotePeer().

void lagUpdated ( int  msecs)
signalinherited

The documentation for this class was generated from the following files: