libzypp  17.34.1
zyppng::MediaSyncFacade Class Reference

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

Inheritance diagram for zyppng::MediaSyncFacade:

Classes

class  Res
 

Public Types

using MediaHandle = SyncMediaHandle
 
- 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< MediaHandleattachMedia (const std::vector< zypp::Url > &urls, const ProvideMediaSpec &request)
 
expected< MediaHandleattachMedia (const zypp::Url &url, const ProvideMediaSpec &request)
 
expected< Resprovide (const std::vector< zypp::Url > &urls, const ProvideFileSpec &request)
 
expected< Resprovide (const zypp::Url &url, const ProvideFileSpec &request)
 
expected< Resprovide (const MediaHandle &attachHandle, const zypp::Pathname &fileName, const ProvideFileSpec &request)
 
expected< zypp::CheckSumchecksumForFile (const zypp::Pathname &p, const std::string &algorithm)
 
expected< zypp::ManagedFilecopyFile (const zypp::Pathname &source, const zypp::Pathname &target)
 
expected< zypp::ManagedFilecopyFile (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 >, connectionconnectFunc (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_ADD_CREATE_FUNC (MediaSyncFacade)
 

Private Attributes

std::vector< AttachedSyncMediaInfo_Ptr > _attachedMedia
 

Friends

class AttachedSyncMediaInfo
 

Additional Inherited Members

- Protected Attributes inherited from zyppng::Base
std::unique_ptr< BasePrivated_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 returns a AsyncOp.

Definition at line 47 of file mediafacade.h.

Member Typedef Documentation

◆ MediaHandle

Constructor & Destructor Documentation

◆ ~MediaSyncFacade()

zyppng::MediaSyncFacade::~MediaSyncFacade ( )
override

Definition at line 208 of file mediafacade.cc.

Member Function Documentation

◆ ZYPP_ADD_CREATE_FUNC()

zyppng::MediaSyncFacade::ZYPP_ADD_CREATE_FUNC ( MediaSyncFacade  )
private

◆ ZYPP_DECL_PRIVATE_CONSTR()

zyppng::MediaSyncFacade::ZYPP_DECL_PRIVATE_CONSTR ( MediaSyncFacade  )

◆ attachMedia() [1/2]

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

Definition at line 151 of file mediafacade.cc.

◆ attachMedia() [2/2]

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

Definition at line 217 of file mediafacade.cc.

◆ provide() [1/3]

expected< MediaSyncFacade::Res > zyppng::MediaSyncFacade::provide ( const std::vector< zypp::Url > &  urls,
const ProvideFileSpec request 
)

Definition at line 222 of file mediafacade.cc.

◆ provide() [2/3]

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

Definition at line 259 of file mediafacade.cc.

◆ provide() [3/3]

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

Definition at line 264 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 300 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 309 of file mediafacade.cc.

◆ copyFile() [2/2]

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

Definition at line 334 of file mediafacade.cc.

◆ copyResultToDest()

static auto zyppng::MediaSyncFacade::copyResultToDest ( MediaSyncFacadeRef  provider,
const zypp::Pathname targetPath 
)
inlinestatic

Definition at line 102 of file mediafacade.h.

◆ releaseMedium()

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

Definition at line 340 of file mediafacade.cc.

Friends And Related Function Documentation

◆ AttachedSyncMediaInfo

friend class AttachedSyncMediaInfo
friend

Definition at line 52 of file mediafacade.h.

Member Data Documentation

◆ _attachedMedia

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

Definition at line 113 of file mediafacade.h.


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