Protocols::BitTorrent::Packets::Port Class Reference

#include <Port.h> [code]

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

Inheritance diagram for Protocols::BitTorrent::Packets::Port:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Implements the packet Port.

The Port packet payload contains a 2 byte big-endian integer specifying DHT listening port of the peer.

Definition at line 38 of file Port.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.
 Port (quint16 listenPort=0)
quint16 listenPort () const
 Getter for the packet field listenPort.
void setListenPort (quint16)
 Setter for the packet field listenPort.

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

Classes

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


Member Enumeration Documentation

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

Enumerator:
PayloadLength 

Definition at line 72 of file Port.h.


Constructor & Destructor Documentation

Port::Port quint16  listenPort = 0  ) 
 

Definition at line 40 of file Port.cpp.


Member Function Documentation

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

Virtual copy constructor.

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

Definition at line 34 of file Port.cpp.

quint16 Protocols::BitTorrent::Packets::Port::listenPort  )  const [inline]
 

Getter for the packet field listenPort.

Definition at line 79 of file Port.h.

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

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

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

Reads the packet's payload fields.

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

Definition at line 48 of file Port.cpp.

void Protocols::BitTorrent::Packets::Port::setListenPort quint16   )  [inline]
 

Setter for the packet field listenPort.

Definition at line 83 of file Port.h.

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

Writes the packet's payload fields.

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

Definition at line 55 of file Port.cpp.


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