libzypp: zypp/repo/PackageProvider.h Source File

libzypp 17.38.11

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/ZYppCallbacks.h>
18#include <zypp/Package.h>
19#include <zypp/ManagedFile.h>
20#include <zypp/repo/DeltaCandidates.h>
21#include <zypp/repo/RepoProvideFile.h>
22
24namespace zypp
25{
27 namespace repo
28 {
33 class ZYPP_API PackageProviderPolicy
34 {
35 public:
37 typedef function<bool ( const std::string &, const Edition &, const Arch & )> QueryInstalledCB;
38
40 PackageProviderPolicy & queryInstalledCB( QueryInstalledCB queryInstalledCB_r )
41 { _queryInstalledCB = queryInstalledCB_r; return *this; }
42
44 bool queryInstalled( const std::string & name_r,
45 const Edition & ed_r,
46 const Arch & arch_r ) const;
47
48 private:
49 QueryInstalledCB _queryInstalledCB;
50 };
51
52
59 class ZYPP_API PackageProvider
60 {
61 public:
65 PackageProvider( RepoMediaAccess & access, const PoolItem & pi_r,
66 PackageProviderPolicy policy_r = PackageProviderPolicy() );
67
71 PackageProvider( RepoMediaAccess & access, const PoolItem & pi_r,
72 DeltaCandidates deltas,
73 PackageProviderPolicy policy_r = PackageProviderPolicy() );
74
76 PackageProvider( RepoMediaAccess & access,
77 Package::constPtr package,
78 DeltaCandidates deltas,
79 PackageProviderPolicy policy_r = PackageProviderPolicy() );
80
81 ~PackageProvider();
82
83 public:
87 ManagedFile providePackage() const;
88
90 ManagedFile providePackageFromCache() const;
91
93 bool isCached() const;
94
95 public:
96 struct Impl;
97 private:
98 RW_pointer<Impl> _pimpl;
99 };
100
101
102 } // namespace repo
104} // namespace zypp
106#endif // ZYPP_SOURCE_PACKAGEPROVIDER_H
DeltaCandidates.h
Package.h
RepoProvideFile.h
ZYppCallbacks.h
bool
zypp::Arch
Architecture.
Definition Arch.h:37
zypp::Edition
Edition represents [epoch:]version[-release].
Definition Edition.h:60
zypp::Package::constPtr
TraitsType::constPtrType constPtr
Definition Package.h:39
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
zypp::repo::DeltaCandidates
Candidate delta and patches for a package.
Definition DeltaCandidates.h:37
zypp::repo::PackageProviderPolicy
Policies and options for PackageProvider.
Definition PackageProvider.h:34
zypp::repo::PackageProviderPolicy::QueryInstalledCB
function< bool(const std::string &, const Edition &, const Arch &)> QueryInstalledCB
Get installed Editions callback signature.
Definition PackageProvider.h:37
zypp::repo::PackageProviderPolicy::_queryInstalledCB
QueryInstalledCB _queryInstalledCB
Definition PackageProvider.h:49
zypp::repo::PackageProviderPolicy::queryInstalledCB
PackageProviderPolicy & queryInstalledCB(QueryInstalledCB queryInstalledCB_r)
Set callback.
Definition PackageProvider.h:40
zypp::repo::PackageProvider::_pimpl
RW_pointer< Impl > _pimpl
Implementation class.
Definition PackageProvider.h:98
zypp::repo::PackageProvider::PackageProvider
PackageProvider(RepoMediaAccess &access, const PoolItem &pi_r, PackageProviderPolicy policy_r=PackageProviderPolicy())
Ctor taking the package to provide.
Definition PackageProvider.cc:700
zypp::repo::PackageProvider::providePackage
ManagedFile providePackage() const
Provide the package.
Definition PackageProvider.cc:716
zypp::repo::PackageProvider::isCached
bool isCached() const
Whether the package is cached.
Definition PackageProvider.cc:722
zypp::repo::PackageProvider::providePackageFromCache
ManagedFile providePackageFromCache() const
Provide the package if it is cached.
Definition PackageProvider.cc:719
zypp::repo::RepoMediaAccess
Provides files from different repos.
Definition RepoProvideFile.h:73
zypp::repo
Definition DeltaCandidates.cc:30
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_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
zypp::repo::PackageProvider::Impl
PackageProvider implementation interface.
Definition PackageProvider.cc:87
ManagedFile.h