Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CUploadQueue Class Reference

#include <UploadQueue.h>

List of all members.

Public Member Functions

 CUploadQueue ()
virtual ~CUploadQueue ()
CString GetCriteriaString () const
void Serialize (CArchive &ar, int nVersion)
BOOL CanAccept (PROTOCOLID nProtocol, LPCTSTR pszName, QWORD nSize, BOOL bPartial, LPCTSTR pszShareTags=NULL) const
BOOL Enqueue (CUploadTransfer *pUpload, BOOL bForce=FALSE, BOOL bStart=FALSE)
BOOL Dequeue (CUploadTransfer *pUpload)
int GetPosition (CUploadTransfer *pUpload, BOOL bStart)
BOOL StealPosition (CUploadTransfer *pTarget, CUploadTransfer *pSource)
BOOL Start (CUploadTransfer *pUpload, BOOL bPeek=FALSE)
int GetBandwidthPoints (int nTransfers=-1) const
DWORD GetBandwidthLimit (int nTransfers=-1) const
DWORD GetAvailableBandwidth () const
DWORD GetPredictedBandwidth () const
void SpreadBandwidth ()
void RescaleBandwidth ()
int GetTransferCount (BOOL bMax=FALSE) const
int GetQueueCapacity () const
int GetQueuedCount () const
int GetQueueRemaining () const
BOOL IsActive (CUploadTransfer *pUpload) const
DWORD GetMeasuredSpeed () const

Public Attributes

int m_nIndex
CString m_sName
BOOL m_bEnable
DWORD m_nProtocols
QWORD m_nMinSize
QWORD m_nMaxSize
BOOL m_bPartial
CString m_sShareTag
CString m_sNameMatch
int m_nCapacity
int m_nMinTransfers
int m_nMaxTransfers
int m_nBandwidthPoints
BOOL m_bRotate
DWORD m_nRotateTime
DWORD m_nRotateChunk
BOOL m_bRewardUploaders
BOOL m_bExpanded
BOOL m_bSelected
DWORD m_nMeasured

Protected Member Functions

void StartImpl (CUploadTransfer *pUpload)

Protected Attributes

CPtrList m_pActive
CPtrArray m_pQueued

Friends

class CUploadsCtrl
class CUploadsWnd


Constructor & Destructor Documentation

CUploadQueue::CUploadQueue  ) 
 

Definition at line 42 of file UploadQueue.cpp.

References m_bEnable, m_bExpanded, m_bPartial, m_bRewardUploaders, m_bRotate, m_bSelected, m_nBandwidthPoints, m_nCapacity, m_nIndex, m_nMaxSize, m_nMaxTransfers, m_nMeasured, m_nMinSize, m_nMinTransfers, m_nProtocols, m_nRotateChunk, and m_nRotateTime.

CUploadQueue::~CUploadQueue  )  [virtual]
 

Definition at line 66 of file UploadQueue.cpp.

References m_pActive, CUploadTransfer::m_pQueue, m_pQueued, and NULL.


Member Function Documentation

BOOL CUploadQueue::CanAccept PROTOCOLID  nProtocol,
LPCTSTR  pszName,
QWORD  nSize,
BOOL  bPartial,
LPCTSTR  pszShareTags = NULL
const
 

Definition at line 131 of file UploadQueue.cpp.

References _tcsistr(), m_bEnable, m_bPartial, m_nMaxSize, m_nMinSize, m_nProtocols, m_sNameMatch, m_sShareTag, NULL, and CQuerySearch::WordMatch().

Referenced by CUploadQueues::CanUpload(), CUploadQueues::Enqueue(), CUploadQueues::QueueRank(), CUploadTransferHTTP::QueueRequest(), and CUploadQueues::SelectQueue().

BOOL CUploadQueue::Dequeue CUploadTransfer pUpload  ) 
 

Definition at line 203 of file UploadQueue.cpp.

References m_pActive, CUploadTransfer::m_pQueue, m_pQueued, NULL, and RescaleBandwidth().

Referenced by StartImpl().

BOOL CUploadQueue::Enqueue CUploadTransfer pUpload,
BOOL  bForce = FALSE,
BOOL  bStart = FALSE
 

Definition at line 161 of file UploadQueue.cpp.

References CSettings::Bandwidth, GetQueueCapacity(), GetQueuedCount(), GetQueueRemaining(), GetTransferCount(), m_bRewardUploaders, m_nMinTransfers, m_pQueued, NULL, CSettings::sUploads::RewardQueuePercentage, Settings, SpreadBandwidth(), StartImpl(), CSettings::sBandwidth::Uploads, CSettings::Uploads, and urSharing.

Referenced by CUploadQueues::Enqueue().

DWORD CUploadQueue::GetAvailableBandwidth  )  const
 

Definition at line 364 of file UploadQueue.cpp.

References CSettings::sUploads::FreeBandwidthFactor, CSettings::sUploads::FreeBandwidthValue, GetBandwidthLimit(), GetTransferCount(), CUploadTransfer::m_nBandwidth, m_nMinTransfers, m_pActive, Settings, and CSettings::Uploads.

Referenced by Start().

DWORD CUploadQueue::GetBandwidthLimit int  nTransfers = -1  )  const
 

Definition at line 341 of file UploadQueue.cpp.

References CSettings::Bandwidth, CSettings::sBitTorrent::BandwidthPercentage, CSettings::BitTorrent, CSettings::Connection, GetBandwidthPoints(), CUploadQueues::GetIterator(), CUploadQueues::GetNext(), CSettings::sBandwidth::HubUploads, CNeighboursBase::m_nLeafCount, CUploads::m_nTorrentSpeed, Neighbours, CSettings::sConnection::OutSpeed, Settings, CSettings::sUploads::ThrottleMode, UploadQueues, CSettings::Uploads, Uploads, and CSettings::sBandwidth::Uploads.

Referenced by GetAvailableBandwidth(), CUploadQueues::GetCurrentDonkeyBandwidth(), GetPredictedBandwidth(), RescaleBandwidth(), and SpreadBandwidth().

int CUploadQueue::GetBandwidthPoints int  nTransfers = -1  )  const
 

Definition at line 331 of file UploadQueue.cpp.

References GetTransferCount(), m_nBandwidthPoints, and m_nMinTransfers.

Referenced by GetBandwidthLimit().

CString CUploadQueue::GetCriteriaString  )  const
 

Definition at line 84 of file UploadQueue.cpp.

References IDS_UPLOAD_QUEUE_PARTIAL, LoadString(), m_bPartial, m_nMaxSize, m_nMinSize, m_nProtocols, PROTOCOL_ED2K, PROTOCOL_HTTP, Settings, and CSettings::SmartVolume().

Referenced by CUploadsSettingsPage::UpdateQueues().

DWORD CUploadQueue::GetMeasuredSpeed  )  const [inline]
 

Definition at line 116 of file UploadQueue.h.

References m_nMeasured.

Referenced by CUploadsCtrl::PaintQueue().

int CUploadQueue::GetPosition CUploadTransfer pUpload,
BOOL  bStart
 

Definition at line 232 of file UploadQueue.cpp.

References m_pActive, m_pQueued, NULL, and Start().

DWORD CUploadQueue::GetPredictedBandwidth  )  const
 

Definition at line 393 of file UploadQueue.cpp.

References GetBandwidthLimit(), GetTransferCount(), and m_nMinTransfers.

Referenced by CLocalSearch::CreatePacketG2().

int CUploadQueue::GetQueueCapacity  )  const [inline]
 

Definition at line 95 of file UploadQueue.h.

References m_nCapacity.

Referenced by Enqueue(), and GetQueueRemaining().

int CUploadQueue::GetQueuedCount  )  const [inline]
 

Definition at line 100 of file UploadQueue.h.

References m_pQueued.

Referenced by CUploadTransferED2K::CheckRanking(), CLocalSearch::CreatePacketG2(), Enqueue(), GetQueueRemaining(), CUploadTipCtrl::OnPaint(), CUploadsCtrl::PaintQueue(), CUploadQueues::QueueRank(), and CUploadTransferHTTP::QueueRequest().

int CUploadQueue::GetQueueRemaining  )  const [inline]
 

Definition at line 105 of file UploadQueue.h.

References GetQueueCapacity(), and GetQueuedCount().

Referenced by CUploadQueues::CanUpload(), Enqueue(), and CUploadQueues::QueueRank().

int CUploadQueue::GetTransferCount BOOL  bMax = FALSE  )  const [inline]
 

Definition at line 88 of file UploadQueue.h.

References m_nMinTransfers, and m_pActive.

Referenced by CLocalSearch::CreatePacketG2(), Enqueue(), GetAvailableBandwidth(), GetBandwidthPoints(), GetPredictedBandwidth(), CUploadsCtrl::PaintQueue(), CUploadTransferHTTP::QueueRequest(), RescaleBandwidth(), SpreadBandwidth(), and Start().

BOOL CUploadQueue::IsActive CUploadTransfer pUpload  )  const [inline]
 

Definition at line 110 of file UploadQueue.h.

References m_pActive, and NULL.

Referenced by CUploadTransfer::RotatingQueue().

void CUploadQueue::RescaleBandwidth  ) 
 

Definition at line 415 of file UploadQueue.cpp.

References GetBandwidthLimit(), GetTransferCount(), CUploadTransfer::m_nBandwidth, m_nMinTransfers, m_pActive, CUploadTransfer::SetSpeedLimit(), and SpreadBandwidth().

Referenced by Dequeue().

void CUploadQueue::Serialize CArchive &  ar,
int  nVersion
 

Definition at line 446 of file UploadQueue.cpp.

References m_bEnable, m_bExpanded, m_bPartial, m_bRewardUploaders, m_bRotate, m_nBandwidthPoints, m_nCapacity, m_nMaxSize, m_nMaxTransfers, m_nMinSize, m_nMinTransfers, m_nProtocols, m_nRotateChunk, m_nRotateTime, m_sName, m_sNameMatch, and m_sShareTag.

void CUploadQueue::SpreadBandwidth  ) 
 

Definition at line 402 of file UploadQueue.cpp.

References GetBandwidthLimit(), GetTransferCount(), m_nMinTransfers, m_pActive, and CUploadTransfer::SetSpeedLimit().

Referenced by Enqueue(), RescaleBandwidth(), and Start().

BOOL CUploadQueue::Start CUploadTransfer pUpload,
BOOL  bPeek = FALSE
 

Definition at line 287 of file UploadQueue.cpp.

References GetAvailableBandwidth(), GetTransferCount(), m_nMaxTransfers, m_nMinTransfers, m_pActive, CShareazaApp::Message(), MSG_DEBUG, NULL, Settings, CSettings::SmartVolume(), SpreadBandwidth(), StartImpl(), and theApp.

Referenced by GetPosition().

void CUploadQueue::StartImpl CUploadTransfer pUpload  )  [protected]
 

Definition at line 319 of file UploadQueue.cpp.

References Dequeue(), m_pActive, and NULL.

Referenced by Enqueue(), and Start().

BOOL CUploadQueue::StealPosition CUploadTransfer pTarget,
CUploadTransfer pSource
 

Definition at line 254 of file UploadQueue.cpp.

References CUploadTransfer::m_nBandwidth, m_pActive, CUploadTransfer::m_pQueue, m_pQueued, and NULL.

Referenced by CUploadQueues::StealPosition().


Friends And Related Function Documentation

friend class CUploadsCtrl [friend]
 

Definition at line 121 of file UploadQueue.h.

friend class CUploadsWnd [friend]
 

Definition at line 122 of file UploadQueue.h.


Member Data Documentation

BOOL CUploadQueue::m_bEnable
 

Definition at line 44 of file UploadQueue.h.

Referenced by CanAccept(), CUploadQueues::Create(), CUploadQueue(), CUploadQueues::GetTotalBandwidthPoints(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), Serialize(), and CUploadsSettingsPage::UpdateQueues().

BOOL CUploadQueue::m_bExpanded
 

Definition at line 61 of file UploadQueue.h.

Referenced by CUploadQueue(), CUploadQueues::CUploadQueues(), CUploadsCtrl::GetAt(), CUploadsCtrl::HitTest(), CUploadsCtrl::OnKeyDown(), CUploadsCtrl::OnLButtonDblClk(), CUploadsCtrl::OnLButtonDown(), CUploadsCtrl::OnPaint(), CUploadsCtrl::OnSize(), CRemote::PageUploads(), CUploadsCtrl::PaintQueue(), and Serialize().

BOOL CUploadQueue::m_bPartial
 

Definition at line 48 of file UploadQueue.h.

Referenced by CanAccept(), CUploadQueues::CreateDefault(), CUploadQueue(), GetCriteriaString(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), Serialize(), and CUploadQueues::Validate().

BOOL CUploadQueue::m_bRewardUploaders
 

Definition at line 59 of file UploadQueue.h.

Referenced by CUploadQueues::CreateDefault(), CUploadQueue(), Enqueue(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploadTransfer::RotatingQueue(), Serialize(), and CUploadQueues::Validate().

BOOL CUploadQueue::m_bRotate
 

Definition at line 56 of file UploadQueue.h.

Referenced by CUploadQueues::CreateDefault(), CUploadQueue(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploadTransferHTTP::OpenFileSendHeaders(), CUploadTransfer::RotatingQueue(), Serialize(), and CUploadQueues::Validate().

BOOL CUploadQueue::m_bSelected
 

Definition at line 62 of file UploadQueue.h.

Referenced by CUploadQueue(), CUploadsCtrl::DeselectAll(), CUploadsWnd::OnEditQueue(), CUploadsCtrl::OnSize(), CUploadsCtrl::PaintQueue(), and CUploadsCtrl::SelectTo().

int CUploadQueue::m_nBandwidthPoints
 

Definition at line 55 of file UploadQueue.h.

Referenced by CUploadQueues::CreateDefault(), CUploadQueue(), GetBandwidthPoints(), CUploadQueues::GetMinimumDonkeyBandwidth(), CUploadQueues::GetTotalBandwidthPoints(), CQueuePropertiesDlg::OnHScroll(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), Serialize(), CUploadsSettingsPage::UpdateQueues(), and CUploadQueues::Validate().

int CUploadQueue::m_nCapacity
 

Definition at line 52 of file UploadQueue.h.

Referenced by CUploadQueues::CreateDefault(), CUploadQueue(), GetQueueCapacity(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), Serialize(), and CUploadQueues::Validate().

int CUploadQueue::m_nIndex
 

Definition at line 42 of file UploadQueue.h.

Referenced by CLocalSearch::AddHitG2(), CUploadQueue(), and CUploadQueues::SelectQueue().

QWORD CUploadQueue::m_nMaxSize
 

Definition at line 47 of file UploadQueue.h.

Referenced by CanAccept(), CUploadQueues::CreateDefault(), CUploadQueue(), GetCriteriaString(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), and Serialize().

int CUploadQueue::m_nMaxTransfers
 

Definition at line 54 of file UploadQueue.h.

Referenced by CUploadQueues::CreateDefault(), CUploadQueue(), CUploadQueues::GetCurrentDonkeyBandwidth(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploads::OnRun(), CUploadsCtrl::PaintQueue(), Serialize(), Start(), CUploadsSettingsPage::UpdateQueues(), and CUploadQueues::Validate().

DWORD CUploadQueue::m_nMeasured
 

Definition at line 63 of file UploadQueue.h.

Referenced by CUploadQueue(), GetMeasuredSpeed(), and CUploads::OnRun().

QWORD CUploadQueue::m_nMinSize
 

Definition at line 46 of file UploadQueue.h.

Referenced by CanAccept(), CUploadQueues::CreateDefault(), CUploadQueue(), GetCriteriaString(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), and Serialize().

int CUploadQueue::m_nMinTransfers
 

Definition at line 53 of file UploadQueue.h.

Referenced by CUploadQueues::CreateDefault(), CUploadQueue(), Enqueue(), GetAvailableBandwidth(), GetBandwidthPoints(), GetPredictedBandwidth(), GetTransferCount(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploads::OnRun(), CUploadsCtrl::PaintQueue(), RescaleBandwidth(), Serialize(), SpreadBandwidth(), Start(), CUploadsSettingsPage::UpdateQueues(), and CUploadQueues::Validate().

DWORD CUploadQueue::m_nProtocols
 

Definition at line 45 of file UploadQueue.h.

Referenced by CanAccept(), CUploadQueues::CreateDefault(), CUploadQueue(), GetCriteriaString(), CUploadQueues::GetCurrentDonkeyBandwidth(), CUploadQueues::GetMinimumDonkeyBandwidth(), CUploadQueues::GetTotalBandwidthPoints(), CQueuePropertiesDlg::OnHScroll(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploadsCtrl::PaintQueue(), Serialize(), CUploadsSettingsPage::UpdateQueues(), and CUploadQueues::Validate().

DWORD CUploadQueue::m_nRotateChunk
 

Definition at line 58 of file UploadQueue.h.

Referenced by CUploadQueue(), CUploadTransferHTTP::OpenFileSendHeaders(), and Serialize().

DWORD CUploadQueue::m_nRotateTime
 

Definition at line 57 of file UploadQueue.h.

Referenced by CUploadQueues::CreateDefault(), CUploadQueue(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploadTransfer::RotatingQueue(), Serialize(), and CUploadQueues::Validate().

CPtrList CUploadQueue::m_pActive [protected]
 

Definition at line 39 of file UploadQueue.h.

Referenced by Dequeue(), GetAvailableBandwidth(), GetPosition(), GetTransferCount(), IsActive(), CUploadsCtrl::OnLButtonDblClk(), CUploadsCtrl::OnLButtonDown(), RescaleBandwidth(), SpreadBandwidth(), Start(), StartImpl(), StealPosition(), and ~CUploadQueue().

CPtrArray CUploadQueue::m_pQueued [protected]
 

Definition at line 40 of file UploadQueue.h.

Referenced by Dequeue(), Enqueue(), GetPosition(), GetQueuedCount(), CUploadsCtrl::OnLButtonDblClk(), CUploadsCtrl::OnLButtonDown(), StealPosition(), and ~CUploadQueue().

CString CUploadQueue::m_sName
 

Definition at line 43 of file UploadQueue.h.

Referenced by CUploadTransferED2K::CheckRanking(), CUploadQueues::Create(), CUploadQueues::Load(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploadTipCtrl::OnPaint(), CUploadsCtrl::PaintQueue(), CUploadTransferHTTP::QueueRequest(), Serialize(), and CUploadsSettingsPage::UpdateQueues().

CString CUploadQueue::m_sNameMatch
 

Definition at line 50 of file UploadQueue.h.

Referenced by CanAccept(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), and Serialize().

CString CUploadQueue::m_sShareTag
 

Definition at line 49 of file UploadQueue.h.

Referenced by CanAccept(), CFileSharingPage::OnInitDialog(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), and Serialize().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:13 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2