libzypp 17.38.5

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-core/base/PtrTypes.h>
18#include <zypp-core/base/Function.h>
19
20#include <zypp/PoolItem.h>
21#include <zypp-core/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
70 ~CommitPackageCache();
71
72 public:
74 void setCommitList( std::vector<sat::Solvable> commitList_r );
76 template <class TIterator>
77 void setCommitList( TIterator begin_r, TIterator end_r )
78 { setCommitList( std::vector<sat::Solvable>( begin_r, end_r ) ); }
79
81 ManagedFile get( const PoolItem & citem_r );
83 ManagedFile get( sat::Solvable citem_r )
84 { return get( PoolItem(citem_r) ); }
85
90 bool preloaded() const;
92 void preloaded( bool newval_r );
93
94 public:
96 class Impl;
98 explicit CommitPackageCache( Impl * pimpl_r );
99 private:
101 RW_pointer<Impl> _pimpl;
102 };
103
104
106 std::ostream & operator<<( std::ostream & str, const CommitPackageCache & obj );
107
109 } // namespace target
112} // namespace zypp
114#endif // ZYPP_TARGET_COMMITPACKAGECACHE_H
Function.h
operator<<
std::ostream & operator<<(std::ostream &str, const zypp::sat::detail::CDataiterator *obj)
Definition LookupAttr.cc:808
Pathname.h
PoolItem.h
PtrTypes.h
Impl
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
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:83
zypp::target::CommitPackageCache::setCommitList
void setCommitList(std::vector< sat::Solvable > commitList_r)
Download(commit) sequence of solvables to compute read ahead.
Definition CommitPackageCache.cc:138
zypp::target::CommitPackageCache::setCommitList
void setCommitList(TIterator begin_r, TIterator end_r)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition CommitPackageCache.h:77
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:101
zypp::target::CommitPackageCache::get
ManagedFile get(const PoolItem &citem_r)
Provide a package.
Definition CommitPackageCache.cc:141
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
str
String related utilities and Regular expression matching.
zypp::target
Definition KeyRing.h:325
zypp::target::operator<<
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
Definition CommitPackageCache.cc:155
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
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
ManagedFile.h