BornAgain  1.19.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 reflection and scattering
4 //
5 //! @file Base/Progress/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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_BASE_PROGRESS_DELAYEDPROGRESSCOUNTER_H
21 #define BORNAGAIN_BASE_PROGRESS_DELAYEDPROGRESSCOUNTER_H
22 
23 #include <cstddef>
24 
25 class ProgressHandler;
26 
27 //! Counter for reporting progress (with delay interval) in a threaded computation.
28 
30 public:
31  DelayedProgressCounter(ProgressHandler* p_progress, size_t interval);
33 
34  //! Increments inner counter; at regular intervals updates progress handler.
35  void stepProgress();
36 
37 private:
39  const size_t m_interval;
40  size_t m_count;
41 };
42 
43 #endif // BORNAGAIN_BASE_PROGRESS_DELAYEDPROGRESSCOUNTER_H
44 #endif // USER_API
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.