Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CQueryHashTable Class Reference

#include <QueryHashTable.h>

Inheritance diagram for CQueryHashTable:

CQueryHashMaster List of all members.

Public Member Functions

 CQueryHashTable ()
virtual ~CQueryHashTable ()
void Create ()
void Clear ()
BOOL Merge (CQueryHashTable *pSource)
BOOL Merge (CQueryHashGroup *pSource)
BOOL PatchTo (CQueryHashTable *pTarget, CNeighbour *pNeighbour)
BOOL OnPacket (CPacket *pPacket)
int AddPhrase (LPCTSTR pszPhrase)
int AddString (LPCTSTR pszString)
BOOL CheckPhrase (LPCTSTR pszSearch)
BOOL CheckString (LPCTSTR pszString)
BOOL Check (CQuerySearch *pSearch)
int GetPercent ()

Public Attributes

BOOL m_bLive
DWORD m_nCookie
BYTE * m_pHash
DWORD m_nHash
DWORD m_nBits
DWORD m_nInfinity
DWORD m_nCount
CBufferm_pBuffer
CQueryHashGroupm_pGroup

Protected Member Functions

BOOL OnReset (CPacket *pPacket)
BOOL OnPatch (CPacket *pPacket)
int Add (LPCTSTR pszString, int nStart, int nLength)
BOOL PatchToOldShareaza (CQueryHashTable *pTarget, CNeighbour *pNeighbour)

Static Protected Member Functions

static DWORD HashWord (LPCTSTR pszString, int nStart, int nLength, int nBits)
static DWORD HashNumber (DWORD nNumber, int nBits)

Constructor & Destructor Documentation

CQueryHashTable::CQueryHashTable  ) 
 

Definition at line 49 of file QueryHashTable.cpp.

References m_bLive, m_nBits, m_nCookie, m_nCount, m_nHash, m_nInfinity, m_pBuffer, m_pGroup, m_pHash, and NULL.

CQueryHashTable::~CQueryHashTable  )  [virtual]
 

Definition at line 62 of file QueryHashTable.cpp.

References m_pBuffer, m_pGroup, m_pHash, QueryHashMaster, and CQueryHashMaster::Remove().


Member Function Documentation

int CQueryHashTable::Add LPCTSTR  pszString,
int  nStart,
int  nLength
[protected]
 

Definition at line 861 of file QueryHashTable.cpp.

References HashWord(), IsWord(), m_nBits, m_nCookie, m_nCount, and m_pHash.

Referenced by AddPhrase(), and AddString().

int CQueryHashTable::AddPhrase LPCTSTR  pszPhrase  ) 
 

Definition at line 826 of file QueryHashTable.cpp.

References Add(), IsCharacter(), m_pHash, and NULL.

int CQueryHashTable::AddString LPCTSTR  pszString  ) 
 

Definition at line 855 of file QueryHashTable.cpp.

References Add(), m_pHash, and NULL.

Referenced by CLibraryDictionary::Add(), CQueryHashMaster::Build(), CLibraryDictionary::BuildHashTable(), and CLibraryDictionary::ProcessWord().

BOOL CQueryHashTable::Check CQuerySearch pSearch  ) 
 

Definition at line 969 of file QueryHashTable.cpp.

References CheckString(), CED2K::HashToString(), CSHA::HashToString(), HashWord(), CQuerySearch::m_bBTH, CQuerySearch::m_bED2K, m_bLive, CQuerySearch::m_bSHA1, m_nBits, CQuerySearch::m_nWords, CQuerySearch::m_pBTH, CQuerySearch::m_pED2K, m_pHash, CQuerySearch::m_pSHA1, CQuerySearch::m_pWordLen, CQuerySearch::m_pWordPtr, and NULL.

Referenced by CLibraryDictionary::Search(), CG2Neighbour::SendQuery(), and CG1Neighbour::SendQuery().

BOOL CQueryHashTable::CheckPhrase LPCTSTR  pszSearch  ) 
 

Definition at line 908 of file QueryHashTable.cpp.

References HashWord(), IsCharacter(), IsWord(), m_bLive, m_nBits, m_pHash, and NULL.

BOOL CQueryHashTable::CheckString LPCTSTR  pszString  ) 
 

Definition at line 955 of file QueryHashTable.cpp.

References HashWord(), m_bLive, m_nBits, m_pHash, and NULL.

Referenced by Check().

void CQueryHashTable::Clear  ) 
 

Definition at line 94 of file QueryHashTable.cpp.

References CQueryHashMaster::Add(), m_nCookie, m_nCount, m_nHash, m_pGroup, m_pHash, NULL, QueryHashMaster, and CQueryHashMaster::Remove().

Referenced by CQueryHashMaster::Build(), CLibraryDictionary::BuildHashTable(), and CLibraryDictionary::Clear().

void CQueryHashTable::Create  ) 
 

Reimplemented in CQueryHashMaster.

Definition at line 72 of file QueryHashTable.cpp.

References CQueryHashMaster::Add(), CSettings::Library, m_bLive, m_nBits, m_nCookie, m_nCount, m_nHash, m_pGroup, NULL, QueryHashMaster, CSettings::sLibrary::QueryRouteSize, CQueryHashMaster::Remove(), and Settings.

Referenced by CLibraryDictionary::BuildHashTable(), and CQueryHashMaster::Create().

int CQueryHashTable::GetPercent  ) 
 

Definition at line 1044 of file QueryHashTable.cpp.

References m_nCount, m_nHash, and m_pHash.

Referenced by CNeighbour::OnCommonQueryHash(), and CNeighbour::OnRun().

DWORD CQueryHashTable::HashNumber DWORD  nNumber,
int  nBits
[inline, static, protected]
 

Definition at line 1033 of file QueryHashTable.cpp.

Referenced by HashWord().

DWORD CQueryHashTable::HashWord LPCTSTR  pszString,
int  nStart,
int  nLength,
int  nBits
[inline, static, protected]
 

Definition at line 1013 of file QueryHashTable.cpp.

References HashNumber().

Referenced by Add(), Check(), CheckPhrase(), and CheckString().

BOOL CQueryHashTable::Merge CQueryHashGroup pSource  ) 
 

Definition at line 209 of file QueryHashTable.cpp.

References DO_MERGE, m_nCookie, m_nCount, CQueryHashGroup::m_nHash, m_nHash, CQueryHashGroup::m_pHash, m_pHash, and NULL.

BOOL CQueryHashTable::Merge CQueryHashTable pSource  ) 
 

Definition at line 112 of file QueryHashTable.cpp.

References DO_MERGE, m_nCookie, m_nCount, m_nHash, m_pHash, and NULL.

Referenced by CQueryHashMaster::Build().

BOOL CQueryHashTable::OnPacket CPacket pPacket  ) 
 

Definition at line 571 of file QueryHashTable.cpp.

References CG2Packet::m_bCompound, CG1Packet::m_nHops, CPacket::m_nLength, CG1Packet::m_nTTL, OnPatch(), OnReset(), PROTOCOL_G1, and CG2Packet::SkipCompound().

Referenced by CNeighbour::OnCommonQueryHash().

BOOL CQueryHashTable::OnPatch CPacket pPacket  )  [protected]
 

Definition at line 655 of file QueryHashTable.cpp.

References CBuffer::Add(), CBuffer::Clear(), CBuffer::Inflate(), CQueryHashMaster::Invalidate(), m_bLive, m_nCookie, CQueryHashGroup::m_nCount, m_nCount, CQueryHashGroup::m_nHash, m_nHash, CBuffer::m_nLength, CPacket::m_nLength, CPacket::m_nPosition, CBuffer::m_pBuffer, CPacket::m_pBuffer, m_pBuffer, m_pGroup, CQueryHashGroup::m_pHash, m_pHash, NULL, QueryHashMaster, and CPacket::ReadByte().

Referenced by OnPacket().

BOOL CQueryHashTable::OnReset CPacket pPacket  )  [protected]
 

Definition at line 605 of file QueryHashTable.cpp.

References CQueryHashMaster::Add(), CBuffer::Clear(), m_bLive, m_nBits, m_nCookie, m_nCount, m_nHash, m_nInfinity, CPacket::m_nLength, CPacket::m_nProtocol, m_pBuffer, m_pGroup, m_pHash, NULL, PROTOCOL_G1, QueryHashMaster, CPacket::ReadByte(), CPacket::ReadLongBE(), CPacket::ReadLongLE(), and CQueryHashMaster::Remove().

Referenced by OnPacket().

BOOL CQueryHashTable::PatchTo CQueryHashTable pTarget,
CNeighbour pNeighbour
 

Definition at line 296 of file QueryHashTable.cpp.

References CZLib::Compress(), G1_PACKET_QUERY_ROUTE, G2_PACKET_QHT, m_bLive, m_nBits, m_nCookie, m_nCount, m_nHash, CNeighbour::m_nProtocol, m_pHash, CConnection::m_sUserAgent, CG2Packet::New(), CG1Packet::New(), NULL, PatchToOldShareaza(), PROTOCOL_G1, PROTOCOL_G2, CNeighbour::Send(), CPacket::Write(), CPacket::WriteByte(), CPacket::WriteLongBE(), and CPacket::WriteLongLE().

Referenced by CNeighbour::OnRun().

BOOL CQueryHashTable::PatchToOldShareaza CQueryHashTable pTarget,
CNeighbour pNeighbour
[protected]
 

Definition at line 513 of file QueryHashTable.cpp.

References G1_PACKET_QUERY_ROUTE, m_bLive, m_nHash, m_pHash, CG1Packet::New(), CNeighbour::Send(), CPacket::WriteByte(), and CPacket::WriteZLib().

Referenced by PatchTo().


Member Data Documentation

BOOL CQueryHashTable::m_bLive
 

Definition at line 44 of file QueryHashTable.h.

Referenced by CQueryHashMaster::Build(), Check(), CheckPhrase(), CheckString(), CQueryHashTable(), Create(), CQueryHashMaster::Create(), CNeighbour::OnCommonQueryHash(), OnPatch(), OnReset(), CNeighbour::OnRun(), PatchTo(), PatchToOldShareaza(), CG2Neighbour::SendQuery(), and CG1Neighbour::SendQuery().

DWORD CQueryHashTable::m_nBits
 

Definition at line 49 of file QueryHashTable.h.

Referenced by Add(), Check(), CheckPhrase(), CheckString(), CQueryHashTable(), Create(), CNeighbour::OnCommonQueryHash(), OnReset(), CNeighbour::OnRun(), and PatchTo().

DWORD CQueryHashTable::m_nCookie
 

Definition at line 45 of file QueryHashTable.h.

Referenced by Add(), CQueryHashMaster::Build(), Clear(), CQueryHashTable(), Create(), CQueryHashMaster::Create(), Merge(), OnPatch(), OnReset(), CNeighbour::OnRun(), and PatchTo().

DWORD CQueryHashTable::m_nCount
 

Definition at line 51 of file QueryHashTable.h.

Referenced by Add(), Clear(), CQueryHashTable(), Create(), GetPercent(), Merge(), OnPatch(), OnReset(), and PatchTo().

DWORD CQueryHashTable::m_nHash
 

Definition at line 48 of file QueryHashTable.h.

Referenced by CQueryHashMaster::Add(), Clear(), CQueryHashTable(), Create(), GetPercent(), Merge(), CNeighbour::OnCommonQueryHash(), OnPatch(), OnReset(), CNeighbour::OnRun(), CQueryHashGroup::Operate(), PatchTo(), and PatchToOldShareaza().

DWORD CQueryHashTable::m_nInfinity
 

Definition at line 50 of file QueryHashTable.h.

Referenced by CQueryHashTable(), CNeighbour::OnCommonQueryHash(), OnReset(), and CNeighbour::OnRun().

CBuffer* CQueryHashTable::m_pBuffer
 

Definition at line 52 of file QueryHashTable.h.

Referenced by CQueryHashTable(), OnPatch(), OnReset(), and ~CQueryHashTable().

CQueryHashGroup* CQueryHashTable::m_pGroup
 

Definition at line 54 of file QueryHashTable.h.

Referenced by CQueryHashMaster::Add(), CQueryHashGroup::Add(), Clear(), CQueryHashTable(), Create(), CNeighbour::OnCommonQueryHash(), OnPatch(), OnReset(), CQueryHashGroup::Remove(), and ~CQueryHashTable().

BYTE* CQueryHashTable::m_pHash
 

Definition at line 47 of file QueryHashTable.h.

Referenced by Add(), AddPhrase(), AddString(), Check(), CheckPhrase(), CheckString(), Clear(), CQueryHashTable(), GetPercent(), Merge(), OnPatch(), OnReset(), CQueryHashGroup::Operate(), PatchTo(), PatchToOldShareaza(), and ~CQueryHashTable().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:10 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2