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
15
#include "
Core/Computation/DelayedProgressCounter.h
"
16
#include "
Core/Computation/ProgressHandler.h
"
17
18
DelayedProgressCounter::DelayedProgressCounter
(
ProgressHandler
* p_progress,
size_t
interval)
19
: mp_progress(p_progress), m_interval(interval), m_count(0)
20
{
21
}
22
23
void
DelayedProgressCounter::stepProgress
()
24
{
25
++
m_count
;
26
if
(
m_count
==
m_interval
) {
27
mp_progress
->
incrementDone
(
m_interval
);
28
m_count
= 0;
29
}
30
}
DelayedProgressCounter.h
Defines class DelayedProgressCounter.
ProgressHandler.h
Defines class ProgressHandler.
DelayedProgressCounter::mp_progress
ProgressHandler * mp_progress
Definition:
DelayedProgressCounter.h:34
DelayedProgressCounter::DelayedProgressCounter
DelayedProgressCounter(ProgressHandler *p_progress, size_t interval)
Definition:
DelayedProgressCounter.cpp:18
DelayedProgressCounter::m_interval
const size_t m_interval
Definition:
DelayedProgressCounter.h:35
DelayedProgressCounter::stepProgress
void stepProgress()
Increments inner counter; at regular intervals updates progress handler.
Definition:
DelayedProgressCounter.cpp:23
DelayedProgressCounter::m_count
size_t m_count
Definition:
DelayedProgressCounter.h:36
ProgressHandler
Maintains information about progress of a computation.
Definition:
ProgressHandler.h:31
ProgressHandler::incrementDone
void incrementDone(size_t ticks_done)
Increments number of completed computation steps (ticks).
Definition:
ProgressHandler.cpp:31
Core
Computation
DelayedProgressCounter.cpp
Generated by
1.9.1