Protocols::BitTorrent::Packets::Cancel Class Reference

#include <Cancel.h> [code]

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

Inheritance diagram for Protocols::BitTorrent::Packets::Cancel:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Implements the packet Cancel.

The Cancel packet is used to cancel a previous request for a given piece.

Definition at line 37 of file Cancel.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.
 Cancel (quint32 pieceIndex=0, quint32 startOffset=0, quint32 bytesCount=0)
quint32 pieceIndex () const
 Getter for the packet field pieceIndex.
void setPieceIndex (quint32)
 Setter for the packet field pieceIndex.
quint32 startOffset () const
 Getter for the packet field startOffset.
void setStartOffset (quint32)
 Setter for the packet field startOffset.
quint32 bytesCount () const
 Getter for the packet field bytesCount.
void setBytesCount (quint32)
 Setter for the packet field bytesCount.

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 = 12 }

Classes

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


Member Enumeration Documentation

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

Enumerator:
PayloadLength 

Definition at line 79 of file Cancel.h.


Constructor & Destructor Documentation

Cancel::Cancel quint32  pieceIndex = 0,
quint32  startOffset = 0,
quint32  bytesCount = 0
 

Definition at line 40 of file Cancel.cpp.


Member Function Documentation

quint32 Protocols::BitTorrent::Packets::Cancel::bytesCount  )  const [inline]
 

Getter for the packet field bytesCount.

Definition at line 102 of file Cancel.h.

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

Virtual copy constructor.

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

Definition at line 34 of file Cancel.cpp.

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

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

Getter for the packet field pieceIndex.

Definition at line 86 of file Cancel.h.

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

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

Reads the packet's payload fields.

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

Definition at line 50 of file Cancel.cpp.

void Protocols::BitTorrent::Packets::Cancel::setBytesCount quint32   )  [inline]
 

Setter for the packet field bytesCount.

Definition at line 106 of file Cancel.h.

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

Setter for the packet field pieceIndex.

Definition at line 90 of file Cancel.h.

void Protocols::BitTorrent::Packets::Cancel::setStartOffset quint32   )  [inline]
 

Setter for the packet field startOffset.

Definition at line 98 of file Cancel.h.

quint32 Protocols::BitTorrent::Packets::Cancel::startOffset  )  const [inline]
 

Getter for the packet field startOffset.

Definition at line 94 of file Cancel.h.

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

Writes the packet's payload fields.

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

Definition at line 59 of file Cancel.cpp.


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