libzypp 17.35.15
zyppng::MirrorHandlingStateBase Struct Referenceabstract

#include <zypp-curl/ng/network/private/downloaderstates/mirrorhandling_p.h>

Inheritance diagram for zyppng::MirrorHandlingStateBase:

Public Types

enum  PrepareResult { Failed , Ok , Delayed }
 
- Public Types inherited from zyppng::Base
using Ptr = std::shared_ptr<Base>
 
using WeakPtr = std::weak_ptr<Base>
 

Public Member Functions

 MirrorHandlingStateBase (DownloadPrivate &parent)
 
 ~MirrorHandlingStateBase () override
 
PrepareResult prepareNextMirror ()
 
NetworkRequestError setupMirror (const MirrorControl::MirrorPick &pick, Url &url, TransferSettings &set)
 
virtual void mirrorReceived (MirrorControl::MirrorPick mirror)=0
 
virtual void failedToPrepare ()
 
- Public Member Functions inherited from zyppng::BasicState< DownloadPrivate, false >
 BasicState (DownloadPrivate &sm)
 
 BasicState (BasicState &&) noexcept=default
 
 ~BasicState () override
 
BasicStateoperator= (BasicState &&) noexcept=default
 
DownloadPrivatestateMachine ()
 
const DownloadPrivatestateMachine () const
 
- Public Member Functions inherited from zyppng::Base
 Base ()
 
virtual ~Base ()
 
WeakPtr parent () const
 
void addChild (const Base::Ptr &child)
 
void removeChild (const Ptr &child)
 
const std::unordered_set< Ptr > & children () const
 
std::thread::id threadId () const
 
template<typename T >
std::vector< std::weak_ptr< T > > findChildren () const
 
template<typename T >
std::shared_ptr< T > shared_this () const
 
template<typename T >
std::shared_ptr< T > shared_this ()
 
template<typename T >
std::weak_ptr< T > weak_this () const
 
template<typename T >
std::weak_ptr< T > weak_this ()
 
template<typename SenderFunc , typename ReceiverFunc >
auto connect (SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc)
 
template<typename SenderFunc , typename ReceiverFunc , typename ... Tracker>
std::enable_if_t< std::is_member_function_pointer_v< SenderFunc >, connectionconnectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers)
 

Public Attributes

std::vector< Url_fileMirrors
 

Private Attributes

connection _sigMirrorsReadyConn
 

Additional Inherited Members

- Static Public Member Functions inherited from zyppng::Base
template<typename Obj , typename Functor >
static decltype(auto) make_base_slot (Obj *o, Functor &&f)
 
template<typename SenderFunc , typename ReceiverFunc >
static auto connect (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc)
 
template<typename SenderFunc , typename ReceiverFunc , typename ... Tracker>
static auto connectFunc (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers)
 
- Static Public Attributes inherited from zyppng::BasicState< DownloadPrivate, false >
static constexpr bool isFinal
 
- Protected Member Functions inherited from zyppng::Base
 Base (BasePrivate &dd)
 
- Protected Attributes inherited from zyppng::Base
std::unique_ptr< BasePrivated_ptr
 

Detailed Description

superclass state implementation for all states that need to handle async mirror requests

Definition at line 25 of file mirrorhandling_p.h.

Member Enumeration Documentation

◆ PrepareResult

Enumerator
Failed 
Ok 
Delayed 

Definition at line 30 of file mirrorhandling_p.h.

Constructor & Destructor Documentation

◆ MirrorHandlingStateBase()

zyppng::MirrorHandlingStateBase::MirrorHandlingStateBase ( DownloadPrivate & parent)

Definition at line 17 of file mirrorhandling_p.cc.

◆ ~MirrorHandlingStateBase()

zyppng::MirrorHandlingStateBase::~MirrorHandlingStateBase ( )
override

Definition at line 21 of file mirrorhandling_p.cc.

Member Function Documentation

◆ prepareNextMirror()

MirrorHandlingStateBase::PrepareResult zyppng::MirrorHandlingStateBase::prepareNextMirror ( )

Request a new mirror, the PrepareResult shows if setupMirror was already called or if the request was Delayed.

Definition at line 26 of file mirrorhandling_p.cc.

◆ setupMirror()

NetworkRequestError zyppng::MirrorHandlingStateBase::setupMirror ( const MirrorControl::MirrorPick & pick,
Url & url,
TransferSettings & set )

Common code to setup a mirror after it was received, can result in errors if the mirror url contains settings that are invalid. Will return settings and url via parameters.

Definition at line 45 of file mirrorhandling_p.cc.

◆ mirrorReceived()

virtual void zyppng::MirrorHandlingStateBase::mirrorReceived ( MirrorControl::MirrorPick mirror)
pure virtual

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

Implemented in zyppng::BasicDownloaderStateBase, and zyppng::RangeDownloaderBaseState.

◆ failedToPrepare()

virtual void zyppng::MirrorHandlingStateBase::failedToPrepare ( )
inlinevirtual

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

Reimplemented in zyppng::BasicDownloaderStateBase, and zyppng::RangeDownloaderBaseState.

Definition at line 60 of file mirrorhandling_p.h.

Member Data Documentation

◆ _fileMirrors

std::vector<Url> zyppng::MirrorHandlingStateBase::_fileMirrors

Definition at line 62 of file mirrorhandling_p.h.

◆ _sigMirrorsReadyConn

connection zyppng::MirrorHandlingStateBase::_sigMirrorsReadyConn
private

Definition at line 65 of file mirrorhandling_p.h.


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