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

#include <message.hpp>

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

Public Member Functions

 HaveMessage (int64_t index)
 
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 Result< std::unique_ptr< HaveMessage >, DecodeErrordecode (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 int64_t index
 Index of the newly acquired piece. More...
 

Detailed Description

Inform the peer that we have acquired a new piece. <length=5><id=4><piece-index>

Constructor & Destructor Documentation

◆ HaveMessage()

fur::download::message::HaveMessage::HaveMessage ( int64_t  index)
inlineexplicit

Member Function Documentation

◆ decode()

Result< std::unique_ptr< HaveMessage >, DecodeError > fur::download::message::HaveMessage::decode ( const std::vector< uint8_t > &  buf)
static

◆ kind()

MessageKind fur::download::message::HaveMessage::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

◆ index

const int64_t fur::download::message::HaveMessage::index

Index of the newly acquired piece.


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