Protocols::BitTorrent::Packets::Request Class Reference

#include <Request.h> [code]

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

Inheritance diagram for Protocols::BitTorrent::Packets::Request:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Implements the packet Request.

The Request packet is used to request a given piece for download.

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


Member Enumeration Documentation

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

Enumerator:
PayloadLength 

Definition at line 79 of file Request.h.


Constructor & Destructor Documentation

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

Definition at line 40 of file Request.cpp.


Member Function Documentation

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

Getter for the packet field bytesCount.

Definition at line 102 of file Request.h.

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

Virtual copy constructor.

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

Definition at line 34 of file Request.cpp.

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

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

Getter for the packet field pieceIndex.

Definition at line 86 of file Request.h.

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

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

Reads the packet's payload fields.

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

Definition at line 50 of file Request.cpp.

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

Setter for the packet field bytesCount.

Definition at line 106 of file Request.h.

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

Setter for the packet field pieceIndex.

Definition at line 90 of file Request.h.

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

Setter for the packet field startOffset.

Definition at line 98 of file Request.h.

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

Getter for the packet field startOffset.

Definition at line 94 of file Request.h.

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

Writes the packet's payload fields.

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

Definition at line 59 of file Request.cpp.


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