libzypp  17.30.0
ZYpp.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_ZYPP_H
13 #define ZYPP_ZYPP_H
14 
15 #include <iosfwd>
16 
17 #include <zypp/base/NonCopyable.h>
18 #include <zypp/base/PtrTypes.h>
19 #include <zypp/APIConfig.h>
20 
21 #include <zypp/ZConfig.h>
22 #include <zypp/ManagedFile.h>
23 
24 #include <zypp/ZYppCommit.h>
25 #include <zypp/ResTraits.h>
26 
27 #include <zypp/Target.h>
28 #include <zypp/Resolver.h>
29 #include <zypp/KeyRing.h>
30 #include <zypp/DiskUsageCounter.h>
31 
32 namespace zyppng {
33  class Context;
34 }
35 
37 namespace zypp
38 {
39 
40  namespace zypp_detail
41  {
42  class ZYppImpl;
43  }
44 
45  class ZYppFactory;
46  class ResPool;
47  class ResPoolProxy;
48  class KeyRing;
49 
51  //
52  // CLASS NAME : ZYpp
53  //
58  class ZYpp : private base::NonCopyable
59  {
60  friend std::ostream & operator<<( std::ostream & str, const ZYpp & obj );
61 
62  public:
63  // can't get swig working if shared_ptr is without namespace here
64  typedef ::boost::shared_ptr<ZYpp> Ptr;
65  typedef ::boost::shared_ptr<const ZYpp> constPtr;
66 
67  public:
68 
73  ResPool pool() const;
74 
79  ResPoolProxy poolProxy() const;
80 
82 
84 
86 
87  public:
91  Target_Ptr target() const;
92 
96  Target_Ptr getTarget() const;
97 
104  void initializeTarget(const Pathname & root, bool doRebuild_r = false);
105 
109  void finishTarget();
110 
111 
112  public:
114 
120  ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
121 
125  void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
126 
130  ManagedFile provideSrcPackage( const SrcPackage_constPtr & srcPackage_r );
131 
132  public:
134  Resolver_Ptr resolver() const;
135  KeyRing_Ptr keyRing() const;
136 
137  public:
139  Pathname homePath() const;
140 
142  Pathname tmpPath() const;
143 
145  void setHomePath( const Pathname & path );
146 
147  private:
149  friend class ZYppFactory;
151  typedef shared_ptr<Impl> Impl_Ptr;
153  explicit ZYpp( const Impl_Ptr & impl_r );
154  private:
156  friend void ::boost::checked_delete<ZYpp>(ZYpp*); // template<class T> inline void checked_delete(T * x)
158  ~ZYpp();
159  private:
162  };
164 
166 } // namespace zypp
168 #endif // ZYPP_ZYPP_H
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition: AutoDispose.h:94
std::set< MountPoint > MountPointSet
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:35
Global ResObject pool.
Definition: ResPool.h:61
Options and policies for ZYpp::commit.
Result returned from ZYpp::commit.
ZYpp factory class (Singleton)
Definition: ZYppFactory.h:44
Pathname homePath() const
Get the path where zypp related plugins store persistent data and caches
Definition: ZYpp.cc:87
KeyRing_Ptr keyRing() const
Definition: ZYpp.cc:56
ZYppCommitResult CommitResult
Definition: ZYpp.h:113
ZYppCommitResult commit(const ZYppCommitPolicy &policy_r)
Commit changes and transactions.
Definition: ZYpp.cc:77
Resolver_Ptr resolver() const
Definition: ZYpp.cc:53
shared_ptr< Impl > Impl_Ptr
Definition: ZYpp.h:151
zypp_detail::ZYppImpl Impl
Definition: ZYpp.h:150
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: ZYpp.h:161
friend std::ostream & operator<<(std::ostream &str, const ZYpp &obj)
Definition: ZYpp.cc:29
DiskUsageCounter::MountPointSet diskUsage()
Definition: ZYpp.cc:41
void setPartitions(const DiskUsageCounter::MountPointSet &mp)
Definition: ZYpp.cc:44
Pathname tmpPath() const
Get the path where zypp related plugins store temp data
Definition: ZYpp.cc:90
~ZYpp()
Dtor.
Definition: ZYppFactory.cc:319
DiskUsageCounter::MountPointSet getPartitions() const
Definition: ZYpp.cc:47
void setHomePath(const Pathname &path)
set the home, if you need to change it
Definition: ZYpp.cc:93
ResPool pool() const
Access to the global resolvable pool.
Definition: ZYpp.cc:38
void installSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Install a source package on the Target.
Definition: ZYpp.cc:80
ZYpp(const Impl_Ptr &impl_r)
Factory ctor.
Definition: ZYppFactory.cc:312
::boost::shared_ptr< const ZYpp > constPtr
Definition: ZYpp.h:65
Target_Ptr target() const
Definition: ZYpp.cc:65
void finishTarget()
Definition: ZYpp.cc:74
Target_Ptr getTarget() const
Same as target but returns NULL if target is not initialized, instead of throwing.
Definition: ZYpp.cc:68
ResPoolProxy poolProxy() const
Pool of ui::Selectable.
Definition: ZYpp.cc:50
ManagedFile provideSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Provides a source package on the Target.
Definition: ZYpp.cc:83
::boost::shared_ptr< ZYpp > Ptr
Definition: ZYpp.h:64
void initializeTarget(const Pathname &root, bool doRebuild_r=false)
Definition: ZYpp.cc:71
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
Definition: ZYpp.h:32