23 #ifndef KDSOAPCLIENTTHREAD_P_H
24 #define KDSOAPCLIENTTHREAD_P_H
26 #include "KDSoapMessage.h"
27 #include "KDSoapAuthentication.h"
28 #include <QtCore/QWaitCondition>
29 #include <QtCore/QQueue>
30 #include <QtCore/QThread>
31 #include <QtCore/QMutex>
32 #include <QtCore/QSemaphore>
33 #include <QtNetwork/QNetworkAccessManager>
41 class KDSoapThreadTaskData
45 : m_iface(iface), m_method(method), m_message(message), m_action(action), m_headers(headers) {}
47 void waitForCompletion() { m_semaphore.acquire(); }
49 KDSoapHeaders responseHeaders()
const {
return m_responseHeaders; }
56 QSemaphore m_semaphore;
62 class KDSoapThreadTask :
public QObject
66 KDSoapThreadTask(KDSoapThreadTaskData* data)
69 void process(QNetworkAccessManager& accessManager);
76 void slotAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator);
79 KDSoapThreadTaskData* m_data;
82 class KDSoapClientThread :
public QThread
86 explicit KDSoapClientThread(QObject *parent = 0);
88 void enqueue(KDSoapThreadTaskData* taskData);
97 QQueue<KDSoapThreadTaskData*> m_queue;
98 QWaitCondition m_queueNotEmpty;
102 #endif // KDSOAPCLIENTTHREAD_P_H