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

CDownloadWithTransfers Class Reference

#include <DownloadWithTransfers.h>

Inheritance diagram for CDownloadWithTransfers:

CDownloadWithSources CDownloadBase CDownloadWithFile CDownloadWithTorrent CDownloadWithTiger CDownloadWithSearch CDownloadWithExtras CDownload List of all members.

Public Member Functions

 CDownloadWithTransfers ()
virtual ~CDownloadWithTransfers ()
int GetTransferCount () const
int GetTransferCount (int nState, IN_ADDR *pAddress=NULL) const
QWORD GetAmountDownloadedFrom (IN_ADDR *pAddress) const
BOOL CanStartTransfers (DWORD tNow=0)
BOOL StartTransfersIfNeeded (DWORD tNow=0)
BOOL StartNewTransfer (DWORD tNow=0)
void CloseTransfers ()
DWORD GetAverageSpeed () const
DWORD GetMeasuredSpeed () const
BOOL OnAcceptPush (GGUID *pClientID, CConnection *pConnection)
BOOL OnDonkeyCallback (CEDClient *pClient, CDownloadSource *pExcept=NULL)
void AddTransfer (CDownloadTransfer *pTransfer)
void RemoveTransfer (CDownloadTransfer *pTransfer)
CDownloadTransferGetFirstTransfer () const

Protected Attributes

CDownloadTransferm_pTransferFirst
CDownloadTransferm_pTransferLast
int m_nTransferCount
DWORD m_tTransferStart

Friends

class CDownloadTransfer

Constructor & Destructor Documentation

CDownloadWithTransfers::CDownloadWithTransfers  ) 
 

Definition at line 47 of file DownloadWithTransfers.cpp.

References m_nTransferCount, m_pTransferFirst, m_pTransferLast, m_tTransferStart, and NULL.

CDownloadWithTransfers::~CDownloadWithTransfers  )  [virtual]
 

Definition at line 55 of file DownloadWithTransfers.cpp.

References CloseTransfers().


Member Function Documentation

void CDownloadWithTransfers::AddTransfer CDownloadTransfer pTransfer  ) 
 

Definition at line 492 of file DownloadWithTransfers.cpp.

References m_nTransferCount, CDownloadTransfer::m_pDlNext, CDownloadTransfer::m_pDlPrev, m_pTransferFirst, m_pTransferLast, and NULL.

Referenced by CDownloadTransfer::CDownloadTransfer().

BOOL CDownloadWithTransfers::CanStartTransfers DWORD  tNow = 0  ) 
 

Definition at line 172 of file DownloadWithTransfers.cpp.

References CSettings::sDownloads::ConnectThrottle, Downloads, CSettings::Downloads, CDownloads::GetConnectingTransferCount(), CDownloads::m_tLastConnect, m_tTransferStart, CSettings::sDownloads::MaxConnectingSources, Network, CNetwork::ReadyToTransfer(), and Settings.

Referenced by CDownloadWithTorrent::ChokeTorrent(), and StartTransfersIfNeeded().

void CDownloadWithTransfers::CloseTransfers  ) 
 

Definition at line 382 of file DownloadWithTransfers.cpp.

References Downloads, CDownloads::m_bClosing, m_nTransferCount, m_pTransferFirst, and TS_TRUE.

Referenced by CDownloadEditDlg::Commit(), CDownload::OnDownloaded(), CDownloadEditDlg::OnErase(), CDownloadEditDlg::OnLButtonUp(), CDownload::Remove(), CDownload::StopTrying(), CDownload::~CDownload(), and ~CDownloadWithTransfers().

QWORD CDownloadWithTransfers::GetAmountDownloadedFrom IN_ADDR *  pAddress  )  const
 

Definition at line 155 of file DownloadWithTransfers.cpp.

References CDownloadTransfer::m_pDlNext, and m_pTransferFirst.

Referenced by CDownloads::GetAmountDownloadedFrom().

DWORD CDownloadWithTransfers::GetAverageSpeed  )  const
 

Definition at line 402 of file DownloadWithTransfers.cpp.

References dtsDownloading, CDownloadTransfer::m_pDlNext, and m_pTransferFirst.

Referenced by CDownloadWithFile::GetTimeRemaining(), CDownloadTipCtrl::OnPaint(), and CDownloadMonitorDlg::OnTimer().

CDownloadTransfer* CDownloadWithTransfers::GetFirstTransfer  )  const [inline]
 

Definition at line 67 of file DownloadWithTransfers.h.

References m_pTransferFirst.

Referenced by CDownload::Boost(), CDownloadWithTorrent::ChokeTorrent(), CDownloadWithFile::GetFragment(), CDownloadWithFile::GetPossibleFragments(), CDownloadWithTorrent::OnFinishedTorrentBlock(), CDownloads::OnRun(), CDownloadTransferED2K::SendFragmentRequests(), CDownloadTransferBT::SendRequests(), CDownloadWithFile::SubmitData(), and CHomeDownloadsBox::Update().

DWORD CDownloadWithTransfers::GetMeasuredSpeed  )  const
 

Definition at line 417 of file DownloadWithTransfers.cpp.

References dtsDownloading, CDownloadTransfer::m_pDlNext, and m_pTransferFirst.

Referenced by CDownloadsCtrl::BubbleSortDownloads(), CDownloadMonitorDlg::OnTimer(), and CDownloadTipCtrl::OnTimer().

int CDownloadWithTransfers::GetTransferCount int  nState,
IN_ADDR *  pAddress = NULL
const
 

Definition at line 89 of file DownloadWithTransfers.cpp.

References dtsConnecting, dtsCountAll, dtsCountNotConnecting, dtsCountNotQueued, dtsCountTorrentAndActive, dtsDownloading, dtsQueued, dtsRequesting, dtsTorrent, CDownloadTransfer::m_pDlNext, m_pTransferFirst, and VALID_TRANSFER.

int CDownloadWithTransfers::GetTransferCount  )  const
 

Definition at line 63 of file DownloadWithTransfers.cpp.

References CDownloadTransfer::m_pDlNext, m_pTransferFirst, and PROTOCOL_ED2K.

Referenced by CDownloads::GetConnectingTransferCount(), CDownloadsWnd::OnDownloadsBoost(), CBTClient::OnHandshake1(), CDownloadTipCtrl::OnPaint(), CDownload::OnRun(), CDownloadMonitorDlg::OnTimer(), CDownloadsCtrl::PaintDownload(), CUploadTransferHTTP::RequestPartialFile(), CDownloadWithTorrent::RunTorrent(), StartTransfersIfNeeded(), and CDownloads::UpdateAllows().

BOOL CDownloadWithTransfers::OnAcceptPush GGUID pClientID,
CConnection pConnection
 

Definition at line 433 of file DownloadWithTransfers.cpp.

References CDownloadTransferHTTP::AcceptPush(), CDownloadSource::CheckPush(), CDownloadTransfer::Close(), CDownloadSource::CreateTransfer(), dtsConnecting, CDownloadWithSources::GetFirstSource(), CDownload::IsMoving(), CDownload::IsPaused(), CConnection::m_hSocket, CDownloadTransfer::m_nProtocol, CDownloadSource::m_nProtocol, CDownloadTransfer::m_nState, CDownloadSource::m_pNext, CDownloadSource::m_pTransfer, NULL, PROTOCOL_HTTP, and TS_TRUE.

Referenced by CDownloads::OnPush().

BOOL CDownloadWithTransfers::OnDonkeyCallback CEDClient pClient,
CDownloadSource pExcept = NULL
 

Definition at line 463 of file DownloadWithTransfers.cpp.

References CDownloadSource::CheckDonkey(), CDownloadTransfer::Close(), CDownloadSource::CreateTransfer(), dtsConnecting, CDownloadWithSources::GetFirstSource(), CDownloadTransferED2K::Initiate(), CDownload::IsMoving(), CDownload::IsPaused(), CDownloadTransfer::m_nProtocol, CDownloadTransfer::m_nState, CDownloadSource::m_pNext, CDownloadSource::m_pTransfer, NULL, PROTOCOL_ED2K, and TS_TRUE.

Referenced by CDownloads::OnDonkeyCallback().

void CDownloadWithTransfers::RemoveTransfer CDownloadTransfer pTransfer  ) 
 

Definition at line 509 of file DownloadWithTransfers.cpp.

References m_nTransferCount, CDownloadTransfer::m_pDlNext, CDownloadTransfer::m_pDlPrev, m_pTransferFirst, m_pTransferLast, and NULL.

Referenced by CDownloadTransfer::Close().

BOOL CDownloadWithTransfers::StartNewTransfer DWORD  tNow = 0  ) 
 

Definition at line 292 of file DownloadWithTransfers.cpp.

References CSettings::BitTorrent, CDownloadSource::CreateTransfer(), CSettings::Downloads, CNetwork::GetStableTime(), CDownloadTransfer::Initiate(), CNetwork::IsConnected(), CDownloadBase::m_bBTH, CDownloadSource::m_nProtocol, CDownloadWithSources::m_pSourceFirst, Network, CSettings::sDownloads::NeverDrop, NULL, CSettings::sBitTorrent::PreferenceBTSources, PROTOCOL_BT, PROTOCOL_HTTP, CDownloadSource::PushRequest(), CDownloadSource::Remove(), and Settings.

Referenced by CDownloadWithTorrent::ChokeTorrent(), and StartTransfersIfNeeded().

BOOL CDownloadWithTransfers::StartTransfersIfNeeded DWORD  tNow = 0  ) 
 

Definition at line 199 of file DownloadWithTransfers.cpp.

References CSettings::BitTorrent, CanStartTransfers(), CSettings::sBitTorrent::DownloadConnections, Downloads, CSettings::Downloads, dtsCountAll, dtsCountTorrentAndActive, dtsDownloading, GetTransferCount(), CDownloads::m_bAllowMoreDownloads, CDownloads::m_bAllowMoreTransfers, CDownloadBase::m_bBTH, m_pTransferFirst, CSettings::sDownloads::MaxFileTransfers, NULL, Settings, CSettings::sDownloads::StaggardStart, StartNewTransfer(), and CDownloads::UpdateAllows().

Referenced by CDownload::OnRun().


Friends And Related Function Documentation

friend class CDownloadTransfer [friend]
 

Reimplemented from CDownloadWithSources.

Reimplemented in CDownload, and CDownloadWithFile.

Definition at line 72 of file DownloadWithTransfers.h.


Member Data Documentation

int CDownloadWithTransfers::m_nTransferCount [protected]
 

Definition at line 45 of file DownloadWithTransfers.h.

Referenced by AddTransfer(), CDownloadWithTransfers(), CloseTransfers(), and RemoveTransfer().

CDownloadTransfer* CDownloadWithTransfers::m_pTransferFirst [protected]
 

Definition at line 43 of file DownloadWithTransfers.h.

Referenced by AddTransfer(), CDownloadWithTransfers(), CloseTransfers(), GetAmountDownloadedFrom(), GetAverageSpeed(), GetFirstTransfer(), GetMeasuredSpeed(), GetTransferCount(), RemoveTransfer(), and StartTransfersIfNeeded().

CDownloadTransfer* CDownloadWithTransfers::m_pTransferLast [protected]
 

Definition at line 44 of file DownloadWithTransfers.h.

Referenced by AddTransfer(), CDownloadWithTransfers(), and RemoveTransfer().

DWORD CDownloadWithTransfers::m_tTransferStart [protected]
 

Definition at line 46 of file DownloadWithTransfers.h.

Referenced by CanStartTransfers(), and CDownloadWithTransfers().


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