15 #ifndef BORNAGAIN_CORE_COMPUTATION_PROGRESSHANDLER_H
16 #define BORNAGAIN_CORE_COMPUTATION_PROGRESSHANDLER_H
33 typedef std::function<bool(
size_t)> Callback_t;
36 : m_inform(
nullptr), m_expected_nticks(0), m_completed_nticks(0), m_continuation_flag(
true)
40 : m_inform(other.m_inform)
42 m_expected_nticks(other.m_expected_nticks), m_completed_nticks(other.m_completed_nticks)
45 void subscribe(ProgressHandler::Callback_t callback);
48 m_completed_nticks = 0;
49 m_continuation_flag =
true;
51 void setExpectedNTicks(
size_t n) { m_expected_nticks = n; }
53 bool alive() {
return m_continuation_flag; }
57 size_t m_expected_nticks;
58 size_t m_completed_nticks;
59 bool m_continuation_flag;
60 bool defaultMonitorExec(
int);
Our sample model: a stack of layers one below the other.
Maintains information about progress of a computation.
void incrementDone(size_t ticks_done)
Increments number of completed computation steps (ticks).