libzypp
11.13.5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
PackageProvider.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_REPO_PACKAGEPROVIDER_H
13
#define ZYPP_REPO_PACKAGEPROVIDER_H
14
15
#include <iosfwd>
16
17
#include "
zypp/base/NonCopyable.h
"
18
19
#include "
zypp/ZYppCallbacks.h
"
20
#include "
zypp/Package.h
"
21
#include "
zypp/ManagedFile.h
"
22
#include "
zypp/repo/RepoProvideFile.h
"
23
#include "
zypp/repo/DeltaCandidates.h
"
24
26
namespace
zypp
27
{
28
29
namespace
repo
30
{
31
33
//
34
// CLASS NAME : PackageProviderPolicy
35
//
37
class
PackageProviderPolicy
38
{
39
public
:
41
typedef
function<bool ( const std::string &, const Edition &, const Arch & )>
QueryInstalledCB
;
42
44
PackageProviderPolicy
&
queryInstalledCB
(
QueryInstalledCB
queryInstalledCB_r )
45
{
_queryInstalledCB
= queryInstalledCB_r;
return
*
this
; }
46
48
bool
queryInstalled
(
const
std::string & name_r,
49
const
Edition
& ed_r,
50
const
Arch
& arch_r )
const
;
51
52
private
:
53
QueryInstalledCB
_queryInstalledCB
;
54
};
56
58
//
59
// CLASS NAME : PackageProvider
60
//
64
class
PackageProvider
:
private
base::NonCopyable
65
{
66
typedef
shared_ptr<void>
ScopedGuard
;
67
typedef
callback::SendReport<repo::DownloadResolvableReport>
Report
;
68
69
typedef
packagedelta::DeltaRpm
DeltaRpm
;
70
71
public
:
73
PackageProvider
(
RepoMediaAccess
&access,
74
const
Package::constPtr
& package,
75
const
DeltaCandidates
& deltas,
76
const
PackageProviderPolicy
& policy_r =
PackageProviderPolicy
() );
77
~PackageProvider
();
78
79
public
:
83
ManagedFile
providePackage
()
const
;
84
85
private
:
86
ManagedFile
doProvidePackage
()
const
;
87
ManagedFile
tryDelta
(
const
DeltaRpm
& delta_r )
const
;
88
89
private
:
90
ScopedGuard
newReport
()
const
;
91
Report
&
report
()
const
;
92
bool
progressDeltaDownload
(
int
value )
const
;
93
void
progressDeltaApply
(
int
value )
const
;
94
bool
progressPackageDownload
(
int
value )
const
;
95
bool
failOnChecksumError
()
const
;
96
bool
queryInstalled
(
const
Edition
& ed_r =
Edition
() )
const
;
97
98
private
:
99
PackageProviderPolicy
_policy
;
100
Package::constPtr
_package
;
101
mutable
bool
_retry
;
102
mutable
shared_ptr<Report>
_report
;
103
DeltaCandidates
_deltas
;
104
RepoMediaAccess
&
_access
;
105
};
107
109
}
// namespace repo
112
}
// namespace zypp
114
#endif // ZYPP_SOURCE_PACKAGEPROVIDER_H
zypp
repo
PackageProvider.h
Generated by
1.8.1