Detail::QueueInfo Class Reference

QueueInfo object is part of Client object that represents the queue state. More...

#include <clientext.h>

Inheritance diagram for Detail::QueueInfo:

Detail::ClientExtBase List of all members.

Public Member Functions

 QueueInfo (Client *parent, SharedFile *sf, const Hash< ED2KHash > &h)
 QueueInfo (Client *parent, UploadInfoPtr nfo)
 ~QueueInfo ()
Accessors for public usage
uint32_t getQR () const
SharedFile * getReqFile () const
Hash< ED2KHash > getReqHash () const
uint64_t getWaitStartTime () const
uint64_t getLastQueueReask () const
void setQR (uint32_t r)
void setReqFile (SharedFile *sf, const Hash< ED2KHash > &h)
void resetWaitTime ()

Static Public Member Functions

static size_t count ()
 Number of QueueInfo objects alive.

Private Attributes

uint32_t m_queueRanking
 Queue ranking.
SharedFile * m_reqFile
 The requested file.
Hash< ED2KHash > m_reqHash
 Hash of the requested file; stored here to lower MetaDb lookups during reasks.
uint64_t m_waitStartTime
 Tick when the client entered queue.
uint64_t m_lastQueueReask
 Last time this client asked US about QR.

Friends

class ::Client

Detailed Description

QueueInfo object is part of Client object that represents the queue state.

This object is an extension of the Client object and contains data members related to queued client only. Each client in waiting queue must have this as member object.

Definition at line 164 of file clientext.h.


Constructor & Destructor Documentation

Detail::QueueInfo::QueueInfo Client parent,
SharedFile *  sf,
const Hash< ED2KHash > &  h
 

Definition at line 54 of file clientext.cpp.

References Detail::s_queueInfoCnt.

Detail::QueueInfo::QueueInfo Client parent,
UploadInfoPtr  nfo
 

Definition at line 60 of file clientext.cpp.

References Detail::s_queueInfoCnt.

Detail::QueueInfo::~QueueInfo  ) 
 

Definition at line 66 of file clientext.cpp.

References Detail::s_queueInfoCnt.


Member Function Documentation

uint32_t Detail::QueueInfo::getQR  )  const [inline]
 

Definition at line 176 of file clientext.h.

References m_queueRanking.

SharedFile* Detail::QueueInfo::getReqFile  )  const [inline]
 

Definition at line 177 of file clientext.h.

References m_reqFile.

Hash<ED2KHash> Detail::QueueInfo::getReqHash  )  const [inline]
 

Definition at line 178 of file clientext.h.

References m_reqHash.

uint64_t Detail::QueueInfo::getWaitStartTime  )  const [inline]
 

Definition at line 179 of file clientext.h.

References m_waitStartTime.

uint64_t Detail::QueueInfo::getLastQueueReask  )  const [inline]
 

Definition at line 180 of file clientext.h.

References m_lastQueueReask.

void Detail::QueueInfo::setQR uint32_t  r  )  [inline]
 

Definition at line 182 of file clientext.h.

References m_queueRanking.

void Detail::QueueInfo::setReqFile SharedFile *  sf,
const Hash< ED2KHash > &  h
[inline]
 

Definition at line 183 of file clientext.h.

References m_reqFile, and m_reqHash.

void Detail::QueueInfo::resetWaitTime  )  [inline]
 

Definition at line 187 of file clientext.h.

References m_waitStartTime.

size_t Detail::QueueInfo::count  )  [static]
 

Number of QueueInfo objects alive.

Definition at line 70 of file clientext.cpp.

References Detail::s_queueInfoCnt.


Friends And Related Function Documentation

friend class ::Client [friend]
 

Definition at line 193 of file clientext.h.


Member Data Documentation

uint32_t Detail::QueueInfo::m_queueRanking [private]
 

Queue ranking.

0 means we are currently uploading to the client. Nonzero means we are in waiting queue, on that specific position. This member is updated by ClientList class during queue resorting.

Definition at line 200 of file clientext.h.

Referenced by getQR(), and setQR().

SharedFile* Detail::QueueInfo::m_reqFile [private]
 

The requested file.

eMule-compatible clients may change this while waiting in the queue.

Definition at line 206 of file clientext.h.

Referenced by getReqFile(), and setReqFile().

Hash<ED2KHash> Detail::QueueInfo::m_reqHash [private]
 

Hash of the requested file; stored here to lower MetaDb lookups during reasks.

Definition at line 212 of file clientext.h.

Referenced by getReqHash(), and setReqFile().

uint64_t Detail::QueueInfo::m_waitStartTime [private]
 

Tick when the client entered queue.

This is set to current tick when the object is constructed, and is used in queue score calculations

Definition at line 218 of file clientext.h.

Referenced by getWaitStartTime(), and resetWaitTime().

uint64_t Detail::QueueInfo::m_lastQueueReask [private]
 

Last time this client asked US about QR.

If this is longer than 1 hour from current tick, the client will be dropped from queue during next queue update.

Definition at line 225 of file clientext.h.

Referenced by getLastQueueReask().


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