libzypp 17.31.23
|
Maintain [min,max]
and counter (value)
for progress counting.
More...
#include <ui/progressdata.h>
Classes | |
class | Data |
Public Types | |
typedef long long | value_type |
typedef function< bool(const ProgressData &)> | ReceiverFnc |
Most simple version of progress reporting The percentage in most cases. | |
Public Member Functions | |
ProgressData () | |
Ctor no range [0,0](0) . | |
ProgressData (value_type max_r) | |
Ctor [0,max](0) . | |
ProgressData (value_type min_r, value_type max_r) | |
Ctor [min,max](min) . | |
ProgressData (value_type min_r, value_type max_r, value_type val_r) | |
Ctor [min,max](val) . | |
~ProgressData () | |
void | min (value_type min_r) |
Set new min value. | |
void | max (value_type max_r) |
Set new max value. | |
void | noRange () |
Set no range [0,0] . | |
void | range (value_type max_r) |
Set new [0,max] . | |
void | range (value_type min_r, value_type max_r) |
Set new [min,max] . | |
void | name (const std::string &name_r) |
Set counter name. | |
void | sendTo (const ReceiverFnc &fnc_r) |
Set ReceiverFnc. | |
void | noSend () |
Set no ReceiverFnc. | |
Progress reporting. | |
These methods may actually cause a progress report to be sent. All methods return | |
bool | set (value_type val_r) |
Set new counter value . | |
bool | set (const ProgressData &rhs) |
Set range and counter from an other ProgressData. | |
bool | incr (value_type val_r=1) |
Increment counter value (default by 1). | |
bool | decr (value_type val_r=1) |
Decrement counter value (default by 1). | |
bool | toMin () |
Set counter value to current min value. | |
bool | toMax () |
Set counter value to current max value (unless no range). | |
bool | tick () |
Leave counter value unchanged (still alive). | |
![]() | |
unsigned | numericId () const |
Private Types | |
enum | State { INIT , RUN , END } |
Related Functions | |
(Note that these are not member functions.) | |
std::ostream & | operator<< (std::ostream &str, const ProgressData &obj) |
Stream output. | |
ProgressData | makeProgressData (const InputStream &input_r) |
Setup from InputStream. | |
Progress receiving. | |
RWCOW_pointer< Data > | _d |
Pointer to data. | |
value_type | min () const |
value_type | max () const |
value_type | val () const |
bool | hasRange () const |
bool | reportPercent () const |
bool | reportAlive () const |
value_type | reportValue () const |
const std::string & | name () const |
const ReceiverFnc & | receiver () const |
bool | finalReport () const |
bool | report () |
Send report if necessary. | |
Additional Inherited Members | |
![]() | |
ProvideNumericId () | |
Default ctor. | |
ProvideNumericId (const ProvideNumericId &) | |
Copy ctor. | |
ProvideNumericId (ProvideNumericId &&rhs) | |
Move ctor. | |
ProvideNumericId (const void *const) | |
No-Id ctor (0). | |
ProvideNumericId & | operator= (const ProvideNumericId &) |
Assign. | |
ProvideNumericId & | operator= (ProvideNumericId &&rhs) |
Move Assign. | |
~ProvideNumericId () | |
Dtor. | |
Maintain [min,max]
and counter (value)
for progress counting.
This class should provide everything the producer of progress data needs. As a convention, a zero sizes range indicates that you are just able to send 'still alive' triggers.
The counter should be updated in reasonable intervals. Don't mind whether the counter value actually increased or not. ProgressData will recognize your triggers and knows when to actually send notification to a consumer.
Each ProgressData object provides a unique numeric id and you may assign it a name.
The different ammount of triggers is due to different rules for sending percent or 'still alive' messages.
Definition at line 131 of file progressdata.h.
typedef long long zypp::ProgressData::value_type |
Definition at line 134 of file progressdata.h.
typedef function<bool( const ProgressData & )> zypp::ProgressData::ReceiverFnc |
Most simple version of progress reporting The percentage in most cases.
Sometimes just keepalive. sender
ProgressData object who sends the progress info
Definition at line 140 of file progressdata.h.
|
private |
Enumerator | |
---|---|
INIT | |
RUN | |
END |
Definition at line 143 of file progressdata.h.
|
inline |
Ctor no range [0,0](0)
.
Definition at line 174 of file progressdata.h.
|
inline |
Ctor [0,max](0)
.
Definition at line 179 of file progressdata.h.
|
inline |
Ctor [min,max](min)
.
Definition at line 184 of file progressdata.h.
|
inline |
Ctor [min,max](val)
.
Definition at line 189 of file progressdata.h.
|
inline |
Definition at line 193 of file progressdata.h.
|
inline |
Set new min
value.
Definition at line 204 of file progressdata.h.
|
inline |
Set new max
value.
Definition at line 208 of file progressdata.h.
|
inline |
Set no range [0,0]
.
Definition at line 212 of file progressdata.h.
|
inline |
Set new [0,max]
.
Definition at line 216 of file progressdata.h.
|
inline |
Set new [min,max]
.
Definition at line 220 of file progressdata.h.
|
inline |
Set counter name.
Definition at line 225 of file progressdata.h.
|
inline |
Set ReceiverFnc.
Definition at line 229 of file progressdata.h.
|
inline |
Set no ReceiverFnc.
Definition at line 233 of file progressdata.h.
|
inline |
Set new counter value
.
Definition at line 249 of file progressdata.h.
|
inline |
Set range and counter from an other ProgressData.
Definition at line 256 of file progressdata.h.
|
inline |
Increment counter value
(default by 1).
Definition at line 264 of file progressdata.h.
|
inline |
Decrement counter value
(default by 1).
Definition at line 268 of file progressdata.h.
|
inline |
Set counter value to current min
value.
Definition at line 272 of file progressdata.h.
|
inline |
Set counter value to current max
value (unless no range).
Definition at line 276 of file progressdata.h.
|
inline |
Leave counter value unchanged (still alive).
Definition at line 280 of file progressdata.h.
|
inline |
min
value. Definition at line 290 of file progressdata.h.
|
inline |
max
value. Definition at line 294 of file progressdata.h.
|
inline |
value
. Definition at line 298 of file progressdata.h.
|
inline |
[min,max]
defines a nonempty range. Definition at line 302 of file progressdata.h.
|
inline |
Definition at line 309 of file progressdata.h.
|
inline |
false
. Definition at line 316 of file progressdata.h.
|
inline |
Definition at line 322 of file progressdata.h.
|
inline |
Definition at line 326 of file progressdata.h.
|
inline |
Definition at line 330 of file progressdata.h.
|
inline |
true
if this is the final report sent by the ProgressData dtor. Definition at line 336 of file progressdata.h.
|
private |
Send report if necessary.
Definition at line 33 of file progressdata.cc.
|
related |
Stream output.
Definition at line 105 of file progressdata.cc.
|
related |
Setup from InputStream.
Definition at line 123 of file progressdata.cc.
|
private |
Pointer to data.
Definition at line 346 of file progressdata.h.