libzypp: zypp/zypp_detail/ZYppImpl.h Source File

libzypp 17.36.6

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
26 using GPollFD = struct _GPollFD;
27
29namespace zypp
30{
32 namespace zypp_detail
33 {
34
36 //
37 // CLASS NAME : ZYppImpl
38 //
40 class ZYppImpl
41 {
42 friend std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj );
43
44 public:
46 ZYppImpl();
48 ~ZYppImpl();
49
50 public:
52 ResPool pool() const
53 { return ResPool::instance(); }
54
55 ResPoolProxy poolProxy() const
56 { return ResPool::instance().proxy(); }
57
59 KeyRing_Ptr keyRing() const
60 { return _keyring; }
61
62
63 Resolver_Ptr resolver() const
64 { return _resolver; }
65
66 public:
71 Target_Ptr target() const;
72
76 Target_Ptr getTarget() const
77 { return _target; }
78
83 void initializeTarget( const Pathname & root, bool doRebuild_r );
84
88 void finishTarget();
89
91 ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
92
94 void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
95
97 ManagedFile provideSrcPackage( const SrcPackage_constPtr & srcPackage_r );
98
99 public:
101 Pathname homePath() const;
102
104 Pathname tmpPath() const;
105
107 void setHomePath( const Pathname & path );
108
109 public:
110 DiskUsageCounter::MountPointSet diskUsage();
111 void setPartitions(const DiskUsageCounter::MountPointSet &mp);
112 DiskUsageCounter::MountPointSet getPartitions() const;
113
114 public:
116 void changeTargetTo( const Target_Ptr& newtarget_r );
117
121 static void setShutdownSignal();
122
126 static void clearShutdownSignal();
127
128 private:
130 Target_Ptr _target;
132 Resolver_Ptr _resolver;
133
134 KeyRing_Ptr _keyring;
136 Pathname _home_path;
138 shared_ptr<DiskUsageCounter> _disk_usage;
139 };
140
141
143 std::ostream & operator<<( std::ostream & str, const ZYppImpl & obj );
144
156 int zypp_poll( std::vector<GPollFD> &fds, int timeout = -1 );
157
158
160 } // namespace zypp_detail
163} // namespace zypp
165#endif // ZYPP_ZYPP_DETAIL_ZYPPIMPL_H
DiskUsageCounter.h
KeyRing.h
ResTraits.h
Resolver.h
Target.h
ZYppCommit.h
GPollFD
struct _GPollFD GPollFD
Definition ZYppImpl.h:26
Target_Ptr
shared_ptr
zypp::DiskUsageCounter::MountPointSet
std::set< MountPoint > MountPointSet
Definition DiskUsageCounter.h:154
zypp::ResPoolProxy
ResPool::instance().proxy();.
Definition ResPoolProxy.h:36
zypp::ResPool
Global ResObject pool.
Definition ResPool.h:62
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition ResPool.cc:38
zypp::ResPool::proxy
ResPoolProxy proxy() const
preliminary
Definition ResPool.cc:59
zypp::ZYppCommitPolicy
Options and policies for ZYpp::commit.
Definition ZYppCommitPolicy.h:34
zypp::ZYppCommitResult
Result returned from ZYpp::commit.
Definition ZYppCommitResult.h:64
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::zypp_detail::ZYppImpl
Definition ZYppImpl.h:41
zypp::zypp_detail::ZYppImpl::getPartitions
DiskUsageCounter::MountPointSet getPartitions() const
Definition ZYppImpl.cc:156
zypp::zypp_detail::ZYppImpl::pool
ResPool pool() const
Definition ZYppImpl.h:52
zypp::zypp_detail::ZYppImpl::getTarget
Target_Ptr getTarget() const
Same as target but returns NULL if target is not initialized, instead of throwing.
Definition ZYppImpl.h:76
zypp::zypp_detail::ZYppImpl::ZYppImpl
ZYppImpl()
Default ctor.
Definition ZYppImpl.cc:116
zypp::zypp_detail::ZYppImpl::operator<<
friend std::ostream & operator<<(std::ostream &str, const ZYppImpl &obj)
Definition ZYppImpl.cc:308
zypp::zypp_detail::ZYppImpl::setPartitions
void setPartitions(const DiskUsageCounter::MountPointSet &mp)
Definition ZYppImpl.cc:150
zypp::zypp_detail::ZYppImpl::target
Target_Ptr target() const
Definition ZYppImpl.cc:167
zypp::zypp_detail::ZYppImpl::_keyring
KeyRing_Ptr _keyring
Definition ZYppImpl.h:134
zypp::zypp_detail::ZYppImpl::setHomePath
void setHomePath(const Pathname &path)
set the home, if you need to change it
Definition ZYppImpl.cc:270
zypp::zypp_detail::ZYppImpl::~ZYppImpl
~ZYppImpl()
Dtor.
Definition ZYppImpl.cc:135
zypp::zypp_detail::ZYppImpl::poolProxy
ResPoolProxy poolProxy() const
Definition ZYppImpl.h:55
zypp::zypp_detail::ZYppImpl::resolver
Resolver_Ptr resolver() const
Definition ZYppImpl.h:63
zypp::zypp_detail::ZYppImpl::tmpPath
Pathname tmpPath() const
Get the path where zypp related plugins store tmp data.
Definition ZYppImpl.cc:273
zypp::zypp_detail::ZYppImpl::commit
ZYppCommitResult commit(const ZYppCommitPolicy &policy_r)
Commit changes and transactions.
Definition ZYppImpl.cc:211
zypp::zypp_detail::ZYppImpl::finishTarget
void finishTarget()
Definition ZYppImpl.cc:198
zypp::zypp_detail::ZYppImpl::setShutdownSignal
static void setShutdownSignal()
Enable the shutdown signal for zypp_poll calls.
Definition ZYppImpl.cc:276
zypp::zypp_detail::ZYppImpl::installSrcPackage
void installSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Install a source package on the Target.
Definition ZYppImpl.cc:250
zypp::zypp_detail::ZYppImpl::_home_path
Pathname _home_path
Definition ZYppImpl.h:136
zypp::zypp_detail::ZYppImpl::_disk_usage
shared_ptr< DiskUsageCounter > _disk_usage
defined mount points, used for disk usage counting
Definition ZYppImpl.h:138
zypp::zypp_detail::ZYppImpl::keyRing
KeyRing_Ptr keyRing() const
Definition ZYppImpl.h:59
zypp::zypp_detail::ZYppImpl::provideSrcPackage
ManagedFile provideSrcPackage(const SrcPackage_constPtr &srcPackage_r)
Install a source package on the Target.
Definition ZYppImpl.cc:257
zypp::zypp_detail::ZYppImpl::changeTargetTo
void changeTargetTo(const Target_Ptr &newtarget_r)
Hook for actions to trigger if the Target changes (initialize/finish)
Definition ZYppImpl.cc:174
zypp::zypp_detail::ZYppImpl::homePath
Pathname homePath() const
Get the path where zypp related plugins store persistent data and caches.
Definition ZYppImpl.cc:267
zypp::zypp_detail::ZYppImpl::_resolver
Resolver_Ptr _resolver
Definition ZYppImpl.h:132
zypp::zypp_detail::ZYppImpl::diskUsage
DiskUsageCounter::MountPointSet diskUsage()
Definition ZYppImpl.cc:141
zypp::zypp_detail::ZYppImpl::clearShutdownSignal
static void clearShutdownSignal()
Disable the shutdown signal for zypp_poll calls.
Definition ZYppImpl.cc:288
zypp::zypp_detail::ZYppImpl::_target
Target_Ptr _target
Definition ZYppImpl.h:130
zypp::zypp_detail::ZYppImpl::initializeTarget
void initializeTarget(const Pathname &root, bool doRebuild_r)
Definition ZYppImpl.cc:183
str
String related utilities and Regular expression matching.
zypp::zypp_detail::operator<<
std::ostream & operator<<(std::ostream &str, const ZYppImpl &obj)
Definition ZYppImpl.cc:308
zypp::zypp_detail::zypp_poll
int zypp_poll(std::vector< GPollFD > &fds, int timeout)
Small wrapper around g_poll that additionally listens to the shutdown FD returned by ZYpp::shutdownSi...
Definition ZYppImpl.cc:313
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::ManagedFile
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
Definition ManagedFile.h:27
ManagedFile.h
TmpPath.h