libzypp  16.1.1
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"
22 
24 namespace zypp
25 {
27  namespace repo
28  {
29 
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  };
53 
61  {
62  public:
65  const Package::constPtr & package,
66  const DeltaCandidates & deltas,
67  const PackageProviderPolicy & policy_r = PackageProviderPolicy() );
68  ~PackageProvider();
69 
70  public:
74  ManagedFile providePackage() const;
75 
77  ManagedFile providePackageFromCache() const;
78 
80  bool isCached() const;
81 
82  public:
83  class Impl;
84  private:
86  };
88 
89  } // namespace repo
91 } // namespace zypp
93 #endif // ZYPP_SOURCE_PACKAGEPROVIDER_H
Candidate delta and patches for a package.
PackageProvider implementation.
PackageProviderPolicy & queryInstalledCB(QueryInstalledCB queryInstalledCB_r)
Set callback.
Architecture.
Definition: Arch.h:36
Policies and options for PackageProvider.
Edition represents [epoch:]version[-release]
Definition: Edition.h:60
function< bool(const std::string &, const Edition &, const Arch &)> QueryInstalledCB
Get installed Editions callback signature.
RW_pointer< Impl > _pimpl
Implementation class.
Provides files from different repos.
Provide a package from a Repo.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition: AutoDispose.h:92
bool queryInstalled(const std::string &name_r, const Edition &ed_r, const Arch &arch_r) const
Evaluate callback.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
TraitsType::constPtrType constPtr
Definition: Package.h:38