LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NetworkAccessManager Class Referencefinal

A network access manager which processes network requests in a separate thread. More...

#include <networkaccessmanager.h>

Inherits QThread.

+ Collaboration diagram for NetworkAccessManager:

Public Member Functions

 NetworkAccessManager () noexcept
 
 NetworkAccessManager (const NetworkAccessManager &other)=delete
 
 ~NetworkAccessManager () noexcept
 
QNetworkReply * get (const QNetworkRequest &request) noexcept
 
NetworkAccessManageroperator= (const NetworkAccessManager &rhs)=delete
 

Static Public Member Functions

static NetworkAccessManagerinstance () noexcept
 

Private Member Functions

void run () noexceptoverride
 
void stop () noexcept
 

Private Attributes

QSemaphore mThreadStartSemaphore
 
QNetworkAccessManager * mManager
 

Static Private Attributes

static NetworkAccessManagersInstance = nullptr
 

Detailed Description

A network access manager which processes network requests in a separate thread.

Note
One instance of this class must be created in the main application thread, and must be deleted before stopping the main application thread. It's not allowed to create a librepcb::NetworkAccessManager object in other threads, or to create multiple instances at the same time.

After the singleton was created, you can get it with the static method instance(). But for executing network requests, you don't need to access this object directly. You only need the classes librepcb::NetworkRequest and librepcb::FileDownload instead.

See Also
librepcb::NetworkRequestBase, librepcb::NetworkRequest, librepcb::FileDownload
Author
ubruhin
Date
2016-09-15

Constructor & Destructor Documentation

NetworkAccessManager ( )
noexcept

+ Here is the call graph for this function:

NetworkAccessManager ( const NetworkAccessManager other)
delete
~NetworkAccessManager ( )
noexcept

+ Here is the call graph for this function:

Member Function Documentation

QNetworkReply * get ( const QNetworkRequest &  request)
noexcept

+ Here is the caller graph for this function:

NetworkAccessManager& operator= ( const NetworkAccessManager rhs)
delete
NetworkAccessManager * instance ( )
staticnoexcept

+ Here is the caller graph for this function:

void run ( )
overrideprivatenoexcept
void stop ( )
privatenoexcept

+ Here is the caller graph for this function:

Member Data Documentation

QSemaphore mThreadStartSemaphore
private
QNetworkAccessManager* mManager
private
NetworkAccessManager * sInstance = nullptr
staticprivate

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