#include <Bye.h> [code]
Inherits Gnutella::Packets::Packet.
Inherited by Gnutella::Packets::Testing::ByeConcretePacket.
Inheritance diagram for Gnutella::Packets::Bye:


Definition at line 31 of file Bye.h.
Public Member Functions | |
| Bye (const QByteArray &rawHeader, const QByteArray &rawPayload) | |
| Bye (quint16 code, const QByteArray &message) | |
| Bye (const Bye &other) | |
| Bye & | operator= (const Bye &other) |
| ~Bye () | |
| Bye * | copy () const |
| A virtual copy contructor. | |
| QString | name () const |
| quint16 | code () const |
| QByteArray | message () const |
| void | setCode (quint16 code) |
| void | setMessage (const QByteArray &message) |
Static Public Member Functions | |
| static Bye & | castFrom (Packet &packet) |
| static const Bye & | castFrom (const Packet &packet) |
Protected Member Functions | |
| void | invalidatePayload () |
| 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 | |
| Data | d |
| Private data with reference counting. | |
Classes | |
| struct | Data |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A virtual copy contructor.
Implements Gnutella::Packets::Packet. |
|
|
Nothing special to do here. We do not need reference counting for Bye packets. Objects of this class will be created only rarely and will not be copied too much. Just call tha base implementation! Reimplemented from Gnutella::Packets::Packet. Reimplemented in Gnutella::Packets::Testing::ByeConcretePacket. |
|
|
|
|
|
Implements Gnutella::Packets::Packet. |
|
|
|
|
|
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. |
|
|
Gets ready to write the payload and returns the payload length.
Implements Gnutella::Packets::Packet. |
|
|
Reads the payload fields from the stream. The structure of the data in the stream is already verified by verifyPayload().
Implements Gnutella::Packets::Packet. |
|
|
|
|
|
|
|
|
Writes the payload fields into the stream.
Implements Gnutella::Packets::Packet. |
|
|
Private data with reference counting.
Reimplemented from Gnutella::Packets::Packet. |