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

DownloadTransfer.h

Go to the documentation of this file.
00001 //
00002 // DownloadTransfer.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 
00022 #if !defined(AFX_DOWNLOADTRANSFER_H__DB393F56_C75B_424C_85E5_FF44300E255B__INCLUDED_)
00023 #define AFX_DOWNLOADTRANSFER_H__DB393F56_C75B_424C_85E5_FF44300E255B__INCLUDED_
00024 
00025 #pragma once
00026 
00027 #include "Transfer.h"
00028 #include "FileFragments.hpp"
00029 
00030 class CDownload;
00031 class CDownloadSource;
00032 
00033 class CDownloadTransfer : public CTransfer
00034 {
00035 // Construction
00036 public:
00037         CDownloadTransfer(CDownloadSource* pSource, PROTOCOLID nProtocol);
00038         virtual ~CDownloadTransfer();
00039 
00040 // Attributes
00041 public:
00042         PROTOCOLID                      m_nProtocol;
00043         CDownload*                      m_pDownload;
00044         CDownloadTransfer*      m_pDlPrev;
00045         CDownloadTransfer*      m_pDlNext;
00046         CDownloadSource*        m_pSource;
00047 public:
00048         int                     m_nState;
00049         int                     m_nQueuePos;
00050         int                     m_nQueueLen;
00051         CString         m_sQueueName;
00052 public:
00053         QWORD           m_nOffset;
00054         QWORD           m_nLength;
00055         QWORD           m_nPosition;
00056         QWORD           m_nDownloaded;
00057 public:
00058         BOOL            m_bWantBackwards;
00059         BOOL            m_bRecvBackwards;
00060 
00061 // Operations
00062 public:
00063         virtual BOOL    Initiate() = 0;
00064         virtual void    Close(TRISTATE bKeepSource);
00065         virtual void    Boost();
00066         virtual DWORD   GetAverageSpeed();
00067         virtual DWORD   GetMeasuredSpeed();
00068     virtual BOOL        SubtractRequested(FF::SimpleFragmentList& ppFragments) = 0;
00069         virtual BOOL    UnrequestRange(QWORD nOffset, QWORD nLength) { return FALSE; }
00070         virtual CString GetStateText(BOOL bLong);
00071         virtual BOOL    OnRun();
00072         void    SetState(int nState);
00073 protected:
00074         void    ChunkifyRequest(QWORD* pnOffset, QWORD* pnLength, QWORD nChunk, BOOL bVerifyLock);
00075 
00076 };
00077 
00078 enum
00079 {
00080         dtsNull, dtsConnecting, dtsRequesting, dtsHeaders, dtsDownloading,
00081         dtsFlushing, dtsTiger, dtsHashset, dtsMetadata, dtsBusy, dtsEnqueue, dtsQueued,
00082         dtsTorrent,
00083 
00084         dtsCountAll = -1,
00085         dtsCountNotQueued = -2,
00086         dtsCountNotConnecting = -3,
00087         dtsCountTorrentAndActive = -4
00088 };
00089 
00090 
00091 #endif // !defined(AFX_DOWNLOADTRANSFER_H__DB393F56_C75B_424C_85E5_FF44300E255B__INCLUDED_)

Generated on Thu Dec 15 10:39:40 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2