libzypp 17.37.10

zyppng::MediaSyncFacade Class Reference

`#include <zypp/ng/workflows/mediafacade.h>`

Inheritance diagram for zyppng::MediaSyncFacade:

## Classes
class | Res

## Public Types
using | MediaHandle = SyncMediaHandle
using | LazyMediaHandle = ::zyppng::LazyMediaHandle<MediaSyncFacade>
Public Types inherited from zyppng::Base
using | Ptr = std::shared_ptr<Base>
using | WeakPtr = std::weak_ptr<Base>

## Public Member Functions
| ZYPP_DECL_PRIVATE_CONSTR (MediaSyncFacade)
| ~MediaSyncFacade () override
expected< LazyMediaHandle > | prepareMedia (const zypp::MirroredOrigin &origin, const ProvideMediaSpec &request)
expected< LazyMediaHandle > | prepareMedia (const zypp::Url &url, const ProvideMediaSpec &request)
expected< MediaHandle > | attachMediaIfNeeded (LazyMediaHandle lazyHandle)
expected< MediaHandle > | attachMedia (const zypp::MirroredOrigin &origin, const ProvideMediaSpec &request)
expected< MediaHandle > | attachMedia (const zypp::Url &url, const ProvideMediaSpec &request)
expected< Res > | provide (const zypp::MirroredOrigin &origin, const ProvideFileSpec &request)
expected< Res > | provide (const zypp::Url &url, const ProvideFileSpec &request)
expected< Res > | provide (const MediaHandle &attachHandle, const zypp::Pathname &fileName, const ProvideFileSpec &request)
expected< Res > | provide (const LazyMediaHandle &attachHandle, const zypp::Pathname &fileName, const ProvideFileSpec &request)
expected< zypp::CheckSum > | checksumForFile (const zypp::Pathname &p, const std::string &algorithm)
expected< zypp::ManagedFile > | copyFile (const zypp::Pathname &source, const zypp::Pathname &target)
expected< zypp::ManagedFile > | copyFile (Res source, const zypp::Pathname &target)
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 >, connection > | connectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers)

## Static Public Member Functions
static auto | copyResultToDest (MediaSyncFacadeRef provider, const zypp::Pathname &targetPath)
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)

## Protected Member Functions
void | releaseMedium (const AttachedSyncMediaInfo *ptr)
Protected Member Functions inherited from zyppng::Base
| Base (BasePrivate &dd)

## Private Member Functions
zypp::MirroredOrigin | sanitizeUrls (const zypp::MirroredOrigin &origin) const

## Private Attributes
std::vector< AttachedSyncMediaInfo_Ptr > | _attachedMedia

## Friends
class | AttachedSyncMediaInfo

## Additional Inherited Members
Protected Attributes inherited from zyppng::Base
std::unique_ptr< BasePrivate > | d_ptr

## Detailed Description

A Facade class that mimics the behavior of the Provide class just in a sync way. Meaning every operation will finish immediately instead of returning a AsyncOp.

Definition at line 48 of file mediafacade.h.

## Member Typedef Documentation

## ◆ MediaHandle

using zyppng::MediaSyncFacade::MediaHandle = SyncMediaHandle

Definition at line 55 of file mediafacade.h.

## ◆ LazyMediaHandle

using zyppng::MediaSyncFacade::LazyMediaHandle = ::zyppng::LazyMediaHandle<MediaSyncFacade>

Definition at line 56 of file mediafacade.h.

## Constructor & Destructor Documentation

## ◆ ~MediaSyncFacade()

zyppng::MediaSyncFacade::~MediaSyncFacade | ( |  | ) |
| override

Definition at line 380 of file mediafacade.cc.

## Member Function Documentation

## ◆ ZYPP_DECL_PRIVATE_CONSTR()

zyppng::MediaSyncFacade::ZYPP_DECL_PRIVATE_CONSTR | ( | MediaSyncFacade |  | ) |

## ◆ prepareMedia() [1/2]

expected< MediaSyncFacade::LazyMediaHandle > zyppng::MediaSyncFacade::prepareMedia | ( | const zypp::MirroredOrigin & | origin,
|  | const ProvideMediaSpec & | request )

Definition at line 389 of file mediafacade.cc.

## ◆ prepareMedia() [2/2]

expected< MediaSyncFacade::LazyMediaHandle > zyppng::MediaSyncFacade::prepareMedia | ( | const zypp::Url & | url,
|  | const ProvideMediaSpec & | request )

Definition at line 397 of file mediafacade.cc.

## ◆ attachMediaIfNeeded()

expected< MediaSyncFacade::MediaHandle > zyppng::MediaSyncFacade::attachMediaIfNeeded | ( | LazyMediaHandle | lazyHandle | ) |

Definition at line 402 of file mediafacade.cc.

## ◆ attachMedia() [1/2]

expected< MediaSyncFacade::MediaHandle > zyppng::MediaSyncFacade::attachMedia | ( | const zypp::MirroredOrigin & | origin,
|  | const ProvideMediaSpec & | request )

Definition at line 186 of file mediafacade.cc.

## ◆ attachMedia() [2/2]

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

Definition at line 181 of file mediafacade.cc.

## ◆ provide() [1/4]

expected< MediaSyncFacade::Res > zyppng::MediaSyncFacade::provide | ( | const zypp::MirroredOrigin & | origin,
|  | const ProvideFileSpec & | request )

Definition at line 417 of file mediafacade.cc.

## ◆ provide() [2/4]

expected< MediaSyncFacade::Res > zyppng::MediaSyncFacade::provide | ( | const zypp::Url & | url,
|  | const ProvideFileSpec & | request )

Definition at line 454 of file mediafacade.cc.

## ◆ provide() [3/4]

expected< MediaSyncFacade::Res > zyppng::MediaSyncFacade::provide | ( | const MediaHandle & | attachHandle,
|  | const zypp::Pathname & | fileName,
|  | const ProvideFileSpec & | request )

Definition at line 459 of file mediafacade.cc.

## ◆ provide() [4/4]

expected< MediaSyncFacade::Res > zyppng::MediaSyncFacade::provide | ( | const LazyMediaHandle & | attachHandle,
|  | const zypp::Pathname & | fileName,
|  | const ProvideFileSpec & | request )

Definition at line 495 of file mediafacade.cc.

## ◆ checksumForFile()

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

Schedules a job to calculate the checksum for the given file

Definition at line 507 of file mediafacade.cc.

## ◆ copyFile() [1/2]

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

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

Definition at line 516 of file mediafacade.cc.

## ◆ copyFile() [2/2]

expected< zypp::ManagedFile > zyppng::MediaSyncFacade::copyFile | ( | Res | source,
|  | const zypp::Pathname & | target )

Definition at line 541 of file mediafacade.cc.

## ◆ copyResultToDest()

auto zyppng::MediaSyncFacade::copyResultToDest | ( | MediaSyncFacadeRef | provider,
|  | const zypp::Pathname & | targetPath )
| inline static

Definition at line 109 of file mediafacade.h.

## ◆ releaseMedium()

void zyppng::MediaSyncFacade::releaseMedium | ( | const AttachedSyncMediaInfo * | ptr | ) |
| protected

Definition at line 547 of file mediafacade.cc.

## ◆ sanitizeUrls()

zypp::MirroredOrigin zyppng::MediaSyncFacade::sanitizeUrls | ( | const zypp::MirroredOrigin & | origin | ) | const
| private

Definition at line 156 of file mediafacade.cc.

## Friends And Related Symbol Documentation

## ◆ AttachedSyncMediaInfo

friend class AttachedSyncMediaInfo
| friend

Definition at line 53 of file mediafacade.h.

## Member Data Documentation

## ◆ _attachedMedia

std::vector<AttachedSyncMediaInfo_Ptr> zyppng::MediaSyncFacade::_attachedMedia
| private

Definition at line 121 of file mediafacade.h.

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

- zypp/ng/workflows/mediafacade.h
- zypp/ng/workflows/mediafacade.cc