10 #ifndef ZYPP_ParserProgress_H 11 #define ZYPP_ParserProgress_H 13 #include <boost/shared_ptr.hpp> 14 #include <boost/function.hpp> 26 using Ptr = boost::shared_ptr<ParserProgress>;
34 ParserProgress( boost::function<
void (
long int)> fnc,
long int total_steps = 100 )
54 long int current_done = p;
55 p = (
long int)(((
double) current_done/(
double)
_total_steps)*100);
97 boost::function<void (long int)>
_fnc;
105 #endif // ZYPP_ParserProgress_H boost::function< void(long int)> _fnc
ParserProgress(boost::function< void(long int)> fnc, long int total_steps=100)
initializes a progress objetc, with a callback functor if you are not reporting percentage, then set the total_steps to the goal, and report using the same unit, then
void start()
report progress started
void progress(long int p)
report progress, which in most cases executes the functor associated with this progress object to upd...
boost::shared_ptr< ParserProgress > Ptr
void setTotalSteps(long int total_steps)
long int _previous_progress
Easy-to use interface to the ZYPP dependency resolver.
void finish()
report progress finished