libzypp 17.37.17
downloadwf.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#ifndef ZYPP_NG_WORKFLOWS_DOWNLOAD_INCLUDED
10#define ZYPP_NG_WORKFLOWS_DOWNLOAD_INCLUDED
11
12#include <zypp-core/zyppng/pipelines/AsyncResult>
13#include <zypp-core/zyppng/pipelines/Expected>
15
16namespace zyppng {
17
21
23 class SyncMediaHandle;
24 class ProvideFileSpec;
25
26 template<typename ZyppContextRefType>
28 {
29 protected:
31 public:
32 using ContextRefType = ZyppContextRefType;
33 using ContextType = typename ZyppContextRefType::element_type;
34 using ProvideType = typename ContextType::ProvideType;
35 using MediaHandle = typename ProvideType::MediaHandle;
36
38
40 const zypp::Pathname &destDir() const;
41
42 void addCacheDir( const zypp::Pathname &p );
43 const std::vector<zypp::Pathname> &cacheDirs() const;
44
45
46 protected:
49 std::vector<zypp::Pathname> _cacheDirs;
50 };
51
56
57 namespace DownloadWorkflow {
58 AsyncOpRef<expected<zypp::ManagedFile>> provideToCacheDir( AsyncCacheProviderContextRef cacheContext, ProvideMediaHandle medium, zypp::Pathname file, ProvideFileSpec filespec );
59 expected<zypp::ManagedFile> provideToCacheDir( SyncCacheProviderContextRef cacheContext, SyncMediaHandle medium, zypp::Pathname file, ProvideFileSpec filespec );
60 }
61
62}
63
64
65#endif // ZYPP_NG_WORKFLOWS_DOWNLOAD_INCLUDED
const zypp::Pathname & destDir() const
typename ContextType::ProvideType ProvideType
Definition downloadwf.h:34
ZYPP_DECL_PRIVATE_CONSTR_ARGS(CacheProviderContext, ZyppContextRefType zyppContext, zypp::Pathname destDir)
const ContextRefType & zyppContext() const
typename ProvideType::MediaHandle MediaHandle
Definition downloadwf.h:35
std::vector< zypp::Pathname > _cacheDirs
Definition downloadwf.h:49
typename ZyppContextRefType::element_type ContextType
Definition downloadwf.h:33
ZyppContextRefType ContextRefType
Definition downloadwf.h:32
void addCacheDir(const zypp::Pathname &p)
Definition downloadwf.cc:48
const std::vector< zypp::Pathname > & cacheDirs() const
Definition downloadwf.cc:54
AsyncOpRef< expected< zypp::ManagedFile > > provideToCacheDir(AsyncCacheProviderContextRef cacheContext, ProvideMediaHandle medium, zypp::Pathname file, ProvideFileSpec filespec)
std::shared_ptr< AsyncOp< T > > AsyncOpRef
Definition asyncop.h:255
CacheProviderContext< SyncContextRef > SyncCacheProviderContext
Definition downloadwf.h:53
CacheProviderContext< ContextRef > AsyncCacheProviderContext
Definition downloadwf.h:52
#define ZYPP_FWD_DECL_REFS(T)
Definition zyppglobal.h:119
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:126