libktorrent  2.2.0
Public Member Functions | Friends | List of all members
bt::Request Class Reference

Request of a piece sent to other peers. More...

#include <request.h>

Inheritance diagram for bt::Request:
Inheritance graph
[legend]

Public Member Functions

 Request ()
 
 Request (const Request &r)
 
 Request (Uint32 index, Uint32 off, Uint32 len, PieceDownloader *pd)
 
Uint32 getIndex () const
 Get the index of the chunk.
 
Uint32 getLength () const
 Get the length of a the piece.
 
Uint32 getOffset () const
 Get the offset into the chunk.
 
PieceDownloadergetPieceDownloader () const
 Get the sending Peer.
 
Requestoperator= (const Request &r)
 

Friends

bool operator== (const Request &a, const Request &b)
 

Detailed Description

Author
Joris Guisson

This class keeps track of a request of a piece. The Request consists of an index (the index of the chunk), offset into the chunk and the length of a piece.

The PeerID of the Peer who sent the request is also kept.

Definition at line 39 of file request.h.

Constructor & Destructor Documentation

◆ Request() [1/3]

bt::Request::Request ( )
inline

Constructor, set everything to 0.

Definition at line 45 of file request.h.

◆ Request() [2/3]

bt::Request::Request ( Uint32  index,
Uint32  off,
Uint32  len,
PieceDownloader pd 
)
inline

Constructor, set the index, offset,length and peer

Parameters
indexThe index of the chunk
offThe offset into the chunk
lenThe length of the piece
pdPointer to PieceDownloader of the request

Definition at line 54 of file request.h.

◆ Request() [3/3]

bt::Request::Request ( const Request r)
inline

Copy constructor.

Parameters
rRequest to copy

Definition at line 61 of file request.h.

Member Function Documentation

◆ operator=()

Request& bt::Request::operator= ( const Request r)
inline

Assignment operator.

Parameters
rThe Request to copy

Definition at line 80 of file request.h.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const Request a,
const Request b 
)
friend

Compare two requests. Return true if they are the same. This only compares the index,offset and length.

Parameters
aThe first request
bThe second request
Returns
true if they are equal

Definition at line 97 of file request.h.


The documentation for this class was generated from the following file: