kget
bt::ChunkDownload Class Reference
#include <chunkdownload.h>

Detailed Description
Handles the download off one Chunk off a Peer
This class handles the download of one Chunk.
Definition at line 60 of file chunkdownload.h.
Public Member Functions | |
| bool | assign (PieceDownloader *pd) |
| Uint32 | bytesDownloaded () const |
| void | cancelAll () |
| ChunkDownload (Chunk *chunk) | |
| bool | containsPeer (PieceDownloader *pd) |
| Chunk * | getChunk () |
| Uint32 | getChunkIndex () const |
| Uint32 | getDownloadSpeed () const |
| SHA1Hash | getHash () const |
| Uint32 | getNumDownloaders () const |
| PieceDownloader * | getOnlyDownloader () |
| QString | getPieceDownloaderName () const |
| Uint32 | getPiecesDownloaded () const |
| void | getStats (Stats &s) |
| Uint32 | getTotalPieces () const |
| bool | isChoked () const |
| bool | isIdle () const |
| void | killed (PieceDownloader *pd) |
| bool | load (File &file, ChunkDownloadHeader &hdr) |
| bool | needsToBeUpdated () const |
| bool | piece (const Piece &p, bool &ok) |
| void | releaseAllPDs () |
| void | save (File &file) |
| void | update () |
| bool | usingContinuousHashing () const |
| virtual | ~ChunkDownload () |
Friends | |
| File & | operator<< (File &out, const ChunkDownload &cd) |
| File & | operator>> (File &in, ChunkDownload &cd) |
Constructor & Destructor Documentation
| bt::ChunkDownload::ChunkDownload | ( | Chunk * | chunk | ) |
Constructor, set the chunk and the PeerManager.
- Parameters:
-
chunk The Chunk
Definition at line 65 of file chunkdownload.cpp.
| bt::ChunkDownload::~ChunkDownload | ( | ) | [virtual] |
Definition at line 96 of file chunkdownload.cpp.
Member Function Documentation
| bool bt::ChunkDownload::assign | ( | PieceDownloader * | pd | ) |
Assign the downloader to download from.
- Parameters:
-
pd The downloader
- Returns:
- true if the peer was asigned, false if not
Definition at line 161 of file chunkdownload.cpp.
| Uint32 bt::ChunkDownload::bytesDownloaded | ( | ) | const |
| void bt::ChunkDownload::cancelAll | ( | ) |
| bool bt::ChunkDownload::containsPeer | ( | PieceDownloader * | pd | ) | [inline] |
| Chunk* bt::ChunkDownload::getChunk | ( | ) | [inline] |
| Uint32 bt::ChunkDownload::getChunkIndex | ( | ) | const |
| Uint32 bt::ChunkDownload::getDownloadSpeed | ( | ) | const |
| SHA1Hash bt::ChunkDownload::getHash | ( | ) | const [inline] |
| Uint32 bt::ChunkDownload::getNumDownloaders | ( | ) | const [inline] |
| PieceDownloader * bt::ChunkDownload::getOnlyDownloader | ( | ) |
When a Chunk is downloaded, this function checks if all pieces are delivered by the same peer and if so returns it.
- Returns:
- The PieceDownloader or 0 if there is no only peer
Definition at line 411 of file chunkdownload.cpp.
| QString bt::ChunkDownload::getPieceDownloaderName | ( | ) | const |
| Uint32 bt::ChunkDownload::getPiecesDownloaded | ( | ) | const [inline] |
| void bt::ChunkDownload::getStats | ( | Stats & | s | ) | [virtual] |
Get download stats.
Implements bt::ChunkDownloadInterface.
Definition at line 423 of file chunkdownload.cpp.
| Uint32 bt::ChunkDownload::getTotalPieces | ( | ) | const [inline] |
| bool bt::ChunkDownload::isChoked | ( | ) | const |
See if the download is choked (i.e. all downloaders are choked).
Definition at line 433 of file chunkdownload.cpp.
| bool bt::ChunkDownload::isIdle | ( | ) | const [inline] |
See if a chunkdownload is idle (i.e. has no downloaders).
Definition at line 97 of file chunkdownload.h.
| void bt::ChunkDownload::killed | ( | PieceDownloader * | pd | ) |
A PieceDownloader has been killed.
We need to remove it.
- Parameters:
-
pd The PieceDownloader
Definition at line 295 of file chunkdownload.cpp.
| bool bt::ChunkDownload::load | ( | File & | file, | |
| ChunkDownloadHeader & | hdr | |||
| ) |
| bool bt::ChunkDownload::needsToBeUpdated | ( | ) | const [inline] |
See if this CD hasn't been active in the last update.
Definition at line 157 of file chunkdownload.h.
| bool bt::ChunkDownload::piece | ( | const Piece & | p, | |
| bool & | ok | |||
| ) |
A Piece has arived.
- Parameters:
-
p The Piece ok Whether or not the piece was needed
- Returns:
- true If Chunk is complete
Definition at line 101 of file chunkdownload.cpp.
| void bt::ChunkDownload::releaseAllPDs | ( | ) |
| void bt::ChunkDownload::save | ( | File & | file | ) |
| void bt::ChunkDownload::update | ( | ) |
| bool bt::ChunkDownload::usingContinuousHashing | ( | ) | const |
Are we using the continuous hashing feature for this chunk.
Definition at line 462 of file chunkdownload.cpp.
Friends And Related Function Documentation
| File& operator<< | ( | File & | out, | |
| const ChunkDownload & | cd | |||
| ) | [friend] |
| File& operator>> | ( | File & | in, | |
| ChunkDownload & | cd | |||
| ) | [friend] |
The documentation for this class was generated from the following files:
KDE 4.2 API Reference