Audacity 3.2.0
CurlResponseFactory.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file CurlResponseFactory.h
6 @brief Declare an implementation of IResponseFactory using libcurl.
7
8 Dmitry Vedenko
9 **********************************************************************/
10
11#pragma once
12
13#include <memory>
14
15#include "../IResponseFactory.h"
16
17#include "CurlHandleManager.h"
18
19class ThreadPool;
20
21namespace audacity
22{
23namespace network_manager
24{
25
27{
28public:
31
32 void setProxy (const std::string& proxy) override;
33
34 ResponsePtr performRequest (RequestVerb verb, const Request& request) override;
36 RequestVerb verb, const Request& request,
37 RequestPayloadStreamPtr payloadStream) override;
38 ResponsePtr performRequest (RequestVerb verb, const Request& request, std::unique_ptr<MultipartData> form) override;
39
40 void terminate () override;
41
42private:
43 std::unique_ptr<CurlHandleManager> mHandleManager { std::make_unique<CurlHandleManager> () };
44 std::unique_ptr<ThreadPool> mThreadPool;
45};
46
47}
48}
Declare a class responsible for reuse of CURL handles.
ResponsePtr performRequest(RequestVerb verb, const Request &request) override
std::unique_ptr< CurlHandleManager > mHandleManager
void setProxy(const std::string &proxy) override
std::shared_ptr< IResponse > ResponsePtr
std::shared_ptr< RequestPayloadStream > RequestPayloadStreamPtr
Definition: CurlResponse.h:33