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

#include <chunkcounter.h>

Public Member Functions

 ChunkCounter (Uint32 num_chunks)
 
void dec (Uint32 idx)
 
void decBitSet (const BitSet &bs)
 
Uint32 get (Uint32 idx) const
 
Uint32 getNumChunks () const
 Get the number of chunks there are.
 
void inc (Uint32 idx)
 
void incBitSet (const BitSet &bs)
 
void reset ()
 

Detailed Description

Author
Joris Guisson

Class to keep track of how many peers have a chunk.

Definition at line 53 of file chunkcounter.h.

Member Function Documentation

◆ dec()

void bt::ChunkCounter::dec ( Uint32  idx)

Decrement the counter for the idx'th chunk

Parameters
idxIndex of the chunk

◆ decBitSet()

void bt::ChunkCounter::decBitSet ( const BitSet bs)

If a bit in the bitset is one, decrement the corresponding counter.

Parameters
bsThe BitSet

◆ get()

Uint32 bt::ChunkCounter::get ( Uint32  idx) const

Get the counter for the idx'th chunk

Parameters
idxIndex of the chunk

◆ inc()

void bt::ChunkCounter::inc ( Uint32  idx)

Increment the counter for the idx'th chunk

Parameters
idxIndex of the chunk

◆ incBitSet()

void bt::ChunkCounter::incBitSet ( const BitSet bs)

If a bit in the bitset is one, increment the corresponding counter.

Parameters
bsThe BitSet

◆ reset()

void bt::ChunkCounter::reset ( )

Reset all values to 0


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