libzypp  17.31.31
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 #include <iosfwd>
15 
16 #include <zypp/base/NonCopyable.h>
17 #include <zypp/base/PtrTypes.h>
18 #include <zypp/APIConfig.h>
19 
20 #include <zypp/ZConfig.h>
21 #include <zypp/ManagedFile.h>
22 
23 #include <zypp/ZYppCommit.h>
24 #include <zypp/ResTraits.h>
25 
26 #include <zypp/Target.h>
27 #include <zypp/Resolver.h>
28 #include <zypp/KeyRing.h>
29 #include <zypp/DiskUsageCounter.h>
30 
31 namespace zyppng {
32  class Context;
33 }
34 
36 namespace zypp
37 {
38 
39  namespace zypp_detail
40  {
41  class ZYppImpl;
42  }
43 
44  class ZYppFactory;
45  class ResPool;
46  class ResPoolProxy;
47  class KeyRing;
48 
50  //
51  // CLASS NAME : ZYpp
52  //
57  class ZYpp : private base::NonCopyable
58  {
59  friend std::ostream & operator<<( std::ostream & str, const ZYpp & obj );
60 
61  public:
62  // can't get swig working if shared_ptr is without namespace here
63  typedef ::boost::shared_ptr<ZYpp> Ptr;
64  typedef ::boost::shared_ptr<const ZYpp> constPtr;
65 
66  public:
67 
72  ResPool pool() const;
73 
78  ResPoolProxy poolProxy() const;
79 
81 
83 
85 
86  public:
90  Target_Ptr target() const;
91 
95  Target_Ptr getTarget() const;
96 
103  void initializeTarget(const Pathname & root, bool doRebuild_r = false);
104 
108  void finishTarget();
109 
114  static void setShutdownSignal();
115 
120  static void clearShutdownSignal();
121 
122  public:
124 
130  ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
131 
135  void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
136 
140  ManagedFile provideSrcPackage( const SrcPackage_constPtr & srcPackage_r );
141 
142  public:
144  Resolver_Ptr resolver() const;
145  KeyRing_Ptr keyRing() const;
146 
147  public:
149  Pathname homePath() const;
150 
152  Pathname tmpPath() const;
153 
155  void setHomePath( const Pathname & path );
156 
157  private:
159  friend class ZYppFactory;
161  typedef shared_ptr<Impl> Impl_Ptr;
163  explicit ZYpp( const Impl_Ptr & impl_r );
164  private:
166  friend void ::boost::checked_delete<ZYpp>(ZYpp*) BOOST_NOEXCEPT; // template<class T> inline void checked_delete(T * x)
168  ~ZYpp();
169  private:
172  };
175 } // namespace zypp
177 #endif // ZYPP_ZYPP_H
Result returned from ZYpp::commit.
~ZYpp()
Dtor.
Definition: ZYppFactory.cc:334
ManagedFile provideSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Provides a source package on the Target.
Definition: ZYpp.cc:89
ZYppCommitResult CommitResult
Definition: ZYpp.h:123
void installSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Install a source package on the Target.
Definition: ZYpp.cc:86
String related utilities and Regular expression matching.
Pathname tmpPath() const
Get the path where zypp related plugins store temp data.
Definition: ZYpp.cc:96
shared_ptr< Impl > Impl_Ptr
Definition: ZYpp.h:161
ResPoolProxy poolProxy() const
Pool of ui::Selectable.
Definition: ZYpp.cc:50
ZYpp(const Impl_Ptr &impl_r)
Factory ctor.
Definition: ZYppFactory.cc:327
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:34
Pathname homePath() const
Get the path where zypp related plugins store persistent data and caches.
Definition: ZYpp.cc:93
DiskUsageCounter::MountPointSet getPartitions() const
Definition: ZYpp.cc:47
zypp_detail::ZYppImpl Impl
Definition: ZYpp.h:160
Target_Ptr target() const
Definition: ZYpp.cc:65
std::set< MountPoint > MountPointSet
void setPartitions(const DiskUsageCounter::MountPointSet &mp)
Definition: ZYpp.cc:44
void setHomePath(const Pathname &path)
set the home, if you need to change it
Definition: ZYpp.cc:99
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
Resolver_Ptr resolver() const
Definition: ZYpp.cc:53
Options and policies for ZYpp::commit.
Provides API related macros.
::boost::shared_ptr< ZYpp > Ptr
Definition: ZYpp.h:63
ZYppCommitResult commit(const ZYppCommitPolicy &policy_r)
Commit changes and transactions.
Definition: ZYpp.cc:83
KeyRing_Ptr keyRing() const
Definition: ZYpp.cc:56
static void clearShutdownSignal()
To be called from zypper code.
Definition: ZYpp.cc:80
::boost::shared_ptr< const ZYpp > constPtr
Definition: ZYpp.h:64
ZYpp factory class (Singleton)
Definition: ZYppFactory.h:43
ResPool pool() const
Access to the global resolvable pool.
Definition: ZYpp.cc:38
static void setShutdownSignal()
To be called from zyppers signal handlers.
Definition: ZYpp.cc:77
friend std::ostream & operator<<(std::ostream &str, const ZYpp &obj)
Definition: ZYpp.cc:29
void initializeTarget(const Pathname &root, bool doRebuild_r=false)
Definition: ZYpp.cc:71
Global ResObject pool.
Definition: ResPool.h:60
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: ZYpp.h:171
Target_Ptr getTarget() const
Same as target but returns NULL if target is not initialized, instead of throwing.
Definition: ZYpp.cc:68
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
DiskUsageCounter::MountPointSet diskUsage()
Definition: ZYpp.cc:41
void finishTarget()
Definition: ZYpp.cc:74