21 #ifndef BTPIECEDOWNLOADER_H
22 #define BTPIECEDOWNLOADER_H
25 #include <ktorrent_export.h>
26 #include <util/constants.h>
108 bool isNearlyDone()
const {
return getNumGrabbed() == 1 && nearly_done;}
119 virtual bool hasChunk(bt::Uint32 )
const {
return true;}
virtual void checkTimeouts()=0
virtual bool canDownloadChunk() const =0
virtual void cancelAll()=0
virtual void cancel(const bt::Request &req)=0
virtual bool isChoked() const
virtual QString getName() const =0
Request of a piece sent to other peers.
void rejected(const bt::Request &req)
virtual bool canAddRequest() const =0
int getNumGrabbed() const
Get the number of times this PeerDownloader was grabbed.
virtual void download(const bt::Request &req)=0
void setNearlyDone(bool nd)
Set the nearly done status of the PeerDownloader.
bool isNearlyDone() const
See if this PieceDownloader has nearly finished a chunk.
virtual bt::Uint32 getDownloadRate() const =0
void timedout(const bt::Request &r)
virtual bool hasChunk(bt::Uint32) const