libktorrent  2.1.1
Public Member Functions | List of all members
bt::StreamingChunkSelector Class Reference

#include <streamingchunkselector.h>

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

Public Member Functions

Uint32 criticialWindowSize () const
 Get the critical window size in chunks.
 
void dataChecked (const bt::BitSet &ok_chunks, Uint32 from, Uint32 to) override
 
void init (ChunkManager *cman, Downloader *downer, PeerManager *pman) override
 
void reincluded (bt::Uint32 from, bt::Uint32 to) override
 
void reinsert (bt::Uint32 chunk) override
 
bool select (bt::PieceDownloader *pd, bt::Uint32 &chunk) override
 
bool selectRange (bt::Uint32 &from, bt::Uint32 &to, bt::Uint32 max_len) override
 
void setCursor (bt::Uint32 chunk)
 Set the cursor location.
 
void setSequentialRange (bt::Uint32 from, bt::Uint32 to)
 

Additional Inherited Members

- Protected Member Functions inherited from bt::ChunkSelector
Uint32 leastPeers (const std::list< Uint32 > &lp, Uint32 alternative, Uint32 max_peers_per_chunk)
 
- Protected Attributes inherited from bt::ChunkSelectorInterface
ChunkManagercman
 
Downloaderdowner
 
PeerManagerpman
 

Detailed Description

ChunkSelector which supports streaming mode. It has a range of chunks which are to be downloaded sequentially. And it has a cursor, to support jumping around in the stream.

Definition at line 54 of file streamingchunkselector.h.

Member Function Documentation

◆ dataChecked()

void bt::StreamingChunkSelector::dataChecked ( const bt::BitSet ok_chunks,
Uint32  from,
Uint32  to 
)
overridevirtual

Data has been checked, and these chunks are OK.

Parameters
ok_chunksThe ok_chunks

Reimplemented from bt::ChunkSelector.

◆ init()

void bt::StreamingChunkSelector::init ( ChunkManager cman,
Downloader downer,
PeerManager pman 
)
overridevirtual

Initialize the chunk selector, will be called automatically when the ChunkSelector is set.

Parameters
cmanThe ChunkManager
downerThe Downloader
pmanThe PeerManager

Reimplemented from bt::ChunkSelector.

◆ reincluded()

void bt::StreamingChunkSelector::reincluded ( bt::Uint32  from,
bt::Uint32  to 
)
overridevirtual

A range of chunks has been reincluded.

Parameters
fromThe first chunk
toThe last chunk

Reimplemented from bt::ChunkSelector.

◆ reinsert()

void bt::StreamingChunkSelector::reinsert ( bt::Uint32  chunk)
overridevirtual

Reinsert a chunk.

Parameters
chunkThe chunk

Reimplemented from bt::ChunkSelector.

◆ select()

bool bt::StreamingChunkSelector::select ( bt::PieceDownloader pd,
bt::Uint32 &  chunk 
)
overridevirtual

Select which chunk to download for a PieceDownloader.

Parameters
pdThe PieceDownloader
chunkIndex of chunk gets stored here
Returns
true upon succes, false otherwise

Reimplemented from bt::ChunkSelector.

◆ selectRange()

bool bt::StreamingChunkSelector::selectRange ( bt::Uint32 &  from,
bt::Uint32 &  to,
bt::Uint32  max_len 
)
overridevirtual

Select a range of chunks to download from a webseeder.

Parameters
fromFirst chunk of the range
toLast chunk of the range
max_lenMaximum length of range
Returns
true if everything is OK

Reimplemented from bt::ChunkSelector.

◆ setSequentialRange()

void bt::StreamingChunkSelector::setSequentialRange ( bt::Uint32  from,
bt::Uint32  to 
)

Set the range to be downloaded sequentially. The cursor will be initialized to the first of the range.

Parameters
fromStart of range
toEnd of range

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