Furrent
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
fur::download::message::BitfieldMessage Class Referencefinal

#include <message.hpp>

Inheritance diagram for fur::download::message::BitfieldMessage:
Inheritance graph
[legend]
Collaboration diagram for fur::download::message::BitfieldMessage:
Collaboration graph
[legend]

Public Member Functions

 BitfieldMessage (Bitfield bitfield)
 
MessageKind kind () const override
 
- Public Member Functions inherited from fur::download::message::Message
virtual ~Message ()=default
 
virtual std::vector< uint8_t > encode () const
 

Static Public Member Functions

static std::unique_ptr< BitfieldMessagedecode (const TorrentFile &torrent, const std::vector< uint8_t > &buf)
 
- Static Public Member Functions inherited from fur::download::message::Message
static Result< std::unique_ptr< Message >, DecodeErrordecode (const TorrentFile &torrent, const std::vector< uint8_t > &buf)
 

Public Attributes

const Bitfield bitfield
 Bitfield representing the pieces available. More...
 

Detailed Description

Used by the peer to inform us of the pieces it has available for sharing. <length=1+X><id=5><bitfield> where X is the length of the bitfield.

Constructor & Destructor Documentation

◆ BitfieldMessage()

fur::download::message::BitfieldMessage::BitfieldMessage ( Bitfield  bitfield)
inlineexplicit

Member Function Documentation

◆ decode()

std::unique_ptr< BitfieldMessage > fur::download::message::BitfieldMessage::decode ( const TorrentFile torrent,
const std::vector< uint8_t > &  buf 
)
static

◆ kind()

MessageKind fur::download::message::BitfieldMessage::kind ( ) const
inlineoverridevirtual

Returns the kind of this message. Used before dynamic_casting when the underlying type is not known beforehand.

Implements fur::download::message::Message.

Member Data Documentation

◆ bitfield

const Bitfield fur::download::message::BitfieldMessage::bitfield

Bitfield representing the pieces available.


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