25 #ifndef KRESOLVERWORKERBASE_H
26 #define KRESOLVERWORKERBASE_H
28 #include "kresolver.h"
32 template <
class T>
class TQValueList;
38 class KResolverThread;
60 class KResolverWorkerBase
80 parent->acquireResolver();
88 parent->releaseResolver();
98 parent->releaseResolver();
99 parent->acquireResolver();
104 KResolverWorkerBase* parent;
108 KNetwork::Internal::KResolverThread *th;
109 const KNetwork::Internal::InputData *input;
110 friend class KNetwork::Internal::KResolverThread;
111 friend class KNetwork::Internal::KResolverManager;
129 KResolverWorkerBase();
132 virtual ~KResolverWorkerBase();
137 TQString nodeName()
const;
142 TQString serviceName()
const;
152 int familyMask()
const;
157 int socketType()
const;
162 int protocol()
const;
167 TQCString protocolName()
const;
191 virtual bool run() = 0;
212 virtual bool preprocess() = 0;
222 virtual bool postprocess();
227 inline void setError(
int errorcode,
int syserror = 0)
228 { results.
setError(errorcode, syserror); }
245 bool enqueue(KResolver* other);
250 bool enqueue(KResolverWorkerBase* worker);
259 bool checkResolver();
272 void acquireResolver();
280 void releaseResolver();
289 class KResolverWorkerFactoryBase
293 KResolverWorkerFactoryBase();
296 virtual ~KResolverWorkerFactoryBase();
298 virtual KResolverWorkerBase*
create()
const = 0;
305 static void registerNewWorker(KResolverWorkerFactoryBase* factory);
313 template<
class Worker>
314 class KResolverWorkerFactory:
public KResolverWorkerFactoryBase
317 virtual KResolverWorkerBase*
create()
const
318 {
return new Worker; }
Name and service resolution results.
void setError(int errorcode, int systemerror=0)
Sets the error codes.
Helper class for locking the resolver subsystem.
void openClose()
Releases the lock and then reacquires it.
~ResolverLocker()
Destructor.
ResolverLocker(KResolverWorkerBase *parent)
Constructor.
A namespace to store all networking-related (socket) classes.
TDEAction * create(StdAction id, const char *name, const TQObject *recvr, const char *slot, TDEActionCollection *parent)