libzypp 17.37.10

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
24 namespace zypp
25{
27 namespace repo
28 {
29
34 class ZYPP_API PackageProviderPolicy
35 {
36 public:
38 typedef function<bool ( const std::string &, const Edition &, const Arch & )> QueryInstalledCB;
39
41 PackageProviderPolicy & queryInstalledCB( QueryInstalledCB queryInstalledCB_r )
42 { _queryInstalledCB = queryInstalledCB_r; return *this; }
43
45 bool queryInstalled( const std::string & name_r,
46 const Edition & ed_r,
47 const Arch & arch_r ) const;
48
49 private:
50 QueryInstalledCB _queryInstalledCB;
51 };
52
53
60 class ZYPP_API PackageProvider
61 {
62 public:
66 PackageProvider( RepoMediaAccess & access, const PoolItem & pi_r,
67 PackageProviderPolicy policy_r = PackageProviderPolicy() );
68
72 PackageProvider( RepoMediaAccess & access, const PoolItem & pi_r,
73 DeltaCandidates deltas,
74 PackageProviderPolicy policy_r = PackageProviderPolicy() );
75
77 PackageProvider( RepoMediaAccess & access,
78 Package::constPtr package,
79 DeltaCandidates deltas,
80 PackageProviderPolicy policy_r = PackageProviderPolicy() );
81
82 ~PackageProvider();
83
84 public:
88 ManagedFile providePackage() const;
89
91 ManagedFile providePackageFromCache() const;
92
94 bool isCached() const;
95
96 public:
97 struct Impl;
98 private:
99 RW_pointer<Impl> _pimpl;
100 };
101
102
103 } // namespace repo
105} // namespace zypp
107#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:61
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:35
zypp::repo::PackageProviderPolicy::QueryInstalledCB
function< bool(const std::string &, const Edition &, const Arch &)> QueryInstalledCB
Get installed Editions callback signature.
Definition PackageProvider.h:38
zypp::repo::PackageProviderPolicy::_queryInstalledCB
QueryInstalledCB _queryInstalledCB
Definition PackageProvider.h:50
zypp::repo::PackageProviderPolicy::queryInstalledCB
PackageProviderPolicy & queryInstalledCB(QueryInstalledCB queryInstalledCB_r)
Set callback.
Definition PackageProvider.h:41
zypp::repo::PackageProvider::_pimpl
RW_pointer< Impl > _pimpl
Implementation class.
Definition PackageProvider.h:99
zypp::repo::PackageProvider::PackageProvider
PackageProvider(RepoMediaAccess &access, const PoolItem &pi_r, PackageProviderPolicy policy_r=PackageProviderPolicy())
Ctor taking the package to provide.
Definition PackageProvider.cc:699
zypp::repo::PackageProvider::providePackage
ManagedFile providePackage() const
Provide the package.
Definition PackageProvider.cc:715
zypp::repo::PackageProvider::isCached
bool isCached() const
Whether the package is cached.
Definition PackageProvider.cc:721
zypp::repo::PackageProvider::providePackageFromCache
ManagedFile providePackageFromCache() const
Provide the package if it is cached.
Definition PackageProvider.cc:718
zypp::repo::RepoMediaAccess
Provides files from different repos.
Definition RepoProvideFile.h:62
zypp::repo
Definition DeltaCandidates.cc:30
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::repo::PackageProvider::Impl
PackageProvider implementation interface.
Definition PackageProvider.cc:86
ManagedFile.h