Mailinglist Archive: zypp-devel (115 mails)
| < Previous | Next > |
Re: [zypp-devel] Callbacks and reports proposal
- From: Michael Andres <ma@xxxxxxx>
- Date: Tue, 10 Jul 2007 15:21:33 +0200
- Message-id: <20070710132133.GA28329@xxxxxxx>
On Tue, Jul 10, Duncan Mac-Vicar Prett wrote:
> The idea is that RepoManager functions use an ProgressReportAdaptor internally
> that appart of sending the progress to the user callback, it also sends it to
> the global ProgressReport. The reports get the complete progress object, and
> from it they can get a unique runtime id for the task, text, and progress
> value.
As the ProgressData::ReceiverFnc now takes the ProgressData object as
argument, I added these methods to query the progess:
+ bool reportPercent() const
+
+ bool reportAlive() const
+
+ value_type reportValue() const
reportPercent() and reportAlive() are mutual exclusive and tell whether
reportValue() will return a percent value, or just -1.
-1 is returned if the task did not set a range [min,max]. This
ususally indicates that the size of the task is unknown, and only
'still alive' messages are sent. val() returns the 'real' value the task
assigned to the ProgressData.
--
cu,
Michael Andres
+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres YaST Development ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
> The idea is that RepoManager functions use an ProgressReportAdaptor internally
> that appart of sending the progress to the user callback, it also sends it to
> the global ProgressReport. The reports get the complete progress object, and
> from it they can get a unique runtime id for the task, text, and progress
> value.
As the ProgressData::ReceiverFnc now takes the ProgressData object as
argument, I added these methods to query the progess:
+ bool reportPercent() const
+
+ bool reportAlive() const
+
+ value_type reportValue() const
reportPercent() and reportAlive() are mutual exclusive and tell whether
reportValue() will return a percent value, or just -1.
-1 is returned if the task did not set a range [min,max]. This
ususally indicates that the size of the task is unknown, and only
'still alive' messages are sent. val() returns the 'real' value the task
assigned to the ProgressData.
--
cu,
Michael Andres
+------------------------------------------------------------------+
Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4
+------------------------------------------------------------------+
Michael Andres YaST Development ma@xxxxxxxxxx
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0
+------------------------------------------------------------------+
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |