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
Data(value_type min_r, value_type max_r, value_type val_r)
const std::string & name() const
const ReceiverFnc & receiver() const
bool reportPercent() const
ProgressData makeProgressData(const InputStream &input_r)
ProgressData()
Ctor no range [0,0](0).
void sendTo(const ReceiverFnc &fnc_r)
Set ReceiverFnc.
bool decr(value_type val_r=1)
Decrement counter value (default by 1).
ProgressData(value_type min_r, value_type max_r, value_type val_r)
Ctor [min,max](val).
bool toMax()
Set counter value to current max value (unless no range).
void min(value_type min_r)
Set new min value.
void max(value_type max_r)
Set new max value.
function< bool(const ProgressData &)> ReceiverFnc
Most simple version of progress reporting The percentage in most cases.
bool report()
Send report if necessary.
void range(value_type max_r)
Set new [0,max].
Progress callback from another progress.
Base class for objects providing a numeric Id.
bool toMin()
Set counter value to current min value.
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.
ProgressData(value_type min_r, value_type max_r)
Ctor [min,max](min).
Maintain [min,max] and counter (value) for progress counting.
CombinedProgressData(ProgressData &pd, ProgressData::value_type weight=0)
Ctor.
void noRange()
Set no range [0,0].
bool incr(value_type val_r=1)
Increment counter value (default by 1).
void noSend()
Set no ReceiverFnc.
bool set(const ProgressData &rhs)
Set range and counter from an other ProgressData.
ProgressData::value_type _weight
ProgressData(value_type max_r)
Ctor [0,max](0).
bool tick()
Leave counter value unchanged (still alive).
bool set(value_type val_r)
Set new counter value.
void range(value_type min_r, value_type max_r)
Set new [min,max].
void name(const std::string &name_r)
Set counter name.
ProgressData::value_type _last_value
value_type reportValue() const
RW_pointer supporting 'copy on write' functionality.
RWCOW_pointer< Data > _d
Pointer to data.