libktorrent  2.1.1
chunkdownloadinterface.h
1 /***************************************************************************
2  * Copyright (C) 2005 by Joris Guisson *
3  * joris.guisson@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 #ifndef BTCHUNKDOWNLOADINTERFACE_H
21 #define BTCHUNKDOWNLOADINTERFACE_H
22 
23 #include <qstring.h>
24 #include <util/constants.h>
25 
26 namespace bt
27 {
28 
35  class ChunkDownloadInterface
36  {
37  public:
38  ChunkDownloadInterface();
39  virtual ~ChunkDownloadInterface();
40 
41  struct Stats
42  {
44  QString current_peer_id;
46  bt::Uint32 download_speed;
48  bt::Uint32 chunk_index;
50  bt::Uint32 pieces_downloaded;
52  bt::Uint32 total_pieces;
54  bt::Uint32 num_downloaders;
55  };
56 
57  virtual void getStats(Stats & s) = 0;
58  };
59 
60 }
61 
62 #endif
bt::ChunkDownloadInterface::Stats::current_peer_id
QString current_peer_id
The PeerID of the current downloader.
Definition: chunkdownloadinterface.h:80
bt::ChunkDownloadInterface::Stats::download_speed
bt::Uint32 download_speed
The current download speed.
Definition: chunkdownloadinterface.h:82
bt::ChunkDownloadInterface::Stats::num_downloaders
bt::Uint32 num_downloaders
The number of assigned downloaders.
Definition: chunkdownloadinterface.h:90
bt::ChunkDownloadInterface::Stats::total_pieces
bt::Uint32 total_pieces
The total number of pieces of the chunk.
Definition: chunkdownloadinterface.h:88
bt::ChunkDownloadInterface::Stats::pieces_downloaded
bt::Uint32 pieces_downloaded
The number of pieces of the chunk which have been downloaded.
Definition: chunkdownloadinterface.h:86
bt::ChunkDownloadInterface::Stats::chunk_index
bt::Uint32 chunk_index
The index of the chunk.
Definition: chunkdownloadinterface.h:84