21 #undef ZYPP_BASE_LOGGER_LOGGROUP
22 #define ZYPP_BASE_LOGGER_LOGGROUP "Progress"
42 if ( newVal -
_d->_last_val > 10
43 || now -
_d->_last_send > 1
44 || (
_d->_last_val == 0 && newVal > 0 )
45 || ( newVal == 100 &&
_d->_last_val != 100 )
46 || ( newVal != 100 &&
_d->_last_val == 100 )
47 ||
_d->_state !=
RUN )
49 _d->_last_val = newVal;
57 if ( now -
_d->_last_send > 1 ||
_d->_state !=
RUN )
59 _d->_last_val =
_d->_val;
75 if ( !
_d->_receiver( *
this ) )
77 if (
_d->_state !=
END )
79 WAR <<
"User request to ABORT pending action. "
81 _d->_last_val, (
hasRange() ?
"%" :
"!" ) ) << endl;
86 else if (
_d->_state ==
END )
103 return str <<
str::form(
"{%u|%s}[%lld,%lld](%lld)%lld%%)",
107 return str <<
str::form(
"{%u|%s}[-,-](%lld)",
121 if ( input_r.
size() > 0 )
145 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.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
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].
Store and operate on date (time_t).
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).
unsigned numericId() const
ProgressData::value_type _weight
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.