Protocols::BitTorrent::Packets::SuggestPiece Class Reference

#include <SuggestPiece.h> [code]

Inherits Protocols::BitTorrent::Packets::PacketBase.

Inheritance diagram for Protocols::BitTorrent::Packets::SuggestPiece:

Inheritance graph
[legend]
Collaboration diagram for Protocols::BitTorrent::Packets::SuggestPiece:

Collaboration graph
[legend]
List of all members.

Detailed Description

Implements the packet SuggestPiece.

The SuggestPiece packet is used to suggest a peer which pice to request.

Note:
Should only be sent or received over if Fast Extension was negotiated.

Definition at line 39 of file SuggestPiece.h.

Public Member Functions

QString name () const
 Returns the name of the PacketBase type the dynamic object belongs to.
auto_ptr< DataBasecopy () const
 Virtual copy constructor.
 SuggestPiece (quint32 pieceIndex=0)
quint32 pieceIndex () const
 Getter for the packet field pieceIndex.
void setPieceIndex (quint32)
 Setter for the packet field pieceIndex.

Protected Member Functions

void readPayload (BinaryReader &)
 Reads the packet's payload fields.
void writePayload (BinaryWriter &) const
 Writes the packet's payload fields.
 Q_DECLARE_SHARED_DATA (Data)

Private Types

enum  Constants { PayloadLength = 4 }

Classes

class  Data
 SuggestPiece packet's private data. More...


Member Enumeration Documentation

enum Protocols::BitTorrent::Packets::SuggestPiece::Constants [private]
 

Enumerator:
PayloadLength 

Definition at line 73 of file SuggestPiece.h.


Constructor & Destructor Documentation

SuggestPiece::SuggestPiece quint32  pieceIndex = 0  ) 
 

Definition at line 40 of file SuggestPiece.cpp.


Member Function Documentation

auto_ptr< DataBase > SuggestPiece::copy  )  const [virtual]
 

Virtual copy constructor.

Implements Protocols::BitTorrent::Packets::PacketBase.

Definition at line 34 of file SuggestPiece.cpp.

QString SuggestPiece::name  )  const [virtual]
 

Returns the name of the PacketBase type the dynamic object belongs to.

Todo:
Better use PacketId (which possibly contains the ProtocolId)?

Implements Protocols::BitTorrent::Packets::PacketBase.

Definition at line 28 of file SuggestPiece.cpp.

quint32 Protocols::BitTorrent::Packets::SuggestPiece::pieceIndex  )  const [inline]
 

Getter for the packet field pieceIndex.

Definition at line 80 of file SuggestPiece.h.

Protocols::BitTorrent::Packets::SuggestPiece::Q_DECLARE_SHARED_DATA Data   )  [protected]
 

void SuggestPiece::readPayload BinaryReader  )  [protected, virtual]
 

Reads the packet's payload fields.

Implements Protocols::BitTorrent::Packets::PacketBase.

Definition at line 48 of file SuggestPiece.cpp.

void Protocols::BitTorrent::Packets::SuggestPiece::setPieceIndex quint32   )  [inline]
 

Setter for the packet field pieceIndex.

Definition at line 84 of file SuggestPiece.h.

void SuggestPiece::writePayload BinaryWriter  )  const [protected, virtual]
 

Writes the packet's payload fields.

Implements Protocols::BitTorrent::Packets::PacketBase.

Definition at line 55 of file SuggestPiece.cpp.


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