Go to the documentation of this file.
12 #ifndef ZYPP_PROGRESSDATA_H
13 #define ZYPP_PROGRESSDATA_H
165 friend Data * rwcowClone<Data>(
const Data * rhs );
172 :
_d( new
Data( 0, 0, 0 ) )
177 :
_d( new
Data( 0, max_r, 0 ) )
182 :
_d( new
Data( min_r, max_r, min_r ) )
187 :
_d( new
Data( min_r, max_r, val_r ) )
192 if (
_d->_state ==
RUN )
202 {
_d->_min = min_r; }
206 {
_d->_max = max_r; }
214 {
range( 0, max_r ); }
218 {
min( min_r );
max( max_r ); }
222 void name(
const std::string & name_r )
223 {
_d->_name = name_r; }
227 {
_d->_receiver = fnc_r; }
262 {
return set(
val() + val_r ); }
266 {
return set(
val() - val_r ); }
300 {
return min() !=
max(); }
323 const std::string &
name()
const
324 {
return _d->_name; }
328 {
return _d->_receiver; }
334 {
return(
_d->_state ==
END ); }
425 #endif // ZYPP_PROGRESSDATA_H
const std::string & name() const
bool set(value_type val_r)
Set new counter value.
ProgressData(value_type max_r)
Ctor [0,max](0).
ProgressData makeProgressData(const InputStream &input_r)
ProgressData::value_type _last_value
void range(value_type max_r)
Set new [0,max].
void noRange()
Set no range [0,0].
void noSend()
Set no ReceiverFnc.
value_type reportValue() const
void min(value_type min_r)
Set new min value.
void name(const std::string &name_r)
Set counter name.
RWCOW_pointer< Data > _d
Pointer to data.
bool tick()
Leave counter value unchanged (still alive).
bool reportPercent() const
ProgressData()
Ctor no range [0,0](0).
Base class for objects providing a numeric Id.
bool report()
Send report if necessary.
bool decr(value_type val_r=1)
Decrement counter value (default by 1).
Easy-to use interface to the ZYPP dependency resolver.
Data(value_type min_r, value_type max_r, value_type val_r)
CombinedProgressData(ProgressData &pd, ProgressData::value_type weight=0)
Ctor.
bool operator()(const ProgressData &progress)
Implements the ProgressData::ReceiverFnc callback interface.
ProgressData(value_type min_r, value_type max_r, value_type val_r)
Ctor [min,max](val).
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
void max(value_type max_r)
Set new max value.
std::ostream & operator<<(std::ostream &str, const Exception &obj)
Store and operate on date (time_t).
void sendTo(const ReceiverFnc &fnc_r)
Set ReceiverFnc.
bool toMax()
Set counter value to current max value (unless no range).
bool set(const ProgressData &rhs)
Set range and counter from an other ProgressData.
ProgressData::value_type _weight
bool toMin()
Set counter value to current min value.
Progress callback from another progress.
RW_pointer supporting 'copy on write' functionality.
String related utilities and Regular expression matching.
ProgressData(value_type min_r, value_type max_r)
Ctor [min,max](min).
const ReceiverFnc & receiver() const
void range(value_type min_r, value_type max_r)
Set new [min,max].
Maintain [min,max] and counter (value) for progress counting.
bool incr(value_type val_r=1)
Increment counter value (default by 1).