21 #undef ZYPP_BASE_LOGGER_LOGGROUP
22 #define ZYPP_BASE_LOGGER_LOGGROUP "Progress"
36 bool doReport =
false;
42 newVal /= (
_d->_max -
_d->_min );
44 if ( newVal -
_d->_last_val > 20
46 || ( newVal == 100 &&
_d->_last_send != 100 )
47 ||
_d->_state ==
END )
49 _d->_last_val = newVal;
58 _d->_last_val =
_d->_val;
74 goOn =
_d->_receiver( *
this );
78 if (
_d->_state !=
END )
82 _d->_last_val, (
hasRange() ?
"%" :
"!" ) ) << endl;
92 if ( ! goOn &&
_d->_state !=
END )
94 WAR <<
"User request to ABORT pending action. "
97 _d->_last_val, (
hasRange() ?
"%" :
"!" ) ) << endl;
111 return str <<
str::form(
"{%u|%s}[%lld,%lld](%lld)%lld%%)",
115 return str <<
str::form(
"{%u|%s}[-,-](%lld)",
129 if ( input_r.
size() > 0 )
153 float real_increment = parent_factor*increment;
const std::string & name() const
ProgressData makeProgressData(const InputStream &input_r)
void min(value_type min_r)
Set new min value.
void max(value_type max_r)
Set new max value.
bool report()
Send report if necessary.
void range(value_type max_r)
Set new [0,max].
std::ostream & operator<<(std::ostream &str, const Exception &obj)
bool operator()(const ProgressData &progress)
Implements the ProgressData::ReceiverFnc callback interface.
Maintain [min,max] and counter (value) for progress counting.
CombinedProgressData(ProgressData &pd, ProgressData::value_type weight=0)
Ctor.
bool incr(value_type val_r=1)
Increment counter value (default by 1).
std::string form(const char *format,...)
Printf style construction of std::string.
ProgressData::value_type _weight
unsigned numericId() const
static Date now()
Return the current time.
bool tick()
Leave counter value unchanged (still alive).
void name(const std::string &name_r)
Set counter name.
ProgressData::value_type _last_value
value_type reportValue() const
RWCOW_pointer< Data > _d
Pointer to data.