BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DelayedProgressCounter.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Computation/DelayedProgressCounter.h
6 //! @brief Defines 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 
15 #ifndef BORNAGAIN_CORE_COMPUTATION_DELAYEDPROGRESSCOUNTER_H
16 #define BORNAGAIN_CORE_COMPUTATION_DELAYEDPROGRESSCOUNTER_H
17 
18 #include <cstddef>
19 
20 class ProgressHandler;
21 
22 //! Counter for reporting progress (with delay interval) in a threaded computation.
23 
25 {
26 public:
27  DelayedProgressCounter(ProgressHandler* p_progress, size_t interval);
29 
30  //! Increments inner counter; at regular intervals updates progress handler.
31  void stepProgress();
32 
33 private:
35  const size_t m_interval;
36  size_t m_count;
37 };
38 
39 #endif // BORNAGAIN_CORE_COMPUTATION_DELAYEDPROGRESSCOUNTER_H
Counter for reporting progress (with delay interval) in a threaded computation.
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.