libzypp 17.34.0
zyppng::Provide Class Reference

#include <zypp-media/ng/provide.h>

Inheritance diagram for zyppng::Provide:

Public Types

enum  Action { ABORT , RETRY , SKIP }
 
using MediaHandle = ProvideMediaHandle
 
using Res = ProvideRes
 
using MediaChangeAction = std::optional<Action>
 
- Public Types inherited from zyppng::Base
using Ptr = std::shared_ptr<Base>
 
using WeakPtr = std::weak_ptr<Base>
 

Public Member Functions

AsyncOpRef< expected< MediaHandle > > attachMedia (const std::vector< zypp::Url > &urls, const ProvideMediaSpec &request)
 
AsyncOpRef< expected< MediaHandle > > attachMedia (const zypp::Url &url, const ProvideMediaSpec &request)
 
AsyncOpRef< expected< ProvideRes > > provide (const std::vector< zypp::Url > &urls, const ProvideFileSpec &request)
 
AsyncOpRef< expected< ProvideRes > > provide (const zypp::Url &url, const ProvideFileSpec &request)
 
AsyncOpRef< expected< ProvideRes > > provide (const MediaHandle &attachHandle, const zypp::Pathname &fileName, const ProvideFileSpec &request)
 
AsyncOpRef< expected< zypp::CheckSum > > checksumForFile (const zypp::Pathname &p, const std::string &algorithm)
 
AsyncOpRef< expected< zypp::ManagedFile > > copyFile (const zypp::Pathname &source, const zypp::Pathname &target)
 
AsyncOpRef< expected< zypp::ManagedFile > > copyFile (ProvideRes &&source, const zypp::Pathname &target)
 
void start ()
 
void setWorkerPath (const zypp::Pathname &path)
 
bool isRunning () const
 
bool ejectDevice (const std::string &queueRef, const std::string &device)
 
void setStatusTracker (ProvideStatusRef tracker)
 
const zypp::PathnameproviderWorkdir () const
 
const zypp::media::CredManagerOptionscredManangerOptions () const
 
void setCredManagerOptions (const zypp::media::CredManagerOptions &opt)
 
SignalProxy< void()> sigIdle ()
 
- 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 ProvideRef create (const zypp::Pathname &workDir="")
 
static auto copyResultToDest (ProvideRef provider, const zypp::Pathname &targetPath)
 
- Static Public Member Functions inherited from zyppng::Base
template<typename Obj , typename Functor >
static decltype(automake_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)
 

Public Attributes

SignalProxy< MediaChangeAction(const std::string &queueRef, const std::string &label, const int32_t mediaNr, const std::vector< std::string > &devices, const std::optional< std::string > &descsigMediaChangeRequested )()
 
SignalProxy< std::optional< zypp::media::AuthData >(const zypp::Url &reqUrl, const std::string &triedUsername, const std::map< std::string, std::string > &extraValues) sigAuthRequired )()
 

Private Member Functions

 ZYPP_DECLARE_PRIVATE (Provide)
 
 Provide (const zypp::Pathname &workDir)
 

Friends

template<class T >
class ProvidePromise
 
class ProvideItem
 
class ProvideMediaHandle
 
class ProvideStatus
 

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 110 of file provide.h.

Member Typedef Documentation

◆ MediaHandle

◆ Res

Definition at line 120 of file provide.h.

◆ MediaChangeAction

Definition at line 162 of file provide.h.

Member Enumeration Documentation

◆ Action

Enumerator
ABORT 
RETRY 
SKIP 

Definition at line 157 of file provide.h.

Constructor & Destructor Documentation

◆ Provide()

zyppng::Provide::Provide ( const zypp::Pathname & workDir)
private

Definition at line 966 of file provide.cc.

Member Function Documentation

◆ ZYPP_DECLARE_PRIVATE()

zyppng::Provide::ZYPP_DECLARE_PRIVATE ( Provide )
private

◆ create()

ProvideRef zyppng::Provide::create ( const zypp::Pathname & workDir = "")
static

Definition at line 972 of file provide.cc.

◆ attachMedia() [1/2]

AsyncOpRef< expected< Provide::MediaHandle > > zyppng::Provide::attachMedia ( const std::vector< zypp::Url > & urls,
const ProvideMediaSpec & request )

Definition at line 982 of file provide.cc.

◆ attachMedia() [2/2]

AsyncOpRef< expected< Provide::MediaHandle > > zyppng::Provide::attachMedia ( const zypp::Url & url,
const ProvideMediaSpec & request )

Definition at line 977 of file provide.cc.

◆ provide() [1/3]

AsyncOpRef< expected< ProvideRes > > zyppng::Provide::provide ( const std::vector< zypp::Url > & urls,
const ProvideFileSpec & request )

Definition at line 1029 of file provide.cc.

◆ provide() [2/3]

AsyncOpRef< expected< ProvideRes > > zyppng::Provide::provide ( const zypp::Url & url,
const ProvideFileSpec & request )

Definition at line 1037 of file provide.cc.

◆ provide() [3/3]

AsyncOpRef< expected< ProvideRes > > zyppng::Provide::provide ( const MediaHandle & attachHandle,
const zypp::Pathname & fileName,
const ProvideFileSpec & request )

Definition at line 1042 of file provide.cc.

◆ checksumForFile()

zyppng::AsyncOpRef< zyppng::expected< zypp::CheckSum > > zyppng::Provide::checksumForFile ( const zypp::Pathname & p,
const std::string & algorithm )

Schedules a job to calculate the checksum for the given file

Definition at line 1071 of file provide.cc.

◆ copyFile() [1/2]

AsyncOpRef< expected< zypp::ManagedFile > > zyppng::Provide::copyFile ( const zypp::Pathname & source,
const zypp::Pathname & target )

Schedules a copy job to copy a file from source to target

Definition at line 1091 of file provide.cc.

◆ copyFile() [2/2]

AsyncOpRef< expected< zypp::ManagedFile > > zyppng::Provide::copyFile ( ProvideRes && source,
const zypp::Pathname & target )

Definition at line 1104 of file provide.cc.

◆ start()

void zyppng::Provide::start ( )

Definition at line 1117 of file provide.cc.

◆ setWorkerPath()

void zyppng::Provide::setWorkerPath ( const zypp::Pathname & path)

Definition at line 1126 of file provide.cc.

◆ isRunning()

bool zyppng::Provide::isRunning ( ) const

◆ ejectDevice()

bool zyppng::Provide::ejectDevice ( const std::string & queueRef,
const std::string & device )

Definition at line 1131 of file provide.cc.

◆ setStatusTracker()

void zyppng::Provide::setStatusTracker ( ProvideStatusRef tracker)

Definition at line 1139 of file provide.cc.

◆ providerWorkdir()

const zypp::Pathname & zyppng::Provide::providerWorkdir ( ) const

Definition at line 1144 of file provide.cc.

◆ credManangerOptions()

const zypp::media::CredManagerOptions & zyppng::Provide::credManangerOptions ( ) const

Definition at line 1149 of file provide.cc.

◆ setCredManagerOptions()

void zyppng::Provide::setCredManagerOptions ( const zypp::media::CredManagerOptions & opt)

Definition at line 1155 of file provide.cc.

◆ sigIdle()

SignalProxy< void()> zyppng::Provide::sigIdle ( )

Definition at line 1160 of file provide.cc.

◆ copyResultToDest()

static auto zyppng::Provide::copyResultToDest ( ProvideRef provider,
const zypp::Pathname & targetPath )
inlinestatic

Definition at line 179 of file provide.h.

Friends And Related Symbol Documentation

◆ ProvidePromise

template<class T >
friend class ProvidePromise
friend

Definition at line 113 of file provide.h.

◆ ProvideItem

Definition at line 114 of file provide.h.

◆ ProvideMediaHandle

Definition at line 115 of file provide.h.

◆ ProvideStatus

Definition at line 116 of file provide.h.

Member Data Documentation

◆ sigMediaChangeRequested

SignalProxy< MediaChangeAction(const std::string &queueRef, const std::string &label, const int32_t mediaNr, const std::vector< std::string > &devices, const std::optional< std::string > &desc) zyppng::Provide::sigMediaChangeRequested) ()

Connect to this signal to handle media change requests

Note
It is NOT supported to shutdown the provider or cancel items when in this callback Returning Abort here will effectively cancel the current item anyway.

◆ sigAuthRequired

SignalProxy< std::optional< zypp::media::AuthData >(const zypp::Url &reqUrl, const std::string &triedUsername, const std::map< std::string, std::string > &extraValues) zyppng::Provide::sigAuthRequired) ()

This signal is emitted in case a request signaled a need to get Auth Info and nothing was found in the zypp::media::CredentialManager.


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