You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
929 B
42 lines
929 B
#ifndef __CURLREQUESTSMANAGER_H_INCL__
|
|
#define __CURLREQUESTSMANAGER_H_INCL__
|
|
|
|
#include "../../components/base/basicMutex.h"
|
|
#include "../../components/base/basicThread.h"
|
|
#include "curlRequest.h"
|
|
|
|
/**
|
|
* TODO: Add class description
|
|
*
|
|
* @author Gagua
|
|
*/
|
|
class curlRequestsManager : public basicThread
|
|
{
|
|
private:
|
|
|
|
basicLogCollection * m_pLog;
|
|
CURLM * m_pCURLM;
|
|
RequestPool m_vRequestPool;
|
|
RequestThreadPool m_vRequestThreadPool;
|
|
basicMutex m_mPoolProtector;
|
|
|
|
public:
|
|
|
|
static curlRequestsManager * getInstance();
|
|
|
|
virtual ~curlRequestsManager();
|
|
bool get(CSTR URL, CSTR contentType = DEFAULT_CONTENT_TYPE);
|
|
bool post(CSTR URL, CSTR postData, CSTR contentType = DEFAULT_CONTENT_TYPE);
|
|
bool accomplish(curlRequest * RC);
|
|
|
|
protected:
|
|
|
|
curlRequestsManager();
|
|
virtual void m_fThreadProc(void);
|
|
|
|
private:
|
|
|
|
static curlRequestsManager * _instance;
|
|
};
|
|
|
|
#endif // __CURLREQUESTSMANAGER_H_INCL__
|