Protocols::Kad::Packets::TcpPortPacket< type > Class Template Reference

#include <TcpPortPacket.h> [code]

Inherits Protocols::Kad::Packets::Packet.

Inheritance diagram for Protocols::Kad::Packets::TcpPortPacket< type >:

Inheritance graph
[legend]
Collaboration diagram for Protocols::Kad::Packets::TcpPortPacket< type >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<PacketType type>
class Protocols::Kad::Packets::TcpPortPacket< type >

A packet which contains only a 2 byte TCP port.

This template class can be used by all packets which have a 2 bytes tcp port payload. The only template argument is a PacketType value. These packets will never be compressed, so they will always have ProtocolType equal to KadProtocol.

Definition at line 41 of file TcpPortPacket.h.

Public Member Functions

virtual QString name () const
 Returns the name of the Kad packet type.
virtual TcpPortPacketcopy () const
 Implements the virtual copy constructor.
 TcpPortPacket ()
 Default constructor.

Protected Types

enum  Constants { PayloadLength = 2 }

Protected Member Functions

virtual void readPayload (BinaryReader &)
 Reads the payload fields from a BinaryReader object.
virtual void writePayload (BinaryWriter &) const
 Writes the payload fields in a BinaryWriter.
 Q_DECLARE_SHARED_DATA (Data)

Static Private Attributes

static const QString name_
 Needed by name(). Each template specialization must define a value.

Classes

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


Member Enumeration Documentation

template<PacketType type>
enum Protocols::Kad::Packets::TcpPortPacket::Constants [protected]
 

Enumerator:
PayloadLength 

Definition at line 53 of file TcpPortPacket.h.


Constructor & Destructor Documentation

template<PacketType type>
Protocols::Kad::Packets::TcpPortPacket< type >::TcpPortPacket  ) 
 

Default constructor.

Simply calls the ctor of the base by passing a newly created object of the base's private data Data and the packet type, which is the template argu- ment value.

Definition at line 102 of file TcpPortPacket.h.


Member Function Documentation

template<PacketType type>
TcpPortPacket< type > * Protocols::Kad::Packets::TcpPortPacket< type >::copy  )  const [virtual]
 

Implements the virtual copy constructor.

Implements Protocols::Kad::Packets::Packet.

Definition at line 90 of file TcpPortPacket.h.

template<PacketType type>
QString Protocols::Kad::Packets::TcpPortPacket< type >::name  )  const [virtual]
 

Returns the name of the Kad packet type.

Returns:
the value of the static member name_. Each template instantiation must define its own value of name_.

Implements Protocols::Kad::Packets::Packet.

Definition at line 83 of file TcpPortPacket.h.

template<PacketType type>
Protocols::Kad::Packets::TcpPortPacket< type >::Q_DECLARE_SHARED_DATA Data   )  [protected]
 

template<PacketType type>
void Protocols::Kad::Packets::TcpPortPacket< type >::readPayload BinaryReader &  reader  )  [protected, virtual]
 

Reads the payload fields from a BinaryReader object.

Reads the field tcpPort as a 2 byte integer.

Implements Protocols::Kad::Packets::Packet.

Definition at line 112 of file TcpPortPacket.h.

template<PacketType type>
void Protocols::Kad::Packets::TcpPortPacket< type >::writePayload BinaryWriter &  writer  )  const [protected, virtual]
 

Writes the payload fields in a BinaryWriter.

Writes the payload field tcpPort as a 2 bytes unsigned integer.

Implements Protocols::Kad::Packets::Packet.

Definition at line 123 of file TcpPortPacket.h.


Member Data Documentation

template<PacketType type>
const QString FirewalledReq::name_ [static, private]
 

Needed by name(). Each template specialization must define a value.

Definition at line 74 of file TcpPortPacket.h.


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