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

CManagedSearch Class Reference

#include <ManagedSearch.h>

List of all members.

Public Types

enum  { spHighest, spMedium, spLowest, spMax }

Public Member Functions

 CManagedSearch (CQuerySearch *pSearch=NULL, int nPriority=0)
virtual ~CManagedSearch ()
void Serialize (CArchive &ar)
void Start ()
void Stop ()
BOOL Execute ()
void OnHostAcknowledge (DWORD nAddress)
BOOL IsLastED2KSearch ()
CQuerySearchGetSearch () const
BOOL IsActive () const
int GetPriority () const
void SetPriority (int nPriority)

Public Attributes

CQuerySearchm_pSearch
int m_nPriority
BOOL m_bAllowG2
BOOL m_bAllowG1
BOOL m_bAllowED2K
BOOL m_bActive
BOOL m_bReceive
DWORD m_tStarted
DWORD m_nHits
DWORD m_nHubs
DWORD m_nLeaves
DWORD m_nQueryCount
DWORD m_tLastG2
DWORD m_tLastED2K
DWORD m_tMoreResults
DWORD m_nEDServers
DWORD m_nEDClients

Protected Member Functions

BOOL ExecuteNeighbours (DWORD tTicks, DWORD tSecs)
BOOL ExecuteG2Mesh (DWORD tTicks, DWORD tSecs)
BOOL ExecuteDonkeyMesh (DWORD tTicks, DWORD tSecs)

Protected Attributes

CMapPtrToPtr m_pNodes
DWORD m_tExecute


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
spHighest 
spMedium 
spLowest 
spMax 

Definition at line 39 of file ManagedSearch.h.


Constructor & Destructor Documentation

CManagedSearch::CManagedSearch CQuerySearch pSearch = NULL,
int  nPriority = 0
 

Definition at line 49 of file ManagedSearch.cpp.

References m_bActive, m_bAllowED2K, m_bAllowG1, m_bAllowG2, m_bReceive, m_nEDClients, m_nEDServers, m_nHits, m_nHubs, m_nLeaves, m_nPriority, m_nQueryCount, m_pSearch, m_tLastED2K, m_tLastG2, m_tMoreResults, and m_tStarted.

CManagedSearch::~CManagedSearch  )  [virtual]
 

Definition at line 74 of file ManagedSearch.cpp.

References m_pSearch, and Stop().


Member Function Documentation

BOOL CManagedSearch::Execute  ) 
 

Definition at line 161 of file ManagedSearch.cpp.

References CSettings::eDonkey, CSettings::seDonkey::EnableToday, CSettings::sGnutella2::EnableToday, ExecuteDonkeyMesh(), ExecuteG2Mesh(), ExecuteNeighbours(), CSettings::sSearch::GeneralThrottle, CSettings::Gnutella2, IsLastED2KSearch(), CNetwork::IsListening(), m_bActive, m_bAllowED2K, m_bAllowG2, CQuerySearch::m_bED2K, m_nPriority, m_nQueryCount, m_pSearch, m_tExecute, m_tLastED2K, m_tLastG2, Network, NULL, CSettings::seDonkey::QueryGlobalThrottle, CSettings::sGnutella2::QueryGlobalThrottle, CSettings::Search, CSettings::seDonkey::ServerWalk, Settings, spLowest, and spMedium.

Referenced by CSearchManager::OnRun().

BOOL CManagedSearch::ExecuteDonkeyMesh DWORD  tTicks,
DWORD  tSecs
[protected]
 

Definition at line 588 of file ManagedSearch.cpp.

References Datagrams, CHostCache::eDonkey, CNeighboursBase::Get(), CHostCacheList::GetNewest(), HostCache, m_nEDClients, m_nEDServers, m_pNodes, m_pSearch, CShareazaApp::Message(), MSG_DEBUG, Neighbours, NULL, PROTOCOL_ED2K, CDatagrams::Send(), theApp, and CQuerySearch::ToEDPacket().

Referenced by Execute().

BOOL CManagedSearch::ExecuteG2Mesh DWORD  tTicks,
DWORD  tSecs
[protected]
 

Definition at line 376 of file ManagedSearch.cpp.

References Datagrams, CSettings::sGnutella1::EnableToday, G2_PACKET_QUERY_KEY_REQ, CNeighboursBase::Get(), CNeighboursBase::GetIterator(), CHostCacheList::GetNewest(), CNeighboursBase::GetNext(), CSettings::Gnutella1, CSettings::Gnutella2, CHostCache::Gnutella2, HostCache, CDatagrams::IsStable(), m_bAllowG1, CQuerySearch::m_bAndG1, CQuerySearch::m_bSHA1, CNeighbour::m_nNodeType, m_nPriority, CNeighbour::m_nProtocol, CConnection::m_pHost, CNetwork::m_pHost, m_pNodes, m_pSearch, CShareazaApp::Message(), MSG_DEBUG, Neighbours, Network, CG2Packet::New(), ntHub, NULL, PROTOCOL_G2, CSettings::sGnutella2::QueryHostThrottle, CSettings::sGnutella2::RequeryDelay, CNeighbour::Send(), CDatagrams::Send(), Settings, spLowest, theApp, CQuerySearch::ToG2Packet(), CPacket::WriteLongLE(), CG2Packet::WritePacket(), and CPacket::WriteShortBE().

Referenced by Execute().

BOOL CManagedSearch::ExecuteNeighbours DWORD  tTicks,
DWORD  tSecs
[protected]
 

Definition at line 210 of file ManagedSearch.cpp.

References Datagrams, ED2K_C2S_MORERESULTS, CSettings::sGnutella1::EnableToday, CNeighboursBase::GetIterator(), CNeighboursBase::GetNext(), CSettings::Gnutella1, CSettings::Gnutella2, IDS_NETWORK_SEARCH_SENT, CDatagrams::IsStable(), m_bAllowED2K, m_bAllowG1, m_bAllowG2, CQuerySearch::m_bAndG1, CQuerySearch::m_bED2K, m_nEDClients, m_nEDServers, m_nPriority, CNeighbour::m_nProtocol, CNeighbour::m_nState, CQuerySearch::m_pGUID, CNetwork::m_pHost, CConnection::m_pHost, CSearchManager::m_pLastED2KSearch, CNeighbour::m_pMoreResultsGUID, m_pNodes, m_pSearch, CQuerySearch::m_sSearch, CConnection::m_tConnected, CNeighbour::m_tLastQuery, m_tMoreResults, m_tStarted, CShareazaApp::Message(), MSG_DEBUG, MSG_DEFAULT, Neighbours, Network, CEDPacket::New(), nrsConnected, NULL, PROTOCOL_ED2K, PROTOCOL_G1, PROTOCOL_G2, CSettings::sGnutella2::QueryHostThrottle, CSettings::sGnutella1::QueryThrottle, CPacket::Release(), CSettings::sGnutella2::RequeryDelay, CSettings::sGnutella1::RequeryDelay, SearchManager, CNeighbour::Send(), CNeighbour::SendQuery(), Settings, theApp, CQuerySearch::ToEDPacket(), CQuerySearch::ToG1Packet(), and CQuerySearch::ToG2Packet().

Referenced by Execute().

int CManagedSearch::GetPriority  )  const [inline]
 

Definition at line 84 of file ManagedSearch.h.

References m_nPriority.

CQuerySearch* CManagedSearch::GetSearch  )  const [inline]
 

Definition at line 82 of file ManagedSearch.h.

References m_pSearch.

BOOL CManagedSearch::IsActive  )  const [inline]
 

Definition at line 83 of file ManagedSearch.h.

References m_bActive.

BOOL CManagedSearch::IsLastED2KSearch  ) 
 

Definition at line 667 of file ManagedSearch.cpp.

References CQuerySearch::m_pGUID, CSearchManager::m_pLastED2KSearch, m_pSearch, and SearchManager.

Referenced by Execute(), and CSearchWnd::OnQueryHits().

void CManagedSearch::OnHostAcknowledge DWORD  nAddress  ) 
 

Definition at line 658 of file ManagedSearch.cpp.

References m_pNodes, and NULL.

Referenced by CSearchManager::OnQueryHits().

void CManagedSearch::Serialize CArchive &  ar  ) 
 

Definition at line 83 of file ManagedSearch.cpp.

References m_bActive, m_bAllowED2K, m_bAllowG1, m_bAllowG2, m_bReceive, m_nPriority, m_pSearch, and CQuerySearch::Serialize().

Referenced by CSearchWnd::Serialize().

void CManagedSearch::SetPriority int  nPriority  )  [inline]
 

Definition at line 85 of file ManagedSearch.h.

References m_nPriority.

void CManagedSearch::Start  ) 
 

Definition at line 126 of file ManagedSearch.cpp.

References CSearchManager::Add(), m_bActive, m_nQueryCount, m_pNodes, CSearchManager::m_pSection, m_tExecute, m_tLastED2K, m_tMoreResults, m_tStarted, NULL, and SearchManager.

Referenced by CSearchWnd::ExecuteSearch(), CDownloadWithSearch::StartAutomaticSearch(), and CDownloadWithSearch::StartManualSearch().

void CManagedSearch::Stop  ) 
 

Definition at line 145 of file ManagedSearch.cpp.

References Datagrams, m_bActive, CSearchManager::m_pSection, CDatagrams::PurgeToken(), CSearchManager::Remove(), and SearchManager.

Referenced by CSearchWnd::ExecuteSearch(), CDownloadWithSearch::FindMoreSources(), CSearchWnd::OnSearchSearch(), CSearchWnd::OnSearchStop(), CDownloadWithSearch::StopSearch(), and ~CManagedSearch().


Member Data Documentation

BOOL CManagedSearch::m_bActive
 

Definition at line 49 of file ManagedSearch.h.

Referenced by CManagedSearch(), Execute(), IsActive(), CSearchWnd::OnQueryHits(), CSearchWnd::OnSearchSearch(), CSearchWnd::OnTimer(), Serialize(), Start(), and Stop().

BOOL CManagedSearch::m_bAllowED2K
 

Definition at line 47 of file ManagedSearch.h.

Referenced by CManagedSearch(), Execute(), ExecuteNeighbours(), CSearchPanel::GetSearch(), CDownloadWithSearch::PrepareSearch(), Serialize(), and CSearchPanel::ShowSearch().

BOOL CManagedSearch::m_bAllowG1
 

Definition at line 46 of file ManagedSearch.h.

Referenced by CManagedSearch(), ExecuteG2Mesh(), ExecuteNeighbours(), CSearchPanel::GetSearch(), Serialize(), and CSearchPanel::ShowSearch().

BOOL CManagedSearch::m_bAllowG2
 

Definition at line 45 of file ManagedSearch.h.

Referenced by CManagedSearch(), Execute(), ExecuteNeighbours(), CSearchPanel::GetSearch(), CSearchWnd::OnQueryHits(), Serialize(), and CSearchPanel::ShowSearch().

BOOL CManagedSearch::m_bReceive
 

Definition at line 50 of file ManagedSearch.h.

Referenced by CManagedSearch(), CSearchWnd::OnQueryHits(), CSearchWnd::OnSearchStop(), and Serialize().

DWORD CManagedSearch::m_nEDClients
 

Definition at line 61 of file ManagedSearch.h.

Referenced by CManagedSearch(), ExecuteDonkeyMesh(), and ExecuteNeighbours().

DWORD CManagedSearch::m_nEDServers
 

Definition at line 60 of file ManagedSearch.h.

Referenced by CManagedSearch(), ExecuteDonkeyMesh(), and ExecuteNeighbours().

DWORD CManagedSearch::m_nHits
 

Definition at line 53 of file ManagedSearch.h.

Referenced by CManagedSearch(), CSearchManager::OnQueryHits(), CSearchManager::OnQueryStatusRequest(), and CSearchWnd::UpdateMessages().

DWORD CManagedSearch::m_nHubs
 

Definition at line 54 of file ManagedSearch.h.

Referenced by CManagedSearch(), and CSearchWnd::UpdateMessages().

DWORD CManagedSearch::m_nLeaves
 

Definition at line 55 of file ManagedSearch.h.

Referenced by CManagedSearch(), and CSearchWnd::UpdateMessages().

int CManagedSearch::m_nPriority
 

Definition at line 44 of file ManagedSearch.h.

Referenced by CManagedSearch(), Execute(), ExecuteG2Mesh(), ExecuteNeighbours(), GetPriority(), CSearchManager::OnRun(), CSearchWnd::OnSearchSearch(), Serialize(), SetPriority(), CDownloadWithSearch::StartAutomaticSearch(), and CDownloadWithSearch::StartManualSearch().

DWORD CManagedSearch::m_nQueryCount
 

Definition at line 56 of file ManagedSearch.h.

Referenced by CManagedSearch(), Execute(), CSearchWnd::ExecuteSearch(), CSearchWnd::OnSearchSearch(), CSearchWnd::OnTimer(), and Start().

CMapPtrToPtr CManagedSearch::m_pNodes [protected]
 

Definition at line 63 of file ManagedSearch.h.

Referenced by ExecuteDonkeyMesh(), ExecuteG2Mesh(), ExecuteNeighbours(), OnHostAcknowledge(), and Start().

CQuerySearch* CManagedSearch::m_pSearch
 

Definition at line 43 of file ManagedSearch.h.

Referenced by CManagedSearch(), Execute(), ExecuteDonkeyMesh(), ExecuteG2Mesh(), ExecuteNeighbours(), CSearchWnd::ExecuteSearch(), CSearchManager::Find(), CSearchWnd::GetLastSearch(), GetSearch(), CSearchPanel::GetSearch(), IsLastED2KSearch(), CSearchWnd::OnQueryHits(), CSearchWnd::OnSearchSearch(), CDownloadWithSearch::PrepareSearch(), Serialize(), CSearchPanel::ShowSearch(), CSearchWnd::UpdateMessages(), and ~CManagedSearch().

DWORD CManagedSearch::m_tExecute [protected]
 

Definition at line 64 of file ManagedSearch.h.

Referenced by Execute(), and Start().

DWORD CManagedSearch::m_tLastED2K
 

Definition at line 58 of file ManagedSearch.h.

Referenced by CManagedSearch(), Execute(), CSearchWnd::OnQueryHits(), CSearchWnd::OnSearchSearch(), and Start().

DWORD CManagedSearch::m_tLastG2
 

Definition at line 57 of file ManagedSearch.h.

Referenced by CManagedSearch(), and Execute().

DWORD CManagedSearch::m_tMoreResults
 

Definition at line 59 of file ManagedSearch.h.

Referenced by CManagedSearch(), ExecuteNeighbours(), CSearchWnd::OnSearchSearch(), and Start().

DWORD CManagedSearch::m_tStarted
 

Definition at line 52 of file ManagedSearch.h.

Referenced by CManagedSearch(), ExecuteNeighbours(), and Start().


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