ED2KPacket::AnswerSources Class Reference

AnswerSources packet is the expected answer to SourceExchReq packet, and contains the list of sources corresponding to a file hash. More...

#include <packets.h>

Inheritance diagram for ED2KPacket::AnswerSources:

ED2KPacket::Packet List of all members.

Public Types

typedef boost::tuple< uint32_t,
uint16_t, uint32_t, uint16_t > 
Source
typedef std::vector< SourceSourceList
typedef SourceList::const_iterator CIter

Public Member Functions

 AnswerSources (const Hash< ED2KHash > &hash, const SourceList &srcs)
 AnswerSources (std::istringstream &i)
 operator std::string ()
Hash< ED2KHash > getHash () const
CIter begin () const
CIter end () const
size_t size () const
void setSwapIds (bool swap)
 If set to true, all client-ids are swapped before sending.

Private Attributes

Hash< ED2KHash > m_hash
SourceList m_srcList
bool m_swapIds

Detailed Description

AnswerSources packet is the expected answer to SourceExchReq packet, and contains the list of sources corresponding to a file hash.

As a general rule, no more than 500 sources are sent, and other limitations may be present, depending on client.

Definition at line 878 of file packets.h.


Member Typedef Documentation

typedef boost::tuple<uint32_t, uint16_t, uint32_t, uint16_t> ED2KPacket::AnswerSources::Source
 

Definition at line 880 of file packets.h.

typedef std::vector<Source> ED2KPacket::AnswerSources::SourceList
 

Definition at line 881 of file packets.h.

typedef SourceList::const_iterator ED2KPacket::AnswerSources::CIter
 

Definition at line 882 of file packets.h.


Constructor & Destructor Documentation

ED2KPacket::AnswerSources::AnswerSources const Hash< ED2KHash > &  hash,
const SourceList srcs
 

Definition at line 1128 of file packets.cpp.

References m_hash, and PR_EMULE.

ED2KPacket::AnswerSources::AnswerSources std::istringstream &  i  ) 
 

Definition at line 1132 of file packets.cpp.

References m_hash, and m_srcList.


Member Function Documentation

ED2KPacket::AnswerSources::operator std::string  ) 
 

Definition at line 1164 of file packets.cpp.

References begin(), end(), m_srcList, m_swapIds, ED2KPacket::Packet::makePacket(), and OP_ANSWERSOURCES.

Hash<ED2KHash> ED2KPacket::AnswerSources::getHash  )  const [inline]
 

Definition at line 888 of file packets.h.

References m_hash.

CIter ED2KPacket::AnswerSources::begin  )  const [inline]
 

Definition at line 889 of file packets.h.

References m_srcList.

Referenced by operator std::string().

CIter ED2KPacket::AnswerSources::end  )  const [inline]
 

Definition at line 890 of file packets.h.

References m_srcList.

Referenced by operator std::string().

size_t ED2KPacket::AnswerSources::size  )  const [inline]
 

Definition at line 891 of file packets.h.

References m_srcList.

void ED2KPacket::AnswerSources::setSwapIds bool  swap  )  [inline]
 

If set to true, all client-ids are swapped before sending.

Definition at line 896 of file packets.h.

References m_swapIds.


Member Data Documentation

Hash<ED2KHash> ED2KPacket::AnswerSources::m_hash [private]
 

Definition at line 898 of file packets.h.

Referenced by AnswerSources(), and getHash().

SourceList ED2KPacket::AnswerSources::m_srcList [private]
 

Definition at line 899 of file packets.h.

Referenced by AnswerSources(), begin(), end(), operator std::string(), and size().

bool ED2KPacket::AnswerSources::m_swapIds [private]
 

Definition at line 900 of file packets.h.

Referenced by operator std::string(), and setSwapIds().


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