BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
DelayedProgressCounter.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Base/Progress/DelayedProgressCounter.cpp
6 //! @brief Implements class DelayedProgressCounter.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
17 
19  : m_progress(p_progress)
20  , m_interval(interval)
21  , m_count(0)
22 {
23 }
24 
26 {
27  ++m_count;
28  if (m_count == m_interval) {
30  m_count = 0;
31  }
32 }
Defines class DelayedProgressCounter.
Defines class ProgressHandler.
DelayedProgressCounter(ProgressHandler *p_progress, size_t interval)
void stepProgress()
Increments inner counter; at regular intervals updates progress handler.
Maintains information about progress of a computation.
void incrementDone(size_t ticks_done)
Increments number of completed computation steps (ticks). Performs callback (method m_inform) to info...