kget
bt::PeerUploader Class Reference
#include <peeruploader.h>
Detailed Description
Uploads pieces to a Peer
This class handles the uploading of pieces to a Peer. It keeps track of a list of Request objects. All these Requests where sent by the Peer. It will upload the pieces to the Peer, making sure that the maximum upload rate isn't surpassed.
Definition at line 44 of file peeruploader.h.
Public Member Functions | |
| void | addRequest (const Request &r) |
| void | addUploadedBytes (Uint32 bytes) |
| void | clearAllRequests () |
| Uint32 | getNumRequests () const |
| PeerUploader (Peer *peer) | |
| void | removeRequest (const Request &r) |
| Uint32 | update (ChunkManager &cman, Uint32 opt_unchoked) |
| virtual | ~PeerUploader () |
Constructor & Destructor Documentation
| bt::PeerUploader::PeerUploader | ( | Peer * | peer | ) |
Constructor.
Set the Peer.
- Parameters:
-
peer The Peer
Definition at line 34 of file peeruploader.cpp.
| bt::PeerUploader::~PeerUploader | ( | ) | [virtual] |
Definition at line 40 of file peeruploader.cpp.
Member Function Documentation
| void bt::PeerUploader::addRequest | ( | const Request & | r | ) |
Add a Request to the list of Requests.
- Parameters:
-
r The Request
Definition at line 43 of file peeruploader.cpp.
| void bt::PeerUploader::addUploadedBytes | ( | Uint32 | bytes | ) | [inline] |
Definition at line 82 of file peeruploader.h.
| void bt::PeerUploader::clearAllRequests | ( | ) |
| Uint32 bt::PeerUploader::getNumRequests | ( | ) | const |
| void bt::PeerUploader::removeRequest | ( | const Request & | r | ) |
Remove a Request from the list of Requests.
- Parameters:
-
r The Request
Definition at line 52 of file peeruploader.cpp.
| Uint32 bt::PeerUploader::update | ( | ChunkManager & | cman, | |
| Uint32 | opt_unchoked | |||
| ) |
Update the PeerUploader.
This will check if there are Request, and will try to handle them.
- Parameters:
-
cman The ChunkManager opt_unchoked ID of optimisticly unchoked peer
- Returns:
- The number of bytes uploaded
Definition at line 60 of file peeruploader.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference