libzypp 17.35.1
zyppng::MirrorControl Class Reference

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

Inheritance diagram for zyppng::MirrorControl:

Classes

struct  Mirror
 
struct  PickResult
 

Public Types

using Ptr = std::shared_ptr<MirrorControl>
 
using MirrorHandle = std::shared_ptr<Mirror>
 
using MirrorPick = std::pair< std::vector<Url>::const_iterator, MirrorHandle >
 
- Public Types inherited from zyppng::Base
using Ptr = std::shared_ptr<Base>
 
using WeakPtr = std::weak_ptr<Base>
 

Public Member Functions

 ~MirrorControl () override
 
void registerMirrors (const std::vector< zypp::media::MetalinkMirror > &urls)
 
PickResult pickBestMirror (const std::vector< Url > &mirrors)
 
bool allMirrorsReady () const
 
SignalProxy< void()> sigNewMirrorsReady ()
 
SignalProxy< void()> sigAllMirrorsReady ()
 
- 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)
 

Static Public Member Functions

static Ptr create ()
 
- 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)
 

Private Member Functions

 MirrorControl ()
 
std::string makeKey (const zypp::Url &url) const
 

Private Attributes

sigc::connection _queueEmptyConn
 
NetworkRequestDispatcher::Ptr _dispatcher
 
std::unordered_map< std::string, MirrorHandle_handles
 
Timer::Ptr _newMirrSigDelay
 
Signal< void()> _sigAllMirrorsReady
 
Signal< void()> _sigNewMirrorsReady
 

Additional Inherited Members

- Protected Member Functions inherited from zyppng::Base
 Base (BasePrivate &dd)
 
- Protected Attributes inherited from zyppng::Base
std::unique_ptr< BasePrivated_ptr
 

Detailed Description

Definition at line 29 of file mirrorcontrol_p.h.

Member Typedef Documentation

◆ Ptr

using zyppng::MirrorControl::Ptr = std::shared_ptr<MirrorControl>

Definition at line 63 of file mirrorcontrol_p.h.

◆ MirrorHandle

using zyppng::MirrorControl::MirrorHandle = std::shared_ptr<Mirror>

Definition at line 64 of file mirrorcontrol_p.h.

◆ MirrorPick

using zyppng::MirrorControl::MirrorPick = std::pair< std::vector<Url>::const_iterator, MirrorHandle >

Definition at line 65 of file mirrorcontrol_p.h.

Constructor & Destructor Documentation

◆ ~MirrorControl()

zyppng::MirrorControl::~MirrorControl ( )
override

Definition at line 109 of file mirrorcontrol.cc.

◆ MirrorControl()

zyppng::MirrorControl::MirrorControl ( )
private

Definition at line 70 of file mirrorcontrol.cc.

Member Function Documentation

◆ create()

MirrorControl::Ptr zyppng::MirrorControl::create ( )
static

Definition at line 104 of file mirrorcontrol.cc.

◆ registerMirrors()

void zyppng::MirrorControl::registerMirrors ( const std::vector< zypp::media::MetalinkMirror > & urls)

Definition at line 126 of file mirrorcontrol.cc.

◆ pickBestMirror()

MirrorControl::PickResult zyppng::MirrorControl::pickBestMirror ( const std::vector< Url > & mirrors)

Definition at line 193 of file mirrorcontrol.cc.

◆ allMirrorsReady()

bool zyppng::MirrorControl::allMirrorsReady ( ) const

◆ sigNewMirrorsReady()

SignalProxy< void()> zyppng::MirrorControl::sigNewMirrorsReady ( )

Definition at line 238 of file mirrorcontrol.cc.

◆ sigAllMirrorsReady()

SignalProxy< void()> zyppng::MirrorControl::sigAllMirrorsReady ( )

Definition at line 243 of file mirrorcontrol.cc.

◆ makeKey()

std::string zyppng::MirrorControl::makeKey ( const zypp::Url & url) const
private

Definition at line 248 of file mirrorcontrol.cc.

Member Data Documentation

◆ _queueEmptyConn

sigc::connection zyppng::MirrorControl::_queueEmptyConn
private

Definition at line 92 of file mirrorcontrol_p.h.

◆ _dispatcher

NetworkRequestDispatcher::Ptr zyppng::MirrorControl::_dispatcher
private

Definition at line 93 of file mirrorcontrol_p.h.

◆ _handles

std::unordered_map<std::string, MirrorHandle> zyppng::MirrorControl::_handles
private

Definition at line 94 of file mirrorcontrol_p.h.

◆ _newMirrSigDelay

Timer::Ptr zyppng::MirrorControl::_newMirrSigDelay
private

Definition at line 96 of file mirrorcontrol_p.h.

◆ _sigAllMirrorsReady

Signal<void()> zyppng::MirrorControl::_sigAllMirrorsReady
private

Definition at line 98 of file mirrorcontrol_p.h.

◆ _sigNewMirrorsReady

Signal<void()> zyppng::MirrorControl::_sigNewMirrorsReady
private

Definition at line 99 of file mirrorcontrol_p.h.


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