libzypp 17.31.23
zyppng::BasicDownloaderStateBase Struct Reference

#include </home/abuild/rpmbuild/BUILD/libzypp-17.31.23/zypp-curl/ng/network/private/downloaderstates/basicdownloader_p.h>

Inheritance diagram for zyppng::BasicDownloaderStateBase:

Public Types

using Request = DownloadPrivateBase::Request
 
- Public Types inherited from zyppng::MirrorHandlingStateBase
enum  PrepareResult { Failed , Ok , Delayed }
 

Public Member Functions

 BasicDownloaderStateBase (DownloadPrivate &parent)
 
 BasicDownloaderStateBase (std::shared_ptr< Request > &&req, DownloadPrivate &parent)
 
void enter ()
 
void exit ()
 
virtual bool initializeRequest (std::shared_ptr< Request > &r)
 
virtual void gotFinished ()
 
virtual void failed (NetworkRequestError &&err)
 
void failed (std::string &&str)
 
void onRequestStarted (NetworkRequest &)
 
void onRequestProgress (NetworkRequest &, off_t dltotal, off_t dlnow, off_t, off_t)
 
void onRequestFinished (NetworkRequest &req, const NetworkRequestError &err)
 
const NetworkRequestErrorerror () const
 
void mirrorReceived (MirrorControl::MirrorPick mirror) override
 
void failedToPrepare () override
 
- Public Member Functions inherited from zyppng::MirrorHandlingStateBase
 MirrorHandlingStateBase (DownloadPrivate &parent)
 
virtual ~MirrorHandlingStateBase ()
 
PrepareResult prepareNextMirror ()
 
NetworkRequestError setupMirror (const MirrorControl::MirrorPick &pick, Url &url, TransferSettings &set)
 
virtual void mirrorReceived (MirrorControl::MirrorPick mirror)=0
 
virtual void failedToPrepare ()
 

Public Attributes

std::shared_ptr< Request_request
 
std::optional< std::string > _chksumtype
 
std::optional< UByteArray > _chksumVec
 
- Public Attributes inherited from zyppng::MirrorHandlingStateBase
std::vector< Url > _fileMirrors
 

Protected Member Functions

void startWithMirror (MirrorControl::MirrorHandle mirror, const zypp::Url &url, const TransferSettings &set)
 
void startWithoutMirror ()
 
void startRequest ()
 
virtual void handleRequestProgress (NetworkRequest &req, off_t dltotal, off_t dlnow)
 

Protected Attributes

NetworkRequestError _error
 
Signal< void() > _sigFinished
 
Signal< void() > _sigFailed
 

Detailed Description

State implementation for the generic part of a simple file downloader, that knows how to use the mirrors if available.

Definition at line 27 of file basicdownloader_p.h.

Member Typedef Documentation

◆ Request

Constructor & Destructor Documentation

◆ BasicDownloaderStateBase() [1/2]

zyppng::BasicDownloaderStateBase::BasicDownloaderStateBase ( DownloadPrivate parent)
inline

Definition at line 31 of file basicdownloader_p.h.

◆ BasicDownloaderStateBase() [2/2]

zyppng::BasicDownloaderStateBase::BasicDownloaderStateBase ( std::shared_ptr< Request > &&  req,
DownloadPrivate parent 
)

Definition at line 20 of file basicdownloader_p.cc.

Member Function Documentation

◆ enter()

void zyppng::BasicDownloaderStateBase::enter ( )

Definition at line 25 of file basicdownloader_p.cc.

◆ exit()

void zyppng::BasicDownloaderStateBase::exit ( )

Definition at line 49 of file basicdownloader_p.cc.

◆ initializeRequest()

bool zyppng::BasicDownloaderStateBase::initializeRequest ( std::shared_ptr< Request > &  r)
virtual

Reimplemented in zyppng::DlMetaLinkInfoState.

Definition at line 132 of file basicdownloader_p.cc.

◆ gotFinished()

void zyppng::BasicDownloaderStateBase::gotFinished ( )
virtual

Reimplemented in zyppng::DlMetaLinkInfoState.

Definition at line 137 of file basicdownloader_p.cc.

◆ failed() [1/2]

void zyppng::BasicDownloaderStateBase::failed ( NetworkRequestError &&  err)
virtual

Definition at line 147 of file basicdownloader_p.cc.

◆ failed() [2/2]

void zyppng::BasicDownloaderStateBase::failed ( std::string &&  str)

Definition at line 142 of file basicdownloader_p.cc.

◆ onRequestStarted()

void zyppng::BasicDownloaderStateBase::onRequestStarted ( NetworkRequest )

Definition at line 155 of file basicdownloader_p.cc.

◆ onRequestProgress()

void zyppng::BasicDownloaderStateBase::onRequestProgress ( NetworkRequest req,
off_t  dltotal,
off_t  dlnow,
off_t  ,
off_t   
)

Definition at line 177 of file basicdownloader_p.cc.

◆ onRequestFinished()

void zyppng::BasicDownloaderStateBase::onRequestFinished ( NetworkRequest req,
const NetworkRequestError err 
)

Definition at line 182 of file basicdownloader_p.cc.

◆ error()

const NetworkRequestError & zyppng::BasicDownloaderStateBase::error ( ) const
inline

Definition at line 46 of file basicdownloader_p.h.

◆ mirrorReceived()

void zyppng::BasicDownloaderStateBase::mirrorReceived ( MirrorControl::MirrorPick  mirror)
overridevirtual

This is called once a mirror became ready, either directly if a mirror is ready or it was delayed and called asynchronously

Implements zyppng::MirrorHandlingStateBase.

Definition at line 57 of file basicdownloader_p.cc.

◆ failedToPrepare()

void zyppng::BasicDownloaderStateBase::failedToPrepare ( )
overridevirtual

Gets called in case a mirror failed to prepare, probably because none of the mirrors in _fileMirrors is known by MirrorControl

Reimplemented from zyppng::MirrorHandlingStateBase.

Definition at line 71 of file basicdownloader_p.cc.

◆ startWithMirror()

void zyppng::BasicDownloaderStateBase::startWithMirror ( MirrorControl::MirrorHandle  mirror,
const zypp::Url url,
const TransferSettings set 
)
protected

Definition at line 76 of file basicdownloader_p.cc.

◆ startWithoutMirror()

void zyppng::BasicDownloaderStateBase::startWithoutMirror ( )
protected

Definition at line 89 of file basicdownloader_p.cc.

◆ startRequest()

void zyppng::BasicDownloaderStateBase::startRequest ( )
protected

Definition at line 102 of file basicdownloader_p.cc.

◆ handleRequestProgress()

void zyppng::BasicDownloaderStateBase::handleRequestProgress ( NetworkRequest req,
off_t  dltotal,
off_t  dlnow 
)
protectedvirtual

Reimplemented in zyppng::DlMetaLinkInfoState.

Definition at line 166 of file basicdownloader_p.cc.

Member Data Documentation

◆ _request

std::shared_ptr<Request> zyppng::BasicDownloaderStateBase::_request

Definition at line 50 of file basicdownloader_p.h.

◆ _chksumtype

std::optional<std::string> zyppng::BasicDownloaderStateBase::_chksumtype

Definition at line 51 of file basicdownloader_p.h.

◆ _chksumVec

std::optional<UByteArray> zyppng::BasicDownloaderStateBase::_chksumVec

Definition at line 52 of file basicdownloader_p.h.

◆ _error

NetworkRequestError zyppng::BasicDownloaderStateBase::_error
protected

Definition at line 63 of file basicdownloader_p.h.

◆ _sigFinished

Signal< void () > zyppng::BasicDownloaderStateBase::_sigFinished
protected

Definition at line 64 of file basicdownloader_p.h.

◆ _sigFailed

Signal< void () > zyppng::BasicDownloaderStateBase::_sigFailed
protected

Definition at line 65 of file basicdownloader_p.h.


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