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

CUploadQueues Class Reference

#include <UploadQueues.h>

List of all members.

Public Member Functions

 CUploadQueues ()
virtual ~CUploadQueues ()
BOOL Enqueue (CUploadTransfer *pUpload, BOOL bForce=FALSE)
BOOL Dequeue (CUploadTransfer *pUpload)
int GetPosition (CUploadTransfer *pUpload, BOOL bStart)
BOOL StealPosition (CUploadTransfer *pTarget, CUploadTransfer *pSource)
CUploadQueueCreate (LPCTSTR pszName=NULL, BOOL bTop=FALSE)
void Delete (CUploadQueue *pQueue)
BOOL Reorder (CUploadQueue *pQueue, CUploadQueue *pBefore)
CUploadQueueSelectQueue (PROTOCOLID nProtocol, CLibraryFile *pFile)
CUploadQueueSelectQueue (PROTOCOLID nProtocol, CDownload *pFile)
CUploadQueueSelectQueue (PROTOCOLID nProtocol, LPCTSTR pszName, QWORD nSize, BOOL bPartial, LPCTSTR pszShareTags=NULL)
int GetTotalBandwidthPoints (BOOL ActiveOnly=FALSE)
int GetQueueCapacity ()
int GetQueuedCount ()
int GetQueueRemaining ()
int GetTransferCount ()
BOOL IsTransferAvailable ()
DWORD GetMinimumDonkeyBandwidth ()
DWORD GetCurrentDonkeyBandwidth ()
BOOL CanUpload (PROTOCOLID nProtocol, CLibraryFile *pFile, BOOL bCanQueue=FALSE)
int QueueRank (PROTOCOLID nProtocol, CLibraryFile *pFile)
void Clear ()
BOOL Load ()
BOOL Save ()
void CreateDefault ()
void Validate ()
POSITION GetIterator () const
CUploadQueueGetNext (POSITION &pos) const
int GetCount () const
BOOL Check (CUploadQueue *pQueue) const
BOOL IsDonkeyRatioActive () const

Public Attributes

CCriticalSection m_pSection
CUploadQueuem_pTorrentQueue
CUploadQueuem_pHistoryQueue

Protected Member Functions

void Serialize (CArchive &ar)

Protected Attributes

CPtrList m_pList
BOOL m_bDonkeyLimited


Constructor & Destructor Documentation

CUploadQueues::CUploadQueues  ) 
 

Definition at line 44 of file UploadQueues.cpp.

References m_bDonkeyLimited, CUploadQueue::m_bExpanded, m_pHistoryQueue, and m_pTorrentQueue.

CUploadQueues::~CUploadQueues  )  [virtual]
 

Definition at line 52 of file UploadQueues.cpp.

References Clear(), m_pHistoryQueue, and m_pTorrentQueue.


Member Function Documentation

BOOL CUploadQueues::CanUpload PROTOCOLID  nProtocol,
CLibraryFile pFile,
BOOL  bCanQueue = FALSE
 

Definition at line 365 of file UploadQueues.cpp.

References CUploadQueue::CanAccept(), GetIterator(), GetNext(), CUploadQueue::GetQueueRemaining(), CLibraryFile::IsGhost(), CLibraryFile::m_nSize, m_pSection, CLibraryFile::m_sName, CLibraryFile::m_sShareTags, PROTOCOL_G1, PROTOCOL_G2, and PROTOCOL_HTTP.

Referenced by CLibraryDictionary::BuildHashTable(), CEDClient::OnFileRequest(), CUploadTransferHTTP::OnHeadersComplete(), CUploadTransferHTTP::RequestSharedFile(), and CEDNeighbour::SendSharedFiles().

BOOL CUploadQueues::Check CUploadQueue pQueue  )  const [inline]
 

Definition at line 99 of file UploadQueues.h.

References m_pList, and NULL.

Referenced by CUploadTransferED2K::CheckRanking(), Delete(), Dequeue(), GetPosition(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploadsSettingsPage::OnQueueDrop(), CUploads::OnRun(), CUploadTransferHTTP::OpenFileSendHeaders(), CUploadTransferHTTP::QueueRequest(), CUploadTransfer::RotatingQueue(), and StealPosition().

void CUploadQueues::Clear  ) 
 

Definition at line 433 of file UploadQueues.cpp.

References GetIterator(), GetNext(), m_pList, and m_pSection.

Referenced by CreateDefault(), Serialize(), and ~CUploadQueues().

CUploadQueue * CUploadQueues::Create LPCTSTR  pszName = NULL,
BOOL  bTop = FALSE
 

Definition at line 148 of file UploadQueues.cpp.

References CUploadQueue::m_bEnable, m_pList, m_pSection, CUploadQueue::m_sName, and NULL.

Referenced by CreateDefault(), CUploadsSettingsPage::OnQueueNew(), Serialize(), and Validate().

void CUploadQueues::CreateDefault  ) 
 

Definition at line 536 of file UploadQueues.cpp.

References Clear(), CSettings::Connection, Create(), IDS_UPLOAD_QUEUE_COMPLETE, IDS_UPLOAD_QUEUE_ED2K_CORE, IDS_UPLOAD_QUEUE_ED2K_PARTIALS, IDS_UPLOAD_QUEUE_LARGE_FILES, IDS_UPLOAD_QUEUE_MEDIUM_FILES, IDS_UPLOAD_QUEUE_PARTIAL_FILES, IDS_UPLOAD_QUEUE_QUEUE, IDS_UPLOAD_QUEUE_SMALL_FILES, LoadString(), CUploadQueue::m_bPartial, CUploadQueue::m_bRewardUploaders, CUploadQueue::m_bRotate, CUploadQueue::m_nBandwidthPoints, CUploadQueue::m_nCapacity, CUploadQueue::m_nMaxSize, CUploadQueue::m_nMaxTransfers, CUploadQueue::m_nMinSize, CUploadQueue::m_nMinTransfers, CUploadQueue::m_nProtocols, CUploadQueue::m_nRotateTime, m_pSection, NULL, CSettings::sConnection::OutSpeed, PROTOCOL_ED2K, PROTOCOL_HTTP, Save(), and Settings.

Referenced by Load(), CUploadsSettingsPage::OnOK(), and CWizardConnectionPage::OnWizardNext().

void CUploadQueues::Delete CUploadQueue pQueue  ) 
 

Definition at line 164 of file UploadQueues.cpp.

References Check(), m_pList, and m_pSection.

Referenced by CUploadsSettingsPage::OnQueueDelete(), and CUploadsSettingsPage::OnQueueNew().

BOOL CUploadQueues::Dequeue CUploadTransfer pUpload  ) 
 

Definition at line 91 of file UploadQueues.cpp.

References Check(), m_pSection, and NULL.

Referenced by CUploadTransferED2K::Cleanup(), CUploadTransfer::Close(), Enqueue(), CUploadTransfer::Promote(), CUploadTransferHTTP::QueueRequest(), CUploadTransferHTTP::ReadRequest(), CUploadTransferED2K::Request(), and StealPosition().

BOOL CUploadQueues::Enqueue CUploadTransfer pUpload,
BOOL  bForce = FALSE
 

Definition at line 62 of file UploadQueues.cpp.

References CUploadQueue::CanAccept(), Dequeue(), CUploadQueue::Enqueue(), GetIterator(), GetNext(), CUploadTransfer::m_bFilePartial, CUploadTransfer::m_nFileSize, CUploadTransfer::m_nProtocol, CUploadTransfer::m_pQueue, m_pSection, CUploadTransfer::m_sFileName, CUploadTransfer::m_sFileTags, and NULL.

Referenced by CUploadTransfer::Promote(), CUploadTransferHTTP::QueueRequest(), and CUploadTransferED2K::Request().

int CUploadQueues::GetCount  )  const [inline]
 

Definition at line 94 of file UploadQueues.h.

References m_pList.

Referenced by Load(), CUploadsSettingsPage::OnOK(), and Serialize().

DWORD CUploadQueues::GetCurrentDonkeyBandwidth  ) 
 

Definition at line 349 of file UploadQueues.cpp.

References CUploadQueue::GetBandwidthLimit(), GetIterator(), GetNext(), CUploadQueue::m_nMaxTransfers, CUploadQueue::m_nProtocols, m_pSection, and PROTOCOL_ED2K.

Referenced by CDownloads::OnRun().

POSITION CUploadQueues::GetIterator  )  const [inline]
 

Definition at line 84 of file UploadQueues.h.

References m_pList.

Referenced by CanUpload(), Clear(), CLocalSearch::CreatePacketG2(), CUploadsCtrl::DeselectAll(), Enqueue(), CUploadQueue::GetBandwidthLimit(), GetCurrentDonkeyBandwidth(), GetMinimumDonkeyBandwidth(), CUploadsCtrl::GetNextQueue(), GetQueueCapacity(), GetQueuedCount(), CUploadsCtrl::GetQueueIterator(), GetQueueRemaining(), GetTotalBandwidthPoints(), GetTransferCount(), IsTransferAvailable(), CUploadsWnd::OnEditQueue(), CFileSharingPage::OnInitDialog(), CUploads::OnRun(), QueueRank(), SelectQueue(), Serialize(), and CUploadsSettingsPage::UpdateQueues().

DWORD CUploadQueues::GetMinimumDonkeyBandwidth  ) 
 

Definition at line 318 of file UploadQueues.cpp.

References CSettings::Bandwidth, CSettings::Connection, GetIterator(), GetNext(), CUploadQueue::m_nBandwidthPoints, CUploadQueue::m_nProtocols, m_pSection, CSettings::sConnection::OutSpeed, PROTOCOL_ED2K, Settings, and CSettings::sBandwidth::Uploads.

Referenced by CDownloads::OnRun(), and Validate().

CUploadQueue* CUploadQueues::GetNext POSITION &  pos  )  const [inline]
 

Definition at line 89 of file UploadQueues.h.

References m_pList.

Referenced by CanUpload(), Clear(), CLocalSearch::CreatePacketG2(), CUploadsCtrl::DeselectAll(), Enqueue(), CUploadQueue::GetBandwidthLimit(), GetCurrentDonkeyBandwidth(), GetMinimumDonkeyBandwidth(), CUploadsCtrl::GetNextQueue(), GetQueueCapacity(), GetQueuedCount(), GetQueueRemaining(), GetTotalBandwidthPoints(), GetTransferCount(), IsTransferAvailable(), CUploadsWnd::OnEditQueue(), CFileSharingPage::OnInitDialog(), CUploads::OnRun(), QueueRank(), SelectQueue(), Serialize(), and CUploadsSettingsPage::UpdateQueues().

int CUploadQueues::GetPosition CUploadTransfer pUpload,
BOOL  bStart
 

Definition at line 111 of file UploadQueues.cpp.

References Check(), m_pSection, and NULL.

Referenced by CUploadTransferED2K::CheckRanking(), CUploadTipCtrl::OnPaint(), CUploadTransferED2K::OnQueueKick(), CUploadTransferED2K::OnReask(), CUploadTransferHTTP::QueueRequest(), CUploadTransferED2K::Request(), and CUploadTransferED2K::ServeRequests().

int CUploadQueues::GetQueueCapacity  ) 
 

Definition at line 254 of file UploadQueues.cpp.

References GetIterator(), GetNext(), and m_pSection.

int CUploadQueues::GetQueuedCount  ) 
 

Definition at line 267 of file UploadQueues.cpp.

References GetIterator(), GetNext(), and m_pSection.

int CUploadQueues::GetQueueRemaining  ) 
 

Definition at line 280 of file UploadQueues.cpp.

References GetIterator(), GetNext(), and m_pSection.

Referenced by CLocalSearch::Execute().

int CUploadQueues::GetTotalBandwidthPoints BOOL  ActiveOnly = FALSE  ) 
 

Definition at line 226 of file UploadQueues.cpp.

References CSettings::Connection, CSettings::eDonkey, CSettings::seDonkey::EnableAlways, CSettings::seDonkey::EnableToday, GetIterator(), GetNext(), CUploadQueue::m_bEnable, CUploadQueue::m_nBandwidthPoints, CUploadQueue::m_nProtocols, m_pSection, PROTOCOL_ED2K, CSettings::sConnection::RequireForTransfers, and Settings.

Referenced by CQueuePropertiesDlg::OnHScroll(), CQueuePropertiesDlg::OnInitDialog(), and CUploadsSettingsPage::UpdateQueues().

int CUploadQueues::GetTransferCount  ) 
 

Definition at line 293 of file UploadQueues.cpp.

References GetIterator(), GetNext(), and m_pSection.

BOOL CUploadQueues::IsDonkeyRatioActive  )  const [inline]
 

Definition at line 105 of file UploadQueues.h.

References m_bDonkeyLimited.

Referenced by CDownloads::OnRun().

BOOL CUploadQueues::IsTransferAvailable  ) 
 

Definition at line 306 of file UploadQueues.cpp.

References GetIterator(), GetNext(), and m_pSection.

Referenced by CLocalSearch::WriteTrailerG1().

BOOL CUploadQueues::Load  ) 
 

Definition at line 448 of file UploadQueues.cpp.

References CreateDefault(), CSettings::General, GetCount(), IDS_UPLOAD_QUEUE_HISTORY, IDS_UPLOAD_QUEUE_TORRENT, LoadString(), m_pHistoryQueue, m_pSection, m_pTorrentQueue, CUploadQueue::m_sName, Serialize(), Settings, CSettings::sGeneral::UserPath, and Validate().

Referenced by CShareazaApp::InitInstance().

int CUploadQueues::QueueRank PROTOCOLID  nProtocol,
CLibraryFile pFile
 

Definition at line 397 of file UploadQueues.cpp.

References CUploadQueue::CanAccept(), GetIterator(), GetNext(), CUploadQueue::GetQueuedCount(), CUploadQueue::GetQueueRemaining(), CLibraryFile::IsGhost(), CLibraryFile::m_nSize, m_pSection, CLibraryFile::m_sName, CLibraryFile::m_sShareTags, PROTOCOL_G1, PROTOCOL_G2, and PROTOCOL_HTTP.

Referenced by CLocalSearch::AddHitG1().

BOOL CUploadQueues::Reorder CUploadQueue pQueue,
CUploadQueue pBefore
 

Definition at line 172 of file UploadQueues.cpp.

References m_pList, m_pSection, and NULL.

Referenced by CUploadsSettingsPage::OnQueueDrop().

BOOL CUploadQueues::Save  ) 
 

Definition at line 485 of file UploadQueues.cpp.

References CSettings::General, m_pSection, Serialize(), Settings, and CSettings::sGeneral::UserPath.

Referenced by CreateDefault(), CShareazaApp::ExitInstance(), CUploadsSettingsPage::OnQueueDelete(), CUploadsSettingsPage::OnQueueDrop(), CUploadsSettingsPage::OnQueueEdit(), and CUploadsSettingsPage::OnQueueNew().

CUploadQueue * CUploadQueues::SelectQueue PROTOCOLID  nProtocol,
LPCTSTR  pszName,
QWORD  nSize,
BOOL  bPartial,
LPCTSTR  pszShareTags = NULL
 

Definition at line 208 of file UploadQueues.cpp.

References CUploadQueue::CanAccept(), GetIterator(), GetNext(), CUploadQueue::m_nIndex, m_pSection, and NULL.

CUploadQueue * CUploadQueues::SelectQueue PROTOCOLID  nProtocol,
CDownload pFile
 

Definition at line 203 of file UploadQueues.cpp.

References CDownloadBase::m_nSize, CDownloadBase::m_sRemoteName, and SelectQueue().

CUploadQueue * CUploadQueues::SelectQueue PROTOCOLID  nProtocol,
CLibraryFile pFile
 

Definition at line 198 of file UploadQueues.cpp.

References CLibraryFile::GetSize(), CLibraryFile::m_sName, and CLibraryFile::m_sShareTags.

Referenced by CLocalSearch::AddHitG2(), SelectQueue(), and Validate().

void CUploadQueues::Serialize CArchive &  ar  )  [protected]
 

Definition at line 504 of file UploadQueues.cpp.

References Clear(), Create(), GetCount(), GetIterator(), and GetNext().

Referenced by Load(), and Save().

BOOL CUploadQueues::StealPosition CUploadTransfer pTarget,
CUploadTransfer pSource
 

Definition at line 131 of file UploadQueues.cpp.

References Check(), Dequeue(), CUploadTransfer::m_pQueue, m_pSection, NULL, and CUploadQueue::StealPosition().

Referenced by CUploads::EnforcePerHostLimit().

void CUploadQueues::Validate  ) 
 

Definition at line 856 of file UploadQueues.cpp.

References CSettings::Connection, Create(), CSettings::eDonkey, CSettings::seDonkey::EnableAlways, CSettings::seDonkey::EnableToday, GetMinimumDonkeyBandwidth(), IDS_UPLOAD_QUEUE_ED2K_GUARD, IDS_UPLOAD_QUEUE_HTTP_GUARD, LoadString(), m_bDonkeyLimited, CUploadQueue::m_bPartial, CUploadQueue::m_bRewardUploaders, CUploadQueue::m_bRotate, CUploadQueue::m_nBandwidthPoints, CUploadQueue::m_nCapacity, CUploadQueue::m_nMaxTransfers, CUploadQueue::m_nMinTransfers, CUploadQueue::m_nProtocols, CUploadQueue::m_nRotateTime, CShareazaApp::Message(), MSG_DEBUG, MSG_SYSTEM, NULL, CSettings::sConnection::OutSpeed, PROTOCOL_ED2K, PROTOCOL_HTTP, SelectQueue(), Settings, and theApp.

Referenced by Load(), and CUploadsSettingsPage::OnOK().


Member Data Documentation

BOOL CUploadQueues::m_bDonkeyLimited [protected]
 

Definition at line 46 of file UploadQueues.h.

Referenced by CUploadQueues(), IsDonkeyRatioActive(), and Validate().

CUploadQueue* CUploadQueues::m_pHistoryQueue
 

Definition at line 42 of file UploadQueues.h.

Referenced by CUploadQueues(), CUploadsCtrl::DeselectAll(), CUploadsCtrl::GetFileIterator(), CUploadsCtrl::GetNextFile(), CUploadsCtrl::GetNextQueue(), CUploadsCtrl::GetQueueIterator(), Load(), CUploadsWnd::OnContextMenu(), CRemote::PageUploads(), CUploadsCtrl::PaintQueue(), and ~CUploadQueues().

CPtrList CUploadQueues::m_pList [protected]
 

Definition at line 44 of file UploadQueues.h.

Referenced by Check(), Clear(), Create(), Delete(), GetCount(), GetIterator(), GetNext(), and Reorder().

CCriticalSection CUploadQueues::m_pSection
 

Definition at line 40 of file UploadQueues.h.

Referenced by CLocalSearch::AddHitG2(), CanUpload(), CUploadTransferED2K::CheckRanking(), Clear(), Create(), CreateDefault(), CLocalSearch::CreatePacketG2(), Delete(), Dequeue(), Enqueue(), GetCurrentDonkeyBandwidth(), GetMinimumDonkeyBandwidth(), GetPosition(), GetQueueCapacity(), GetQueuedCount(), GetQueueRemaining(), GetTotalBandwidthPoints(), GetTransferCount(), IsTransferAvailable(), Load(), CFileSharingPage::OnInitDialog(), CQueuePropertiesDlg::OnInitDialog(), CQueuePropertiesDlg::OnOK(), CUploads::OnRun(), CUploadTransferHTTP::OpenFileSendHeaders(), QueueRank(), CUploadTransferHTTP::QueueRequest(), Reorder(), CUploadTransfer::RotatingQueue(), Save(), SelectQueue(), StealPosition(), and CUploadsSettingsPage::UpdateQueues().

CUploadQueue* CUploadQueues::m_pTorrentQueue
 

Definition at line 41 of file UploadQueues.h.

Referenced by CUploadQueues(), CUploadsCtrl::DeselectAll(), CUploadsCtrl::GetFileIterator(), CUploadsCtrl::GetNextFile(), CUploadsCtrl::GetNextQueue(), CUploadsCtrl::GetQueueIterator(), Load(), CUploadsWnd::OnContextMenu(), CUploads::OnRun(), CRemote::PageUploads(), CUploadsCtrl::PaintQueue(), and ~CUploadQueues().


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