1
/*---------------------------------------------------------------------\
3
| |__ / \ / / . \ . \ |
8
\---------------------------------------------------------------------*/
9
/** \file zypp/target/CommitPackageCache.h
12
#ifndef ZYPP_TARGET_COMMITPACKAGECACHE_H
13
#define ZYPP_TARGET_COMMITPACKAGECACHE_H
17
#include "zypp/base/PtrTypes.h"
18
#include "zypp/base/Function.h"
20
#include "zypp/PoolItem.h"
21
#include "zypp/Pathname.h"
22
#include "zypp/ManagedFile.h"
24
///////////////////////////////////////////////////////////////////
26
{ /////////////////////////////////////////////////////////////////
27
///////////////////////////////////////////////////////////////////
29
{ /////////////////////////////////////////////////////////////////
31
///////////////////////////////////////////////////////////////////
33
// CLASS NAME : CommitPackageCache
35
/** Target::commit helper optimizing package provision.
37
class CommitPackageCache
39
friend std::ostream & operator<<( std::ostream & str, const CommitPackageCache & obj );
42
typedef function<ManagedFile( const PoolItem & pi, bool fromCache_r )> PackageProvider;
46
CommitPackageCache( const Pathname & rootDir_r,
47
const PackageProvider & packageProvider_r );
50
~CommitPackageCache();
53
/** Download(commit) sequence of solvables to compute read ahead. */
54
void setCommitList( std::vector<sat::Solvable> commitList_r );
56
template <class _Iterator>
57
void setCommitList( _Iterator begin_r, _Iterator end_r )
58
{ setCommitList( std::vector<sat::Solvable>( begin_r, end_r ) ); }
60
/** Provide a package. */
61
ManagedFile get( const PoolItem & citem_r );
63
ManagedFile get( sat::Solvable citem_r )
64
{ return get( PoolItem(citem_r) ); }
67
/** Implementation. */
69
/** Ctor taking an implementation. */
70
explicit CommitPackageCache( Impl * pimpl_r );
72
/** Pointer to implementation. */
73
RW_pointer<Impl> _pimpl;
75
///////////////////////////////////////////////////////////////////
77
/** \relates CommitPackageCache Stream output */
78
std::ostream & operator<<( std::ostream & str, const CommitPackageCache & obj );
80
/////////////////////////////////////////////////////////////////
82
///////////////////////////////////////////////////////////////////
83
/////////////////////////////////////////////////////////////////
85
///////////////////////////////////////////////////////////////////
86
#endif // ZYPP_TARGET_COMMITPACKAGECACHE_H