Gnutella::Packets::Extensions::GgepBlock Class Reference

#include <GgepBlock.h> [code]

Inherits Gnutella::Packets::Extensions::Extension.

Inheritance diagram for Gnutella::Packets::Extensions::GgepBlock:

Inheritance graph
[legend]
Collaboration diagram for Gnutella::Packets::Extensions::GgepBlock:

Collaboration graph
[legend]
List of all members.

Detailed Description

Todo:
Make copying an object chap by using reference counting. See Qt for reference.

Definition at line 40 of file GgepBlock.h.

Public Types

typedef QList< const Ggep * > Extensions

Public Member Functions

 GgepBlock ()
 GgepBlock (const GgepBlock &block)
GgepBlockcopy () const
 ~GgepBlock ()
GgepBlockoperator= (const GgepBlock &block)
int prepareRead (const QByteArray &rawData)
void read (QDataStream &stream)
int prepareWrite () const
void write (QDataStream &stream) const
void addExtension (const Ggep &extension)
 Adds a copy of the GGEP extension to the block.
Extensions extensions () const
 Gets all the contained GGEP extensions.

Static Public Attributes

static const char MagicByte = char(0xC3)

Private Member Functions

void deleteExtensions ()

Private Attributes

Extensions extensions_
int rawBlockLength_
 Stores the size of a raw block. If isValid() is false, read() reads this number of bytes.


Member Typedef Documentation

typedef QList<const Ggep *> Gnutella::Packets::Extensions::GgepBlock::Extensions
 

Definition at line 43 of file GgepBlock.h.


Constructor & Destructor Documentation

GgepBlock::GgepBlock  ) 
 

Definition at line 29 of file GgepBlock.cpp.

GgepBlock::GgepBlock const GgepBlock block  ) 
 

Definition at line 35 of file GgepBlock.cpp.

GgepBlock::~GgepBlock  ) 
 

Definition at line 62 of file GgepBlock.cpp.


Member Function Documentation

void GgepBlock::addExtension const Ggep extension  ) 
 

Adds a copy of the GGEP extension to the block.

Definition at line 200 of file GgepBlock.cpp.

GgepBlock * GgepBlock::copy  )  const [virtual]
 

Implements Gnutella::Packets::Extensions::Extension.

Definition at line 42 of file GgepBlock.cpp.

void GgepBlock::deleteExtensions  )  [private]
 

Definition at line 67 of file GgepBlock.cpp.

GgepBlock::Extensions GgepBlock::extensions  )  const
 

Gets all the contained GGEP extensions.

Definition at line 212 of file GgepBlock.cpp.

GgepBlock & GgepBlock::operator= const GgepBlock block  ) 
 

Definition at line 47 of file GgepBlock.cpp.

int GgepBlock::prepareRead const QByteArray &  rawData  )  [virtual]
 

Implements Gnutella::Packets::Extensions::Extension.

Definition at line 74 of file GgepBlock.cpp.

int GgepBlock::prepareWrite  )  const [virtual]
 

Implements Gnutella::Packets::Extensions::Extension.

Definition at line 175 of file GgepBlock.cpp.

void GgepBlock::read QDataStream &  stream  )  [virtual]
 

Implements Gnutella::Packets::Extensions::Extension.

Definition at line 142 of file GgepBlock.cpp.

void GgepBlock::write QDataStream &  stream  )  const [virtual]
 

Implements Gnutella::Packets::Extensions::Extension.

Definition at line 188 of file GgepBlock.cpp.


Member Data Documentation

Extensions Gnutella::Packets::Extensions::GgepBlock::extensions_ [private]
 

Definition at line 64 of file GgepBlock.h.

const char Gnutella::Packets::Extensions::GgepBlock::MagicByte = char(0xC3) [static]
 

Definition at line 45 of file GgepBlock.h.

int Gnutella::Packets::Extensions::GgepBlock::rawBlockLength_ [private]
 

Stores the size of a raw block. If isValid() is false, read() reads this number of bytes.

Definition at line 65 of file GgepBlock.h.


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