19 void ProgressHandler::subscribe(ProgressHandler::Callback_t inform)
22 throw std::runtime_error(
"Invalid call of ProgressHandler::subscribe: "
23 "currently, no more than one subscriber is allowed");
33 static std::mutex single_mutex;
34 std::unique_lock<std::mutex> single_lock(single_mutex);
36 m_completed_nticks += ticks_done;
37 if (m_completed_nticks > m_expected_nticks)
38 m_expected_nticks = m_completed_nticks + 1;
40 int percentage_done = (int)(100. * m_completed_nticks / m_expected_nticks);
44 m_continuation_flag = (!m_inform || m_inform(percentage_done)) && m_continuation_flag;
Defines class ProgressHandler.
void incrementDone(size_t ticks_done)
Increments number of completed computation steps (ticks).