BornAgain
1.19.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 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
15
#include "
Base/Progress/DelayedProgressCounter.h
"
16
#include "
Base/Progress/ProgressHandler.h
"
17
18
DelayedProgressCounter::DelayedProgressCounter
(
ProgressHandler
* p_progress,
size_t
interval)
19
: m_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
m_progress
->
incrementDone
(
m_interval
);
28
m_count
= 0;
29
}
30
}
DelayedProgressCounter.h
Defines class DelayedProgressCounter.
ProgressHandler.h
Defines class ProgressHandler.
DelayedProgressCounter::m_progress
ProgressHandler * m_progress
Definition:
DelayedProgressCounter.h:38
DelayedProgressCounter::DelayedProgressCounter
DelayedProgressCounter(ProgressHandler *p_progress, size_t interval)
Definition:
DelayedProgressCounter.cpp:18
DelayedProgressCounter::m_interval
const size_t m_interval
Definition:
DelayedProgressCounter.h:39
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:40
ProgressHandler
Maintains information about progress of a computation.
Definition:
ProgressHandler.h:35
ProgressHandler::incrementDone
void incrementDone(size_t ticks_done)
Increments number of completed computation steps (ticks).
Definition:
ProgressHandler.cpp:31
Base
Progress
DelayedProgressCounter.cpp
Generated by
1.9.1