22 typedef std::function<void(
const std::string &name,
long nTotal,
bool cancellable)>
Start_t;
23 typedef std::function<void(
long nDone,
bool *cancelled)>
Update_t;
29 static void Start(
const std::string &name,
long total,
bool cancelable =
false);
36 static inline bool Cancelled() {
return _cancelled; }
49 static bool _cancelled;
std::function< void(const std::string &name, long nTotal, bool cancellable)> Start_t
static void Start(const std::string &name, long total, bool cancelable=false)
static void SetHandlers(Start_t start, Update_t update, Finish_t finish)
static void Update(long completed)
Update the progress status.
static void Sleep(double s)
For testing purposes only.
std::function< void(long nDone, bool *cancelled)> Update_t
static void StartIndefinite(const std::string &name, bool cancelable=false)
Same as start but the progress is unknown. Update(0) still needs to be called periodically.
std::function< void()> Finish_t
static void Finish()
Signify the computation was cancelled.