libzypp 17.37.10

CommitPackageCache.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_TARGET_COMMITPACKAGECACHE_H
13#define ZYPP_TARGET_COMMITPACKAGECACHE_H
14
15#include <iosfwd>
16
17#include <zypp/base/PtrTypes.h>
18#include <zypp/base/Function.h>
19
20#include <zypp/PoolItem.h>
21#include <zypp/Pathname.h>
22#include <zypp/ManagedFile.h>
23
25 namespace zypp
26{
28 namespace target
29 {
30
38 class ZYPP_API RepoProvidePackage
39 {
40 public:
41 RepoProvidePackage();
42 ~RepoProvidePackage();
43
45 ManagedFile operator()( const PoolItem & pi, bool fromCache_r );
46
47 private:
48 struct Impl;
49 RW_pointer<Impl> _impl;
50 };
51
53 //
54 // CLASS NAME : CommitPackageCache
55 //
58 class ZYPP_API CommitPackageCache
59 {
60 friend std::ostream & operator<<( std::ostream & str, const CommitPackageCache & obj );
61
62 public:
63 using PackageProvider = function<ManagedFile (const PoolItem &, bool)>;
64
65 public:
67 CommitPackageCache(PackageProvider packageProvider_r = RepoProvidePackage() );
68
72 CommitPackageCache( const Pathname & /*rootDir_r*/, const PackageProvider & packageProvider_r = RepoProvidePackage() ) ZYPP_DEPRECATED;
73
75 ~CommitPackageCache();
76
77 public:
79 void setCommitList( std::vector<sat::Solvable> commitList_r );
81 template <class TIterator>
82 void setCommitList( TIterator begin_r, TIterator end_r )
83 { setCommitList( std::vector<sat::Solvable>( begin_r, end_r ) ); }
84
86 ManagedFile get( const PoolItem & citem_r );
88 ManagedFile get( sat::Solvable citem_r )
89 { return get( PoolItem(citem_r) ); }
90
95 bool preloaded() const;
97 void preloaded( bool newval_r );
98
99 public:
101 class Impl;
103 explicit CommitPackageCache( Impl * pimpl_r );
104 private:
106 RW_pointer<Impl> _pimpl;
107 };
108
109
111 std::ostream & operator<<( std::ostream & str, const CommitPackageCache & obj );
112
114 } // namespace target
117} // namespace zypp
119#endif // ZYPP_TARGET_COMMITPACKAGECACHE_H
operator<<
std::ostream & operator<<(std::ostream &str, const zypp::sat::detail::CDataiterator *obj)
Definition LookupAttr.cc:808
PoolItem.h
Impl
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition Solvable.h:54
zypp::target::CommitPackageCache
Target::commit helper optimizing package provision.
Definition CommitPackageCache.h:59
zypp::target::CommitPackageCache::CommitPackageCache
CommitPackageCache(PackageProvider packageProvider_r=RepoProvidePackage())
Ctor.
Definition CommitPackageCache.cc:121
zypp::target::CommitPackageCache::get
ManagedFile get(sat::Solvable citem_r)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition CommitPackageCache.h:88
zypp::target::CommitPackageCache::setCommitList
void setCommitList(std::vector< sat::Solvable > commitList_r)
Download(commit) sequence of solvables to compute read ahead.
Definition CommitPackageCache.cc:143
zypp::target::CommitPackageCache::PackageProvider
function< ManagedFile(const PoolItem &, bool)> PackageProvider
Definition CommitPackageCache.h:63
zypp::target::CommitPackageCache::_pimpl
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition CommitPackageCache.h:106
zypp::target::CommitPackageCache::get
ManagedFile get(const PoolItem &citem_r)
Provide a package.
Definition CommitPackageCache.cc:146
zypp::target::RepoProvidePackage
Default PackageProvider for CommitPackageCache.
Definition CommitPackageCache.h:39
zypp::target::RepoProvidePackage::RepoProvidePackage
RepoProvidePackage()
Definition CommitPackageCache.cc:76
zypp::target::RepoProvidePackage::_impl
RW_pointer< Impl > _impl
Definition CommitPackageCache.h:49
zypp::target::RepoProvidePackage::operator()
ManagedFile operator()(const PoolItem &pi, bool fromCache_r)
Provide package optionally fron cache only.
Definition CommitPackageCache.cc:87
std
Definition Arch.h:364
str
String related utilities and Regular expression matching.
zypp::sat
Definition Resolver.h:28
zypp::target
Definition KeyRing.h:325
zypp::target::operator<<
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
Definition CommitPackageCache.cc:160
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::ManagedFile
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
Definition ManagedFile.h:27
zypp::ZYPP_API
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
zypp::target::RepoProvidePackage::Impl
Definition CommitPackageCache.cc:70
ZYPP_DEPRECATED
#define ZYPP_DEPRECATED
The ZYPP_DEPRECATED macro can be used to trigger compile-time warnings with gcc >= 3....
Definition Globals.h:112
ManagedFile.h
Pathname.h
Function.h
PtrTypes.h