Furrent
Public Member Functions | Public Attributes | List of all members
fur::PieceTask Class Reference

Class responsible for processing a piece. More...

#include <furrent.hpp>

Collaboration diagram for fur::PieceTask:
Collaboration graph
[legend]

Public Member Functions

 PieceTask ()
 Constructs an empty temporary piece task. More...
 
 PieceTask (TorrentID tid, Piece piece, const TorrentFile &descriptor)
 Constructs a new piece task. More...
 
PieceTaskStats process (const peer::Peer &peer)
 Process piece, downloads it from a peer and saves it to file. More...
 

Public Attributes

TorrentID tid
 Identifier of the owner torrent. More...
 
Piece piece
 Piece to process. More...
 
TorrentFile descriptor
 .torrent descriptor More...
 

Detailed Description

Class responsible for processing a piece.

Constructor & Destructor Documentation

◆ PieceTask() [1/2]

fur::PieceTask::PieceTask ( )
explicit

Constructs an empty temporary piece task.

Constructs a new empty piece task.

◆ PieceTask() [2/2]

fur::PieceTask::PieceTask ( TorrentID  tid,
Piece  piece,
const TorrentFile descriptor 
)

Constructs a new piece task.

Member Function Documentation

◆ process()

PieceTaskStats fur::PieceTask::process ( const peer::Peer peer)

Process piece, downloads it from a peer and saves it to file.

Process piece from downloading to saving

Parameters
peerpeer to use for the download

Member Data Documentation

◆ descriptor

TorrentFile fur::PieceTask::descriptor

.torrent descriptor

◆ piece

Piece fur::PieceTask::piece

Piece to process.

◆ tid

TorrentID fur::PieceTask::tid

Identifier of the owner torrent.


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