Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
audacity::network_manager::NetworkManager Class Referencefinal

#include <NetworkManager.h>

Collaboration diagram for audacity::network_manager::NetworkManager:
[legend]

Public Member Functions

ResponsePtr doGet (const Request &request)
 
ResponsePtr doHead (const Request &request)
 
ResponsePtr doDelete (const Request &request)
 
ResponsePtr doPost (const Request &request, const void *data, size_t size)
 
ResponsePtr doPost (const Request &request, std::unique_ptr< MultipartData > form)
 
ResponsePtr doPut (const Request &request, const void *data, size_t size)
 
ResponsePtr doPut (const Request &request, std::unique_ptr< MultipartData > form)
 
ResponsePtr doPatch (const Request &request, const void *data, size_t size)
 
void setProxy (const std::string &proxy)
 

Static Public Member Functions

static NetworkManagerGetInstance ()
 
static void Terminate ()
 

Private Member Functions

 NetworkManager ()
 
 ~NetworkManager ()
 

Private Attributes

std::unique_ptr< IResponseFactorymResponseFactory
 

Detailed Description

Definition at line 30 of file NetworkManager.h.

Constructor & Destructor Documentation

◆ NetworkManager()

NetworkManager::NetworkManager ( )
private

Definition at line 30 of file NetworkManager.cpp.

31{
32 mResponseFactory = std::make_unique<CurlResponseFactory> ();
33}
std::unique_ptr< IResponseFactory > mResponseFactory

References mResponseFactory.

◆ ~NetworkManager()

NetworkManager::~NetworkManager ( )
private

Definition at line 35 of file NetworkManager.cpp.

36{}

Member Function Documentation

◆ doDelete()

ResponsePtr NetworkManager::doDelete ( const Request request)

Definition at line 60 of file NetworkManager.cpp.

61{
62 return mResponseFactory->performRequest (RequestVerb::Delete, request);
63}

References audacity::network_manager::Delete, and mResponseFactory.

◆ doGet()

ResponsePtr NetworkManager::doGet ( const Request request)

Definition at line 50 of file NetworkManager.cpp.

51{
52 return mResponseFactory->performRequest (RequestVerb::Get, request);
53}

References audacity::network_manager::Get, and mResponseFactory.

Referenced by UpdateManager::GetUpdates().

Here is the caller graph for this function:

◆ doHead()

ResponsePtr NetworkManager::doHead ( const Request request)

Definition at line 55 of file NetworkManager.cpp.

56{
57 return mResponseFactory->performRequest (RequestVerb::Head, request);
58}

References audacity::network_manager::Head, and mResponseFactory.

◆ doPatch()

ResponsePtr NetworkManager::doPatch ( const Request request,
const void *  data,
size_t  size 
)

Definition at line 88 of file NetworkManager.cpp.

89{
90 return mResponseFactory->performRequest(
91 RequestVerb::Patch, request, data, size);
92}

References mResponseFactory, audacity::network_manager::Patch, and size.

◆ doPost() [1/2]

ResponsePtr NetworkManager::doPost ( const Request request,
const void *  data,
size_t  size 
)

Definition at line 65 of file NetworkManager.cpp.

66{
67 return mResponseFactory->performRequest (RequestVerb::Post, request, data, size);
68}

References mResponseFactory, audacity::network_manager::Post, and size.

Referenced by audacity::sentry::Report::ReportImpl::Send().

Here is the caller graph for this function:

◆ doPost() [2/2]

ResponsePtr NetworkManager::doPost ( const Request request,
std::unique_ptr< MultipartData form 
)

Definition at line 70 of file NetworkManager.cpp.

72{
73 return mResponseFactory->performRequest(RequestVerb::Post, request, std::move(form));
74}

References mResponseFactory, and audacity::network_manager::Post.

◆ doPut() [1/2]

ResponsePtr NetworkManager::doPut ( const Request request,
const void *  data,
size_t  size 
)

Definition at line 76 of file NetworkManager.cpp.

77{
78 return mResponseFactory->performRequest (RequestVerb::Put, request, data, size);
79}

References mResponseFactory, audacity::network_manager::Put, and size.

◆ doPut() [2/2]

ResponsePtr NetworkManager::doPut ( const Request request,
std::unique_ptr< MultipartData form 
)

Definition at line 81 of file NetworkManager.cpp.

83{
84 return mResponseFactory->performRequest(RequestVerb::Put, request, std::move(form));
85}

References mResponseFactory, and audacity::network_manager::Put.

◆ GetInstance()

NetworkManager & NetworkManager::GetInstance ( )
static

Definition at line 38 of file NetworkManager.cpp.

39{
40 static NetworkManager instance;
41
42 return instance;
43}
Class for performing HTTP requests.

Referenced by UpdateManager::GetUpdates(), AudacityApp::OnExit(), audacity::sentry::Report::ReportImpl::Send(), and Terminate().

Here is the caller graph for this function:

◆ setProxy()

void NetworkManager::setProxy ( const std::string &  proxy)

Definition at line 94 of file NetworkManager.cpp.

95{
96 mResponseFactory->setProxy (proxy);
97}

References mResponseFactory.

◆ Terminate()

void NetworkManager::Terminate ( )
static

Definition at line 45 of file NetworkManager.cpp.

46{
47 GetInstance ().mResponseFactory->terminate ();
48}

References GetInstance(), and mResponseFactory.

Referenced by AudacityApp::OnExit().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mResponseFactory

std::unique_ptr<IResponseFactory> audacity::network_manager::NetworkManager::mResponseFactory
private

The documentation for this class was generated from the following files: