Downloader.h
资源名称:GGBT.rar [点击查看]
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:2k
源码类别:
P2P编程
开发平台:
Visual C++
- // Downloader.h: interface for the CDownloader class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_DOWNLOADER_H__73CCECA4_C8FB_4231_AD44_5B45B9238992__INCLUDED_)
- #define AFX_DOWNLOADER_H__73CCECA4_C8FB_4231_AD44_5B45B9238992__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- class CStorageWrapper;
- class CPiecePicker;
- class CMeasure;
- class CRateMeasure;
- // class CSingleDownload;
- class CConnection;
- class CDownloaderFeedback;
- #include "SingleDownload.h"
- class CDownloader
- {
- public:
- CDownloader();
- virtual ~CDownloader();
- bool Create(CDownloaderFeedback* pDownloaderFeedback, CStorageWrapper* pstrorage, CPiecePicker* pPicker, long lBacklog,
- long lMaxRatePeriod, CMeasure* pDownMeasure, long lNumPieces, long lSnubTime,
- CRateMeasure* pRateMeasure);
- bool IsCreate();
- void make_endgame();
- bool is_endgame();
- void cancel_endgame();
- CSingleDownload* make_download(CConnection* pConnection);
- void OnNeedFilesChanged();
- CStorageWrapper* m_pstrorage;
- CPiecePicker* m_pPicker;
- long m_lBacklog;
- long m_lMaxRatePeriod;
- CMeasure* m_pDownMeasure;
- long m_lNumPieces;
- long m_lSnubTime;
- CRateMeasure* m_pRateMeasure;
- vector<CSingleDownload*> m_vDownloads;
- // for endgame.
- vector<CRequestsItem> m_vRequests;
- bool m_bEndgame;
- private:
- CDownloaderFeedback* m_pDownloaderFeedback;
- bool m_bCreate;
- };
- #endif // !defined(AFX_DOWNLOADER_H__73CCECA4_C8FB_4231_AD44_5B45B9238992__INCLUDED_)