Protocols::Generics::DataBase Class Reference

#include <DataBase.h> [code]

Inherited by Protocols::Generics::PacketBase, Protocols::Generics::RawData, and Protocols::Http::HeaderBase.

Inheritance diagram for Protocols::Generics::DataBase:

Inheritance graph
[legend]
List of all members.

Detailed Description

Abstract protocol data exchanged between parties.

Each concrete protocol would derive directly or indirectly its concrete protocol data from DataBase. This enables us to use generic components that only know about Data and DataBase. Data is a Value Object wrapper that allows copying of concrete data objects for which we only know the abstract base class.

Todo:
isEqualTo() is needed by the AbstractValue wrapper. We could implement it in terms of toRawBytes() and thus not require every derived class to implement it.

Definition at line 43 of file DataBase.h.

Public Member Functions

virtual ~DataBase ()
virtual auto_ptr< DataBasecopy () const =0
virtual bool isEqualTo (const DataBase &) const
 Compare the binary representation of Data objects of the same runtime type.
virtual QByteArray toRawBytes () const =0


Constructor & Destructor Documentation

virtual Protocols::Generics::DataBase::~DataBase  )  [inline, virtual]
 

Definition at line 46 of file DataBase.h.


Member Function Documentation

virtual auto_ptr<DataBase> Protocols::Generics::DataBase::copy  )  const [pure virtual]
 

Implemented in Protocols::BitTorrent::Packets::AllowedFast, Protocols::BitTorrent::Packets::BadPacket, Protocols::BitTorrent::Packets::BitField, Protocols::BitTorrent::Packets::Cancel, Protocols::BitTorrent::Packets::Choke, Protocols::BitTorrent::Packets::Have, Protocols::BitTorrent::Packets::HaveAll, Protocols::BitTorrent::Packets::HaveNone, Protocols::BitTorrent::Packets::Interested, Protocols::BitTorrent::Packets::Keepalive, Protocols::BitTorrent::Packets::NotInterested, Protocols::BitTorrent::Packets::PacketBase, Protocols::BitTorrent::Packets::Piece, Protocols::BitTorrent::Packets::Port, Protocols::BitTorrent::Packets::RejectRequest, Protocols::BitTorrent::Packets::Request, Protocols::BitTorrent::Packets::SuggestPiece, Protocols::BitTorrent::Packets::Unchoke, Protocols::Generics::BadPacket, Protocols::Generics::PacketBase, Protocols::Generics::RawData, Protocols::Generics::Testing::PacketStub, Protocols::Gnutella::Packets::PacketBase, Protocols::Gnutella::Packets::Ping, Protocols::Gnutella::Packets::Pong, Protocols::Gnutella::Packets::Push, Protocols::Gnutella::Packets::Query, Protocols::Gnutella::Packets::QueryHits, Protocols::Http::BodyEnd, Protocols::Http::HeaderBase, Protocols::Http::RequestHeader, Protocols::Http::ResponseHeader, Protocols::Kad::Packets::Packet, Protocols::Kad::Packets::PeerInfoPacket< type >, and Protocols::Kad::Packets::TcpPortPacket< type >.

bool DataBase::isEqualTo const DataBase other  )  const [virtual]
 

Compare the binary representation of Data objects of the same runtime type.

Precondition:
this object and the other object must have the same runtime type.

Definition at line 31 of file DataBase.cpp.

virtual QByteArray Protocols::Generics::DataBase::toRawBytes  )  const [pure virtual]
 

Implemented in Protocols::Generics::PacketBase, Protocols::Generics::RawData, and Protocols::Http::HeaderBase.


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