#include <QueryRouting.h> [code]
Inherits Gnutella::Packets::Packet.
Inherited by Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset.
Inheritance diagram for Gnutella::Packets::QueryRouting:


Definition at line 33 of file QueryRouting.h.
Public Types | |
| enum | Variant { ResetVariant = 0x0, PatchVariant = 0x1, UnknownVariant } |
Public Member Functions | |
| ~QueryRouting () | |
| Packet * | copy () const =0 |
| A virtual copy contructor. | |
| Variant | variant () const |
Static Public Member Functions | |
| static QueryRouting & | castFrom (Packet &packet) |
| static const QueryRouting & | castFrom (const Packet &packet) |
Protected Member Functions | |
| QueryRouting (const QByteArray &rawHeader, const QByteArray &rawPayload) | |
| QueryRouting (Variant variant) | |
| bool | prepareReadPayload (const QByteArray &rawPayload)=0 |
| Verifies the structure of the rawPayload. | |
| void | readPayload (QDataStream &stream)=0 |
| Reads the payload fields from the stream. The structure of the data in the stream is already verified by verifyPayload(). | |
| int | prepareWritePayload () const =0 |
| Gets ready to write the payload and returns the payload length. | |
| void | writePayload (QDataStream &stream) const =0 |
| Writes the payload fields into the stream. | |
Private Attributes | |
| Gnutella::Packets::QueryRouting::Private | p |
Classes | |
| struct | Private |
|
|
Definition at line 38 of file QueryRouting.h. |
|
|
Definition at line 63 of file QueryRouting.cpp. |
|
||||||||||||
|
Creates a QueryRouting object from the raw bytes in rawHeader and rawPayload.
Definition at line 52 of file QueryRouting.cpp. |
|
|
Definition at line 57 of file QueryRouting.cpp. |
|
|
Reimplemented in Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset. Definition at line 45 of file QueryRouting.h. |
|
|
Reimplemented in Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset. Definition at line 44 of file QueryRouting.h. |
|
|
A virtual copy contructor.
Implements Gnutella::Packets::Packet. Implemented in Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset. |
|
|
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::Packet. Implemented in Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset. |
|
|
Gets ready to write the payload and returns the payload length.
Implements Gnutella::Packets::Packet. Implemented in Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset. |
|
|
Reads the payload fields from the stream. The structure of the data in the stream is already verified by verifyPayload().
Implements Gnutella::Packets::Packet. Implemented in Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset. Definition at line 76 of file QueryRouting.cpp. |
|
|
Definition at line 48 of file QueryRouting.h. |
|
|
Writes the payload fields into the stream.
Implements Gnutella::Packets::Packet. Implemented in Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset. Definition at line 81 of file QueryRouting.cpp. |
|
|
Reimplemented in Gnutella::Packets::QueryRoutingPatch, and Gnutella::Packets::QueryRoutingReset. |