libzypp  17.36.7
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-core/Globals.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  //
58  {
59  friend std::ostream & operator<<( std::ostream & str, const ZYpp & obj );
60 
61  public:
62  using Ptr = shared_ptr<ZYpp>;
63  using constPtr = shared_ptr<const ZYpp>;
64 
65  public:
66 
71  ResPool pool() const;
72 
77  ResPoolProxy poolProxy() const;
78 
80 
81  void setPartitions(const DiskUsageCounter::MountPointSet &mp);
82 
83  DiskUsageCounter::MountPointSet getPartitions() const;
84 
85  public:
89  Target_Ptr target() const;
90 
94  Target_Ptr getTarget() const;
95 
102  void initializeTarget(const Pathname & root, bool doRebuild_r = false);
103 
107  void finishTarget();
108 
113  static void setShutdownSignal();
114 
119  static void clearShutdownSignal();
120 
121  public:
123 
129  ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
130 
134  void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
135 
139  ManagedFile provideSrcPackage( const SrcPackage_constPtr & srcPackage_r );
140 
141  public:
143  Resolver_Ptr resolver() const;
144  KeyRing_Ptr keyRing() const;
145 
146  public:
148  Pathname homePath() const;
149 
151  Pathname tmpPath() const;
152 
154  void setHomePath( const Pathname & path );
155 
156  private:
158  friend class ZYppFactory;
160  using Impl_Ptr = shared_ptr<Impl>;
162  explicit ZYpp( const Impl_Ptr & impl_r );
163  private:
165  friend void ::boost::checked_delete<ZYpp>(ZYpp*) BOOST_NOEXCEPT; // template<class T> inline void checked_delete(T * x)
167  ~ZYpp();
168  private:
171  };
174 } // namespace zypp
176 #endif // ZYPP_ZYPP_H
shared_ptr< const ZYpp > constPtr
Definition: ZYpp.h:63
zypp::KeyRing KeyRing
Definition: context.h:28
Result returned from ZYpp::commit.
std::set< MountPoint > MountPointSet
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition: SerialNumber.cc:52
Provides API related macros.
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:35
Options and policies for ZYpp::commit.
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition: ResTraits.h:93
shared_ptr< ZYpp > Ptr
Definition: ZYpp.h:62
ZYpp factory class (Singleton)
Definition: ZYppFactory.h:43
shared_ptr< Impl > Impl_Ptr
Definition: ZYpp.h:160
Global ResObject pool.
Definition: ResPool.h:61
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: ZYpp.h:170
static ResPoolProxy poolProxy()
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26