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

#include </tmp/quassel/src/common/protocols/legacy/legacypeer.h>

Inheritance diagram for LegacyPeer:
Collaboration diagram for LegacyPeer:

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 protocolVersionMismatch (int actual, int expected)
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

 LegacyPeer (AuthHandler *authHandler, QTcpSocket *socket, Compressor::CompressionLevel level, QObject *parent=0)
Protocol::Type protocol () const
QString protocolName () const
void setSignalProxy (SignalProxy *proxy)
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)
virtual QString description () const
virtual quint16 enabledFeatures () 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

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 QVariant &item)
void processMessage (const QByteArray &msg)
void handleHandshakeMessage (const QVariant &msg)
void handlePackedFunc (const QVariant &packedFunc)
void dispatchPackedFunc (const QVariantList &packedFunc)
void toLegacyIrcUsersAndChannels (QVariantMap &initData)
void fromLegacyIrcUsersAndChannels (QVariantMap &initData)

Private Attributes

bool _useCompression

Detailed Description

Definition at line 26 of file legacypeer.h.

Member Enumeration Documentation

Enumerator:
Sync 
RpcCall 
InitRequest 
InitData 
HeartBeat 
HeartBeatReply 

Definition at line 31 of file legacypeer.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file legacypeer.cpp.

Member Function Documentation

Protocol::Type protocol ( ) const
inlinevirtual

Implements Peer.

Definition at line 42 of file legacypeer.h.

References Protocol::LegacyProtocol.

QString protocolName ( ) const
inlinevirtual

Implements RemotePeer.

Definition at line 43 of file legacypeer.h.

void setSignalProxy ( SignalProxy proxy)
virtual

Reimplemented from RemotePeer.

Definition at line 42 of file legacypeer.cpp.

References _useCompression, and RemotePeer::socket().

void dispatch ( const Protocol::RegisterClient msg)
virtual
void dispatch ( const Protocol::ClientDenied msg)
virtual

Implements Peer.

Definition at line 231 of file legacypeer.cpp.

References ClientDenied::errorString, and writeMessage().

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

Implements Peer.

Definition at line 275 of file legacypeer.cpp.

References SetupFailed::errorString, and writeMessage().

void dispatch ( const Protocol::SetupDone msg)
virtual

Implements Peer.

Definition at line 285 of file legacypeer.cpp.

References writeMessage().

void dispatch ( const Protocol::Login msg)
virtual

Implements Peer.

Definition at line 296 of file legacypeer.cpp.

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

void dispatch ( const Protocol::LoginFailed msg)
virtual

Implements Peer.

Definition at line 307 of file legacypeer.cpp.

References LoginFailed::errorString, and writeMessage().

void dispatch ( const Protocol::LoginSuccess msg)
virtual

Implements Peer.

Definition at line 317 of file legacypeer.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 437 of file legacypeer.cpp.

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

void dispatch ( const Protocol::InitRequest msg)
virtual

Implements Peer.

Definition at line 443 of file legacypeer.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 462 of file legacypeer.cpp.

References dispatchPackedFunc(), and HeartBeat::timestamp.

void dispatch ( const Protocol::HeartBeatReply msg)
virtual

Implements RemotePeer.

Definition at line 468 of file legacypeer.cpp.

References dispatchPackedFunc(), and HeartBeatReply::timestamp.

void protocolError ( const QString &  errorString)
signal

Referenced by handleHandshakeMessage().

void protocolVersionMismatch ( int  actual,
int  expected 
)
signal

Referenced by handleHandshakeMessage().

void writeMessage ( const QVariant &  item)
private

Definition at line 99 of file legacypeer.cpp.

References _useCompression.

Referenced by dispatch(), and dispatchPackedFunc().

void processMessage ( const QByteArray &  msg)
private
void handleHandshakeMessage ( const QVariant &  msg)
private
void handlePackedFunc ( const QVariant &  packedFunc)
private

Definition at line 345 of file legacypeer.cpp.

References fromLegacyIrcUsersAndChannels(), RemotePeer::handle(), and Sync.

Referenced by processMessage().

void dispatchPackedFunc ( const QVariantList &  packedFunc)
private

Definition at line 474 of file legacypeer.cpp.

References writeMessage().

Referenced by dispatch().

void toLegacyIrcUsersAndChannels ( QVariantMap &  initData)
private

Definition at line 513 of file legacypeer.cpp.

Referenced by dispatch().

void fromLegacyIrcUsersAndChannels ( QVariantMap &  initData)
private

Definition at line 482 of file legacypeer.cpp.

Referenced by handlePackedFunc().

QString description ( ) const
virtualinherited
virtual quint16 enabledFeatures ( ) const
inlinevirtualinherited

Reimplemented in DataStreamPeer.

Definition at line 50 of file remotepeer.h.

Referenced by CoreAuthHandler::onReadyRead().

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

Member Data Documentation

bool _useCompression
private

Definition at line 84 of file legacypeer.h.

Referenced by processMessage(), setSignalProxy(), and writeMessage().


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