libzypp  17.28.5
ZYppImpl.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_ZYPP_DETAIL_ZYPPIMPL_H
13 #define ZYPP_ZYPP_DETAIL_ZYPPIMPL_H
14 
15 #include <iosfwd>
16 
17 #include <zypp/TmpPath.h>
18 #include <zypp/Target.h>
19 #include <zypp/Resolver.h>
20 #include <zypp/KeyRing.h>
21 #include <zypp/ZYppCommit.h>
22 #include <zypp/ResTraits.h>
23 #include <zypp/DiskUsageCounter.h>
24 #include <zypp/ManagedFile.h>
25 
27 namespace zypp
28 {
29  namespace zypp_detail
31  {
32 
34  //
35  // CLASS NAME : ZYppImpl
36  //
38  class ZYppImpl
39  {
40  friend std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj );
41 
42  public:
44  ZYppImpl();
46  ~ZYppImpl();
47 
48  public:
50  ResPool pool() const
51  { return ResPool::instance(); }
52 
54  { return ResPool::instance().proxy(); }
55 
57  KeyRing_Ptr keyRing() const
58  { return _keyring; }
59 
60 
61  Resolver_Ptr resolver() const
62  { return _resolver; }
63 
64  public:
69  Target_Ptr target() const;
70 
75  { return _target; }
76 
81  void initializeTarget( const Pathname & root, bool doRebuild_r );
82 
86  void finishTarget();
87 
89  ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
90 
92  void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
93 
95  ManagedFile provideSrcPackage( const SrcPackage_constPtr & srcPackage_r );
96 
97  public:
99  Pathname homePath() const;
100 
102  Pathname tmpPath() const;
103 
105  void setHomePath( const Pathname & path );
106 
107  public:
111 
112  private:
116  Resolver_Ptr _resolver;
117 
118  KeyRing_Ptr _keyring;
122  shared_ptr<DiskUsageCounter> _disk_usage;
123  };
125 
127  std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj );
128 
130  } // namespace zypp_detail
133 } // namespace zypp
135 #endif // ZYPP_ZYPP_DETAIL_ZYPPIMPL_H
Target_Ptr target() const
Definition: ZYppImpl.cc:114
KeyRing_Ptr keyRing() const
Definition: ZYppImpl.h:57
ResPoolProxy proxy() const
preliminary
Definition: ResPool.cc:58
void setHomePath(const Pathname &path)
set the home, if you need to change it
Definition: ZYppImpl.cc:209
Result returned from ZYpp::commit.
String related utilities and Regular expression matching.
DiskUsageCounter::MountPointSet diskUsage()
Definition: ZYppImpl.cc:88
Resolver_Ptr resolver() const
Definition: ZYppImpl.h:61
DiskUsageCounter::MountPointSet getPartitions() const
Definition: ZYppImpl.cc:103
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:34
ResPoolProxy poolProxy() const
Definition: ZYppImpl.h:53
void initializeTarget(const Pathname &root, bool doRebuild_r)
Definition: ZYppImpl.cc:121
std::set< MountPoint > MountPointSet
shared_ptr< DiskUsageCounter > _disk_usage
defined mount points, used for disk usage counting
Definition: ZYppImpl.h:122
ZYppCommitResult commit(const ZYppCommitPolicy &policy_r)
Commit changes and transactions.
Definition: ZYppImpl.cc:150
ZYppImpl()
Default ctor.
Definition: ZYppImpl.cc:67
Options and policies for ZYpp::commit.
Pathname tmpPath() const
Get the path where zypp related plugins store tmp data.
Definition: ZYppImpl.cc:212
void installSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Install a source package on the Target.
Definition: ZYppImpl.cc:189
Pathname homePath() const
Get the path where zypp related plugins store persistent data and caches.
Definition: ZYppImpl.cc:206
std::ostream & operator<<(std::ostream &str, const ZYppImpl &obj)
Definition: ZYppImpl.cc:220
Global ResObject pool.
Definition: ResPool.h:60
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition: AutoDispose.h:92
Target_Ptr getTarget() const
Same as target but returns NULL if target is not initialized, instead of throwing.
Definition: ZYppImpl.h:74
friend std::ostream & operator<<(std::ostream &str, const ZYppImpl &obj)
Definition: ZYppImpl.cc:220
ResPool pool() const
Definition: ZYppImpl.h:50
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
void setPartitions(const DiskUsageCounter::MountPointSet &mp)
Definition: ZYppImpl.cc:97
ManagedFile provideSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Install a source package on the Target.
Definition: ZYppImpl.cc:196
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:37