libzypp: zypp/target/TargetCallbackReceiver.h Source File

libzypp 17.38.6

TargetCallbackReceiver.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_TARGET_TARGETCALLBACKRECEIVER_H
13#define ZYPP_TARGET_TARGETCALLBACKRECEIVER_H
14
15#include <zypp/ZYppCallbacks.h>
16#include <zypp/target/rpm/RpmCallbacks.h>
17
19namespace zypp
20{
22 namespace target
23 {
24
25 class RpmInstallPackageReceiver
26 : public callback::ReceiveReport<rpm::RpmInstallReport>
27 {
28 callback::SendReport <rpm::InstallResolvableReport> _report;
29 Resolvable::constPtr _resolvable;
30 target::rpm::InstallResolvableReport::RpmLevel _level;
31 bool _abort;
32 std::string _finishInfo;
33
34 public:
35
36 RpmInstallPackageReceiver (Resolvable::constPtr res);
37 virtual ~RpmInstallPackageReceiver ();
38
39 void reportbegin() override;
40
41 void reportend() override;
42
44 void report( const UserData & userData_r ) override;
45
47 void start( const Pathname & name ) override;
48
49 void tryLevel( target::rpm::InstallResolvableReport::RpmLevel level_r );
50
51 bool aborted() const { return _abort; }
52
57 bool progress( unsigned percent ) override;
58
60 rpm::RpmInstallReport::Action problem( Exception & excpt_r ) override;
61
63 void finishInfo( const std::string & info_r ) override;
64
66 void finish() override;
67
69 void finish( Exception & excpt_r ) override;
70 };
71
72 class RpmRemovePackageReceiver
73 : public callback::ReceiveReport<rpm::RpmRemoveReport>
74 {
75 callback::SendReport <rpm::RemoveResolvableReport> _report;
76 Resolvable::constPtr _resolvable;
77 bool _abort;
78 std::string _finishInfo;
79
80 public:
81
82 RpmRemovePackageReceiver (Resolvable::constPtr res);
83 virtual ~RpmRemovePackageReceiver ();
84
85 void reportbegin() override;
86
87 void reportend() override;
88
91 void report( const UserData & userData_r ) override;
92
93 void start( const std::string & name ) override;
94
99 bool progress( unsigned percent ) override;
100
104 bool aborted() const { return _abort; }
105
107 rpm::RpmRemoveReport::Action problem( Exception & excpt_r ) override;
108
110 void finishInfo( const std::string & info_r ) override;
111
113 void finish() override;
114
116 void finish( Exception & excpt_r ) override;
117 };
118
120 } // namespace target
123} // namespace zypp
125#endif // ZYPP_TARGET_TARGETCALLBACKRECEIVER_H
RpmCallbacks.h
ZYppCallbacks.h
zypp::Exception
Base class for Exception.
Definition Exception.h:153
zypp::Resolvable::constPtr
TraitsType::constPtrType constPtr
Definition Resolvable.h:59
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp::target::RpmInstallPackageReceiver::_abort
bool _abort
Definition TargetCallbackReceiver.h:31
zypp::target::RpmInstallPackageReceiver::reportbegin
void reportbegin() override
Definition TargetCallbackReceiver.cc:38
zypp::target::RpmInstallPackageReceiver::start
void start(const Pathname &name) override
Start the operation.
Definition TargetCallbackReceiver.cc:54
zypp::target::RpmInstallPackageReceiver::tryLevel
void tryLevel(target::rpm::InstallResolvableReport::RpmLevel level_r)
Definition TargetCallbackReceiver.cc:110
zypp::target::RpmInstallPackageReceiver::_finishInfo
std::string _finishInfo
Definition TargetCallbackReceiver.h:32
zypp::target::RpmInstallPackageReceiver::finishInfo
void finishInfo(const std::string &info_r) override
Additional rpm output to be reported in finish in case of success.
Definition TargetCallbackReceiver.cc:93
zypp::target::RpmInstallPackageReceiver::~RpmInstallPackageReceiver
virtual ~RpmInstallPackageReceiver()
Definition TargetCallbackReceiver.cc:34
zypp::target::RpmInstallPackageReceiver::aborted
bool aborted() const
Definition TargetCallbackReceiver.h:51
zypp::target::RpmInstallPackageReceiver::progress
bool progress(unsigned percent) override
Inform about progress Return true on abort.
Definition TargetCallbackReceiver.cc:64
zypp::target::RpmInstallPackageReceiver::report
void report(const UserData &userData_r) override
Forwards generic reports.
Definition TargetCallbackReceiver.cc:46
zypp::target::RpmInstallPackageReceiver::RpmInstallPackageReceiver
RpmInstallPackageReceiver(Resolvable::constPtr res)
Definition TargetCallbackReceiver.cc:26
zypp::target::RpmInstallPackageReceiver::finish
void finish() override
Finish operation in case of success.
Definition TargetCallbackReceiver.cc:99
zypp::target::RpmInstallPackageReceiver::_level
target::rpm::InstallResolvableReport::RpmLevel _level
Definition TargetCallbackReceiver.h:30
zypp::target::RpmInstallPackageReceiver::reportend
void reportend() override
Definition TargetCallbackReceiver.cc:42
zypp::target::RpmInstallPackageReceiver::_report
callback::SendReport< rpm::InstallResolvableReport > _report
Definition TargetCallbackReceiver.h:28
zypp::target::RpmInstallPackageReceiver::problem
rpm::RpmInstallReport::Action problem(Exception &excpt_r) override
inform user about a problem
Definition TargetCallbackReceiver.cc:71
zypp::target::RpmInstallPackageReceiver::_resolvable
Resolvable::constPtr _resolvable
Definition TargetCallbackReceiver.h:29
zypp::target::RpmRemovePackageReceiver::finish
void finish() override
Finish operation in case of success.
Definition TargetCallbackReceiver.cc:191
zypp::target::RpmRemovePackageReceiver::start
void start(const std::string &name) override
Definition TargetCallbackReceiver.cc:147
zypp::target::RpmRemovePackageReceiver::RpmRemovePackageReceiver
RpmRemovePackageReceiver(Resolvable::constPtr res)
RpmRemovePackageReceiver.
Definition TargetCallbackReceiver.cc:120
zypp::target::RpmRemovePackageReceiver::_finishInfo
std::string _finishInfo
Definition TargetCallbackReceiver.h:78
zypp::target::RpmRemovePackageReceiver::finishInfo
void finishInfo(const std::string &info_r) override
Additional rpm output to be reported in finish in case of success.
Definition TargetCallbackReceiver.cc:185
zypp::target::RpmRemovePackageReceiver::reportbegin
void reportbegin() override
Definition TargetCallbackReceiver.cc:131
zypp::target::RpmRemovePackageReceiver::progress
bool progress(unsigned percent) override
Inform about progress Return true on abort.
Definition TargetCallbackReceiver.cc:157
zypp::target::RpmRemovePackageReceiver::aborted
bool aborted() const
Returns true if removing is aborted during progress.
Definition TargetCallbackReceiver.h:104
zypp::target::RpmRemovePackageReceiver::report
void report(const UserData &userData_r) override
Start the operation.
Definition TargetCallbackReceiver.cc:140
zypp::target::RpmRemovePackageReceiver::_report
callback::SendReport< rpm::RemoveResolvableReport > _report
Definition TargetCallbackReceiver.h:75
zypp::target::RpmRemovePackageReceiver::_resolvable
Resolvable::constPtr _resolvable
Definition TargetCallbackReceiver.h:76
zypp::target::RpmRemovePackageReceiver::problem
rpm::RpmRemoveReport::Action problem(Exception &excpt_r) override
inform user about a problem
Definition TargetCallbackReceiver.cc:164
zypp::target::RpmRemovePackageReceiver::_abort
bool _abort
Definition TargetCallbackReceiver.h:77
zypp::target::RpmRemovePackageReceiver::~RpmRemovePackageReceiver
virtual ~RpmRemovePackageReceiver()
Definition TargetCallbackReceiver.cc:127
zypp::target::RpmRemovePackageReceiver::reportend
void reportend() override
Definition TargetCallbackReceiver.cc:135
zypp::target
Definition KeyRing.h:325
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::callback::ReceiveReport
Definition Callback.h:169
zypp::target::rpm::InstallResolvableReport::RpmLevel
RpmLevel
Definition ZYppCallbacks.h:608
zypp::target::rpm::RpmInstallReport::Action
Action
Definition RpmCallbacks.h:73
zypp::target::rpm::RpmRemoveReport::Action
Action
Definition RpmCallbacks.h:36