BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DelayedProgressCounter.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Computation/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  : mp_progress(p_progress), m_interval(interval), m_count(0)
20 {
21 }
22 
24 {
25  ++m_count;
26  if (m_count == m_interval) {
28  m_count = 0;
29  }
30 }
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).