AUI Framework  master
Cross-platform module-based framework for developing C++20 desktop applications
ACurlMulti Class Reference

Multi curl instance. More...

Detailed Description

Multi curl instance.

Provides support to multiple simultaneous curl requests in a one thread.

Analogous to Qt's QNetworkAccessManager.

All calls are processed by enqueueing them on ACurlMulti's thread, so the underlying curl handle is used by the single thread. This means that the following code will fail:

auto m = _new<ACurlMulti>(); m << _new<ACurl>(...); AUI_ASSERT(!m->empty()); // assertion failure here

Use AThread::processMessages() function to avoid this limitation:

auto m = _new<ACurlMulti>(); m << _new<ACurl>(...); AThread::processMessages() // + AUI_ASSERT(!m->empty()); // ok!

Public Member Functions

 ACurlMulti (ACurlMulti &&other) noexcept
 
ACurlMultioperator<< (_< ACurl > curl)
 
ACurlMultioperator>> (const _< ACurl > &curl)
 
void run ()
 
void cancel ()
 
void clear ()
 
const AMap< void *, _< ACurl > > & curls () const
 
- Public Member Functions inherited from AObject
_< AObjectsharedPtr ()
 
_weak< AObjectweakPtr ()
 
void clearSignals () noexcept
 
template<AAnySignal Signal, ACompatibleSlotFor< Signal > Function>
void connect (Signal &signal, Function &&function)
 
void setSignalsEnabled (bool enabled)
 
bool isSignalsEnabled () const noexcept
 
template<ASignalInvokable T>
void operator^ (T &&t)
 
_< AAbstractThreadgetThread () const
 
bool isSlotsCallsOnlyOnMyThread () const noexcept
 
void setSlotsCallsOnlyOnMyThread (bool slotsCallsOnlyOnMyThread)
 
- Public Member Functions inherited from aui::noncopyable
 noncopyable (const noncopyable &)=delete
 
noncopyableoperator= (const noncopyable &)=delete
 

Static Public Member Functions

static ACurlMultiglobal () noexcept
 Global instance of ACurlMulti, running in a separate thread.
 
- Static Public Member Functions inherited from AObject
static void disconnect ()
 
template<AAnySignal Signal, aui::derived_from< AObject > Object, ACompatibleSlotFor< Signal > Function>
static void connect (Signal &signal, Object *object, Function &&function)
 
template<AAnySignal Signal, aui::derived_from< AObject > Object, ACompatibleSlotFor< Signal > Function>
static void connect (Signal &signal, Object &object, Function &&function)
 
template<AAnySignal Signal, aui::derived_from< AObject > Object, ACompatibleSlotFor< Signal > Function>
static void connect (Signal &signal, _< Object > object, Function &&function)
 
static void moveToThread (aui::no_escape< AObject > object, _< AAbstractThread > thread)
 

Additional Inherited Members

- Protected Member Functions inherited from AObject
void setThread (_< AAbstractThread > thread)
 Set thread of the object.
 

#include <AUI/Curl/ACurlMulti.h>


The documentation for this class was generated from the following files:
Inheritance diagram for ACurlMulti:
Collaboration diagram for ACurlMulti: