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

#include </tmp/quassel/src/client/backlogrequester.h>

Inheritance diagram for BacklogRequester:
Collaboration diagram for BacklogRequester:

Public Types

enum  RequesterType { InvalidRequester = 0, PerBufferFixed, PerBufferUnread, GlobalUnread }

Public Member Functions

 BacklogRequester (bool buffering, RequesterType requesterType, ClientBacklogManager *backlogManger)
virtual ~BacklogRequester ()
bool isBuffering ()
RequesterType type ()
const QList< Message > & bufferedMessages ()
int buffersWaiting () const
int totalBuffers () const
bool buffer (BufferId bufferId, const MessageList &messages)
virtual void requestBacklog (const BufferIdList &bufferIds)=0
 returns false if it was the last missing backlogpart
virtual void requestInitialBacklog ()
virtual void flushBuffer ()

Protected Member Functions

BufferIdList allBufferIds () const
void setWaitingBuffers (const QList< BufferId > &buffers)
void setWaitingBuffers (const QSet< BufferId > &buffers)
void addWaitingBuffer (BufferId buffer)

Protected Attributes

ClientBacklogManagerbacklogManager

Private Attributes

bool _isBuffering
RequesterType _requesterType
MessageList _bufferedMessages
int _totalBuffers
QSet< BufferId_buffersWaiting

Detailed Description

Definition at line 33 of file backlogrequester.h.

Member Enumeration Documentation

Enumerator:
InvalidRequester 
PerBufferFixed 
PerBufferUnread 
GlobalUnread 

Definition at line 36 of file backlogrequester.h.

Constructor & Destructor Documentation

BacklogRequester ( bool  buffering,
RequesterType  requesterType,
ClientBacklogManager backlogManger 
)

Definition at line 29 of file backlogrequester.cpp.

virtual ~BacklogRequester ( )
inlinevirtual

Definition at line 44 of file backlogrequester.h.

Member Function Documentation

bool isBuffering ( )
inline
RequesterType type ( )
inline

Definition at line 47 of file backlogrequester.h.

References _requesterType.

Referenced by ClientBacklogManager::checkForBacklog().

const QList<Message>& bufferedMessages ( )
inline

Definition at line 48 of file backlogrequester.h.

References _bufferedMessages.

Referenced by ClientBacklogManager::receiveBacklog().

int buffersWaiting ( ) const
inline

Definition at line 50 of file backlogrequester.h.

References _buffersWaiting.

Referenced by ClientBacklogManager::receiveBacklog().

int totalBuffers ( ) const
inline
bool buffer ( BufferId  bufferId,
const MessageList messages 
)
virtual void requestBacklog ( const BufferIdList bufferIds)
pure virtual

returns false if it was the last missing backlogpart

Implemented in PerBufferUnreadBacklogRequester, GlobalUnreadBacklogRequester, and FixedBacklogRequester.

Referenced by ClientBacklogManager::checkForBacklog(), and requestInitialBacklog().

virtual void requestInitialBacklog ( )
inlinevirtual

Reimplemented in GlobalUnreadBacklogRequester.

Definition at line 56 of file backlogrequester.h.

References allBufferIds(), and requestBacklog().

Referenced by ClientBacklogManager::requestInitialBacklog().

void flushBuffer ( )
virtual
void setWaitingBuffers ( const QList< BufferId > &  buffers)
inlineprotected
void setWaitingBuffers ( const QSet< BufferId > &  buffers)
protected

Definition at line 39 of file backlogrequester.cpp.

References _buffersWaiting, and _totalBuffers.

void addWaitingBuffer ( BufferId  buffer)
protected

Definition at line 46 of file backlogrequester.cpp.

References _buffersWaiting, _totalBuffers, and buffer().

Member Data Documentation

bool _isBuffering
private

Definition at line 69 of file backlogrequester.h.

Referenced by isBuffering().

RequesterType _requesterType
private

Definition at line 70 of file backlogrequester.h.

Referenced by type().

MessageList _bufferedMessages
private

Definition at line 71 of file backlogrequester.h.

Referenced by buffer(), bufferedMessages(), and flushBuffer().

int _totalBuffers
private

Definition at line 72 of file backlogrequester.h.

Referenced by addWaitingBuffer(), flushBuffer(), setWaitingBuffers(), and totalBuffers().

QSet<BufferId> _buffersWaiting
private

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