Gnutella::Packets::QueryRoutingReset Class Reference

#include <QueryRoutingReset.h> [code]

Inherits Gnutella::Packets::QueryRouting.

Inheritance diagram for Gnutella::Packets::QueryRoutingReset:

Inheritance graph
[legend]
Collaboration diagram for Gnutella::Packets::QueryRoutingReset:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 33 of file QueryRoutingReset.h.

Public Member Functions

 QueryRoutingReset (const QByteArray &rawHeader, const QByteArray &rawPayload)
 QueryRoutingReset (quint32 tableLength, quint8 infinity)
 ~QueryRoutingReset ()
QueryRoutingResetcopy () const
 A virtual copy contructor.
QString name () const
quint32 tableLength () const
quint8 infinity () const

Static Public Member Functions

static QueryRoutingResetcastFrom (Packet &packet)
static const QueryRoutingResetcastFrom (const Packet &packet)

Protected Member Functions

bool prepareReadPayload (const QByteArray &rawPayload)
 Verifies the structure of the rawPayload.
void readPayload (QDataStream &stream)
 Reads the payload fields from the stream. The structure of the data in the stream is already verified by verifyPayload().
int prepareWritePayload () const
 Gets ready to write the payload and returns the payload length.
void writePayload (QDataStream &stream) const
 Writes the payload fields into the stream.

Private Attributes

Gnutella::Packets::QueryRoutingReset::Data p

Classes

struct  Data


Constructor & Destructor Documentation

QueryRoutingReset::QueryRoutingReset const QByteArray &  rawHeader,
const QByteArray &  rawPayload
 

Creates a QueryRoutingReset object from the raw bytes in rawHeader and rawPayload.

Definition at line 36 of file QueryRoutingReset.cpp.

QueryRoutingReset::QueryRoutingReset quint32  tableLength,
quint8  infinity
 

Definition at line 42 of file QueryRoutingReset.cpp.

QueryRoutingReset::~QueryRoutingReset  ) 
 

Definition at line 49 of file QueryRoutingReset.cpp.


Member Function Documentation

static const QueryRoutingReset& Gnutella::Packets::QueryRoutingReset::castFrom const Packet packet  )  [inline, static]
 

Reimplemented from Gnutella::Packets::QueryRouting.

Definition at line 37 of file QueryRoutingReset.h.

static QueryRoutingReset& Gnutella::Packets::QueryRoutingReset::castFrom Packet packet  )  [inline, static]
 

Reimplemented from Gnutella::Packets::QueryRouting.

Definition at line 36 of file QueryRoutingReset.h.

QueryRoutingReset* Gnutella::Packets::QueryRoutingReset::copy  )  const [inline, virtual]
 

A virtual copy contructor.

Implements Gnutella::Packets::QueryRouting.

Definition at line 43 of file QueryRoutingReset.h.

quint8 Gnutella::Packets::QueryRoutingReset::infinity  )  const [inline]
 

Definition at line 48 of file QueryRoutingReset.h.

QString Gnutella::Packets::QueryRoutingReset::name  )  const [inline, virtual]
 

Todo:
remove this?

Implements Gnutella::Packets::Packet.

Definition at line 45 of file QueryRoutingReset.h.

bool QueryRoutingReset::prepareReadPayload const QByteArray &  rawPayload  )  [protected, virtual]
 

Verifies the structure of the rawPayload.

Verifies if the rawPayload can be correctly parsed by readPayload(). The function just goes over the whole rawPayload and checks if the structure of the payload is correct. Some data may be gathered and stored to ease the work of readPayload(). For example, the size of the query hit data field can only be calculated with knowledge of the payloadLength, which is not available in the QDataStream object passed to readPayload(). The size of this field is read here and stored for use later in readPayload().

Implements Gnutella::Packets::QueryRouting.

Definition at line 53 of file QueryRoutingReset.cpp.

int QueryRoutingReset::prepareWritePayload  )  const [protected, virtual]
 

Gets ready to write the payload and returns the payload length.

Implements Gnutella::Packets::QueryRouting.

Definition at line 65 of file QueryRoutingReset.cpp.

void QueryRoutingReset::readPayload QDataStream &  stream  )  [protected, virtual]
 

Reads the payload fields from the stream. The structure of the data in the stream is already verified by verifyPayload().

Implements Gnutella::Packets::QueryRouting.

Definition at line 58 of file QueryRoutingReset.cpp.

quint32 Gnutella::Packets::QueryRoutingReset::tableLength  )  const [inline]
 

Definition at line 47 of file QueryRoutingReset.h.

void QueryRoutingReset::writePayload QDataStream &  stream  )  const [protected, virtual]
 

Writes the payload fields into the stream.

Implements Gnutella::Packets::QueryRouting.

Definition at line 70 of file QueryRoutingReset.cpp.


Member Data Documentation

struct Gnutella::Packets::QueryRoutingReset::Data Gnutella::Packets::QueryRoutingReset::p [private]
 

Reimplemented from Gnutella::Packets::QueryRouting.


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