OpendTect  7.0
Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
Network::HttpRequestProcess Class Reference
Inheritance diagram for Network::HttpRequestProcess:
[legend]

Public Member Functions

od_int64 downloadBytesAvailable () const
 
uiString errMsg () const
 
od_int64 getBytesUploaded () const
 
od_int64 getContentLengthHeader () const
 
od_int64 getTotalBytesToUpload () const
 
bool isError () const
 
bool isFinished () const
 
bool isRunning () const
 
od_int64 read (char *, od_int64 bufsize)
 Returns nr bytes read. More...
 
BufferString readAll ()
 
bool waitForDownloadData (int timeout_ms=-1)
 
void waitForFinish (int timeout_in_ms=-1)
 
- Public Member Functions inherited from SharedObject
 SharedObject (const char *nm=nullptr)
 
 SharedObject (const SharedObject &)
 
- Public Member Functions inherited from NamedCallBacker
 NamedCallBacker (const char *nm=0)
 
 NamedCallBacker (const NamedCallBacker &)
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=nullptr)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
virtual BufferString getName () const
 
bool getNameFromPar (const IOPar &)
 
const name_typename () const override
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual void setName (const char *nm)
 
- Public Member Functions inherited from ObjectWithName
virtual ~ObjectWithName ()
 
bool hasName (const char *nm) const
 
bool hasName (const name_type &nm) const
 
void putNameInPar (IOPar &) const
 
- Public Member Functions inherited from RefCount::Referenced
void addObserver (WeakPtrBase *obs)
 Not for normal use. May become private. More...
 
int nrRefs () const
 Only for expert use. More...
 
void ref () const
 
bool refIfReffed () const
 Don't use in production, for debugging. More...
 
void removeObserver (WeakPtrBase *obs)
 Not for normal use. May become private. More...
 
bool tryRef () const
 Not for normal use. May become private. More...
 
void unRef () const
 
void unRefNoDelete () const
 

Public Attributes

Notifier< HttpRequestProcessdownloadDataAvailable
 
Notifier< HttpRequestProcesserror
 
Notifier< HttpRequestProcessfinished
 
Notifier< HttpRequestProcessuploadProgress
 

Private Types

enum  Status { NotStarted , Running , Error , Finished }
 

Private Member Functions

 HttpRequestProcess (const HttpRequest *)
 
 ~HttpRequestProcess ()
 
void reportDownloadProgress (od_int64 nrdone, od_int64 totalnr)
 
void reportError ()
 
void reportFinished ()
 
void reportMetaDataChanged ()
 
void reportReadyRead ()
 
void reportSSLErrors (const QList< QSslError > &)
 
void reportUploadProgress (od_int64 bytes, od_int64 totalbytes)
 
void setQNetworkReply (QNetworkReply *)
 
bool waitForRequestStart ()
 

Private Attributes

Threads::Atomic< od_int64 > bytesdownloaded_
 
Threads::Atomic< od_int64 > bytesuploaded_
 
Threads::Atomic< od_int64 > contentlengthheader_
 
uiString errmsg_
 
QNetworkReply * qnetworkreply_ = nullptr
 
QNetworkReplyConnqnetworkreplyconn_ = nullptr
 
QByteArray * receiveddata_ = nullptr
 
Threads::ConditionVar receiveddatalock_
 
ConstRefMan< HttpRequestrequest_
 
Status status_ = NotStarted
 
Threads::ConditionVar statuslock_
 
Threads::Atomic< od_int64 > totalbytestodownload_
 
Threads::Atomic< od_int64 > totalbytestoupload_
 

Friends

class ::QNetworkReplyConn
 
class HttpRequestManager
 

Additional Inherited Members

- Public Types inherited from ObjectWithName
typedef OD::String name_type
 
- Static Public Member Functions inherited from SharedObject
static Notifier< SharedObject > & instanceCreated ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 
- Static Public Member Functions inherited from RefCount::Referenced
static bool isSane (const Referenced *)
 
- Protected Member Functions inherited from SharedObject
virtual ~SharedObject ()
 
- Protected Member Functions inherited from NamedCallBacker
void sendDelNotif () const
 
- Protected Member Functions inherited from RefCount::Referenced
 Referenced ()
 
 Referenced (const Referenced &)
 
virtual ~Referenced ()
 
Referencedoperator= (const Referenced &)
 
- Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > delalreadytriggered_
 
Notifier< NamedCallBackerdelnotif_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Detailed Description

The upload or download process. Can be queried for progress, data and errors

<>

Member Enumeration Documentation

◆ Status

Enumerator
NotStarted 
Running 
Error 
Finished 

Constructor & Destructor Documentation

◆ HttpRequestProcess()

Network::HttpRequestProcess::HttpRequestProcess ( const HttpRequest )
private

◆ ~HttpRequestProcess()

Network::HttpRequestProcess::~HttpRequestProcess ( )
private

Member Function Documentation

◆ downloadBytesAvailable()

od_int64 Network::HttpRequestProcess::downloadBytesAvailable ( ) const

◆ errMsg()

uiString Network::HttpRequestProcess::errMsg ( ) const

◆ getBytesUploaded()

od_int64 Network::HttpRequestProcess::getBytesUploaded ( ) const

◆ getContentLengthHeader()

od_int64 Network::HttpRequestProcess::getContentLengthHeader ( ) const

◆ getTotalBytesToUpload()

od_int64 Network::HttpRequestProcess::getTotalBytesToUpload ( ) const

◆ isError()

bool Network::HttpRequestProcess::isError ( ) const

◆ isFinished()

bool Network::HttpRequestProcess::isFinished ( ) const

◆ isRunning()

bool Network::HttpRequestProcess::isRunning ( ) const

◆ read()

od_int64 Network::HttpRequestProcess::read ( char *  ,
od_int64  bufsize 
)

Returns nr bytes read.

◆ readAll()

BufferString Network::HttpRequestProcess::readAll ( )

◆ reportDownloadProgress()

void Network::HttpRequestProcess::reportDownloadProgress ( od_int64  nrdone,
od_int64  totalnr 
)
private

◆ reportError()

void Network::HttpRequestProcess::reportError ( )
private

◆ reportFinished()

void Network::HttpRequestProcess::reportFinished ( )
private

◆ reportMetaDataChanged()

void Network::HttpRequestProcess::reportMetaDataChanged ( )
private

◆ reportReadyRead()

void Network::HttpRequestProcess::reportReadyRead ( )
private

◆ reportSSLErrors()

void Network::HttpRequestProcess::reportSSLErrors ( const QList< QSslError > &  )
private

◆ reportUploadProgress()

void Network::HttpRequestProcess::reportUploadProgress ( od_int64  bytes,
od_int64  totalbytes 
)
private

◆ setQNetworkReply()

void Network::HttpRequestProcess::setQNetworkReply ( QNetworkReply *  )
private

Becomes mine. Also signals start of the request.

◆ waitForDownloadData()

bool Network::HttpRequestProcess::waitForDownloadData ( int  timeout_ms = -1)

◆ waitForFinish()

void Network::HttpRequestProcess::waitForFinish ( int  timeout_in_ms = -1)

◆ waitForRequestStart()

bool Network::HttpRequestProcess::waitForRequestStart ( )
private

Wait for the request to start in the networking thread.

Returns
if request was created

Friends And Related Function Documentation

◆ ::QNetworkReplyConn

friend class ::QNetworkReplyConn
friend

◆ HttpRequestManager

friend class HttpRequestManager
friend

Member Data Documentation

◆ bytesdownloaded_

Threads::Atomic<od_int64> Network::HttpRequestProcess::bytesdownloaded_
private

◆ bytesuploaded_

Threads::Atomic<od_int64> Network::HttpRequestProcess::bytesuploaded_
private

◆ contentlengthheader_

Threads::Atomic<od_int64> Network::HttpRequestProcess::contentlengthheader_
private

◆ downloadDataAvailable

Notifier<HttpRequestProcess> Network::HttpRequestProcess::downloadDataAvailable

◆ errmsg_

uiString Network::HttpRequestProcess::errmsg_
private

◆ error

Notifier<HttpRequestProcess> Network::HttpRequestProcess::error

◆ finished

Notifier<HttpRequestProcess> Network::HttpRequestProcess::finished

◆ qnetworkreply_

QNetworkReply* Network::HttpRequestProcess::qnetworkreply_ = nullptr
private

◆ qnetworkreplyconn_

QNetworkReplyConn* Network::HttpRequestProcess::qnetworkreplyconn_ = nullptr
private

◆ receiveddata_

QByteArray* Network::HttpRequestProcess::receiveddata_ = nullptr
private

◆ receiveddatalock_

Threads::ConditionVar Network::HttpRequestProcess::receiveddatalock_
private

◆ request_

ConstRefMan<HttpRequest> Network::HttpRequestProcess::request_
private

◆ status_

Status Network::HttpRequestProcess::status_ = NotStarted
private

◆ statuslock_

Threads::ConditionVar Network::HttpRequestProcess::statuslock_
mutableprivate

◆ totalbytestodownload_

Threads::Atomic<od_int64> Network::HttpRequestProcess::totalbytestodownload_
private

◆ totalbytestoupload_

Threads::Atomic<od_int64> Network::HttpRequestProcess::totalbytestoupload_
private

◆ uploadProgress

Notifier<HttpRequestProcess> Network::HttpRequestProcess::uploadProgress

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024