Protocols::BitTorrent::Packets::Have Class Reference

#include <Have.h> [code]

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

Inheritance diagram for Protocols::BitTorrent::Packets::Have:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Implements the packet Have.

The Have packet payload contains a 4 byte big-endian integer specifying the index of the piece the peer just downloaded and verified.

Definition at line 38 of file Have.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.
 Have (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
 Have packet's private data. More...


Member Enumeration Documentation

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

Enumerator:
PayloadLength 

Definition at line 72 of file Have.h.


Constructor & Destructor Documentation

Have::Have quint32  pieceIndex = 0  ) 
 

Definition at line 40 of file Have.cpp.


Member Function Documentation

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

Virtual copy constructor.

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

Definition at line 34 of file Have.cpp.

QString Have::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 Have.cpp.

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

Getter for the packet field pieceIndex.

Definition at line 79 of file Have.h.

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

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

Reads the packet's payload fields.

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

Definition at line 48 of file Have.cpp.

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

Setter for the packet field pieceIndex.

Definition at line 83 of file Have.h.

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

Writes the packet's payload fields.

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

Definition at line 55 of file Have.cpp.


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