libzypp  13.10.6
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 
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/APIConfig.h"
21 
22 #include "zypp/ZConfig.h"
23 #include "zypp/ManagedFile.h"
24 
25 #include "zypp/ZYppCommit.h"
26 #include "zypp/ResTraits.h"
27 
28 #include "zypp/Target.h"
29 #include "zypp/Resolver.h"
30 #include "zypp/KeyRing.h"
31 #include "zypp/DiskUsageCounter.h"
32 
34 namespace zypp
35 {
36 
37  namespace zypp_detail
38  {
39  class ZYppImpl;
40  }
41 
42  class ZYppFactory;
43  class ResPool;
44  class ResPoolProxy;
45  class KeyRing;
46 
48  //
49  // CLASS NAME : ZYpp
50  //
56  {
57  public:
58 
59  typedef intrusive_ptr<ZYpp> Ptr;
60  typedef intrusive_ptr<const ZYpp> constPtr;
61 
62  public:
63 
68  ResPool pool() const;
69 
74  ResPoolProxy poolProxy() const;
75 
77 
79 
81 
82  public:
86  Target_Ptr target() const;
87 
91  Target_Ptr getTarget() const;
92 
99  void initializeTarget(const Pathname & root, bool doRebuild_r = false);
100 
104  void finishTarget();
105 
106 
107  public:
109 
115  ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
116 
120  void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
121 
125  ManagedFile provideSrcPackage( const SrcPackage_constPtr & srcPackage_r );
126 
127  public:
129  Resolver_Ptr resolver() const;
130  KeyRing_Ptr keyRing() const;
131 
132  public:
134  Pathname homePath() const;
135 
137  Pathname tmpPath() const;
138 
140  void setHomePath( const Pathname & path );
141 
142  protected:
144  virtual ~ZYpp();
146  virtual std::ostream & dumpOn( std::ostream & str ) const;
147  private:
149  friend class ZYppFactory;
150 
153  typedef shared_ptr<Impl> Impl_Ptr;
155  explicit
156  ZYpp( const Impl_Ptr & impl_r );
157  private:
160  };
162 
164 } // namespace zypp
166 #endif // ZYPP_ZYPP_H
ResPool pool() const
Access to the global resolvable pool.
Definition: ZYpp.cc:59
Pathname tmpPath() const
Get the path where zypp related plugins store temp data.
Definition: ZYpp.cc:111
Pathname homePath() const
Get the path where zypp related plugins store persistent data and caches.
Definition: ZYpp.cc:108
Result returned from ZYpp::commit.
virtual ~ZYpp()
Dtor.
Definition: ZYpp.cc:40
ManagedFile provideSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Provides a source package on the Target.
Definition: ZYpp.cc:104
ZYppCommitResult CommitResult
Definition: ZYpp.h:108
void installSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Install a source package on the Target.
Definition: ZYpp.cc:101
intrusive_ptr< const ZYpp > constPtr
Definition: ZYpp.h:60
shared_ptr< Impl > Impl_Ptr
Definition: ZYpp.h:153
ZYpp(const Impl_Ptr &impl_r)
Factory ctor.
Definition: ZYpp.cc:31
ResPool::instance().proxy();.
Definition: ResPoolProxy.h:34
Target_Ptr target() const
Definition: ZYpp.cc:86
zypp_detail::ZYppImpl Impl
Definition: ZYpp.h:152
std::set< MountPoint > MountPointSet
void setPartitions(const DiskUsageCounter::MountPointSet &mp)
Definition: ZYpp.cc:65
void setHomePath(const Pathname &path)
set the home, if you need to change it
Definition: ZYpp.cc:114
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
Options and policies for ZYpp::commit.
Provides API related macros.
ZYppCommitResult commit(const ZYppCommitPolicy &policy_r)
Commit changes and transactions.
Definition: ZYpp.cc:98
DiskUsageCounter::MountPointSet getPartitions() const
Definition: ZYpp.cc:68
KeyRing_Ptr keyRing() const
Definition: ZYpp.cc:77
ZYpp factory class (Singleton)
Definition: ZYppFactory.h:43
Base class for reference counted objects.
void initializeTarget(const Pathname &root, bool doRebuild_r=false)
Definition: ZYpp.cc:92
virtual std::ostream & dumpOn(std::ostream &str) const
Stream output.
Definition: ZYpp.cc:48
Global ResObject pool.
Definition: ResPool.h:48
ResPoolProxy poolProxy() const
Pool of ui::Selectable.
Definition: ZYpp.cc:71
Resolver_Ptr resolver() const
Definition: ZYpp.cc:74
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: ZYpp.h:159
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:265
Reference counted access to a _Tp object calling a custom Dispose function when the last AutoDispose ...
Definition: AutoDispose.h:92
intrusive_ptr< ZYpp > Ptr
Definition: ZYpp.h:59
Target_Ptr getTarget() const
Same as target but returns NULL if target is not initialized, instead of throwing.
Definition: ZYpp.cc:89
DiskUsageCounter::MountPointSet diskUsage()
Definition: ZYpp.cc:62
void finishTarget()
Definition: ZYpp.cc:95