/usr/include/dclib-0.3/dclib/cquerymanager.h is in libdc-dev 0.3.24~svn3121-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | /***************************************************************************
cquerymanager.h - description
-------------------
begin : Sat Jun 8 2002
copyright : (C) 2002-2004 by Mathias Küster
email : mathen@users.berlios.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef CQUERYMANAGER_H
#define CQUERYMANAGER_H
/**
*@author Mathias Küster
*
* This processes a queue of searches and sends the results,
* the results come from CFileManager.
*/
#include <dclib/dcos.h>
#include <dclib/core/csocket.h>
#include <dclib/core/csingleton.h>
#include <dclib/core/ccallback.h>
#include <dclib/core/clist.h>
#include <dclib/dcobject.h>
#include <list>
class CQueryObject {
public:
/** */
CQueryObject()
{
pMessageSearch = 0;
};
/** */
~CQueryObject()
{
delete pMessageSearch;
pMessageSearch = 0;
};
/** */
CString sHubName;
/** */
CString sHubHost;
/** */
CString sNick;
/** */
CMessageSearchFile * pMessageSearch;
/** */
time_t tTimeout;
};
class CQuerySendObject {
public:
/** */
CQuerySendObject() {
m_pSocket = 0;
m_pList = new std::list<CString>();
m_nPort = 0;
}
/** */
~CQuerySendObject() {
delete m_pSocket;
m_pSocket = 0;
delete m_pList;
m_pList = 0;
}
/** */
CSocket * m_pSocket;
/** */
std::list<CString> * m_pList;
/** */
CString m_sSource;
/** */
int m_nPort;
};
class CMutex;
class CCaseFolder;
enum eSearchStat {
essCOUNTACTIVE=0,
essCOUNTPASSIVE,
essCOUNTREJECT,
essCOUNTERROR,
essRESULTCOUNT,
essRESULTCOUNTERROR
};
class CQueryManager : public CSingleton<CQueryManager> {
public:
/** */
CQueryManager();
/** */
virtual ~CQueryManager();
/* */
bool SearchQuery( CString hubname, CString hubhost, CString nick, CMessageSearchFile * msg );
/** */
ulonglong GetStat( enum eSearchStat e );
private:
/** callbackfunction - called by CManager */
int Callback();
/** */
void HandleQuery( CQueryObject * queryobject );
/** */
bool CheckSize( CQueryObject * queryobject, struct filebaseobject * fbo );
/** */
bool CheckType( CQueryObject * queryobject, struct filebaseobject * fbo );
/** */
bool AddResult( CQuerySendObject * querysendobject, CQueryObject * queryobject,
struct filebaseobject * fbo, CString filename, CString hash = CString() );
/** */
void SendResults();
/** */
_CCallback0 * m_pCallback;
/**
* Mutex for query queue.
* Send list was never locked/unlocked.
*/
CMutex * m_pQueueMutex;
/** the search queue */
CList<CQueryObject> * m_pQueryQueue;
/** */
CList<CQuerySendObject> * m_pQuerySendList;
/** */
ulonglong m_nSearchCountActive;
/** */
ulonglong m_nSearchCountPassive;
/** */
ulonglong m_nSearchCountReject;
/** */
ulonglong m_nSearchCountError;
/** */
ulonglong m_nResultCount;
/** */
ulonglong m_nResultCountError;
/** Avoid constant iconv_open / iconv_close */
CCaseFolder * m_pCaseFolder;
};
#endif
|