BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Interface for a single-threaded computation with given range of DiffuseElements and ProgressHandler.
Controlled by the multi-threading machinery in ISimulation::runSingleSimulation().
Definition at line 37 of file IComputation.h.
Public Member Functions | |
IComputation (const reSample &re_sample, const SimulationOptions &options, ProgressHandler &progress) | |
virtual | ~IComputation () |
void | compute () |
Calls runProtected(), catches exceptions, sets m_status. More... | |
std::string | errorMessage () const |
bool | isCompleted () const |
Protected Member Functions | |
void | setProgressHandler (ProgressHandler *progress) const |
void | stepProgress () const |
Protected Attributes | |
const SimulationOptions & | m_options |
ProgressHandler * | m_progress |
const reSample & | m_re_sample |
ComputationStatus | m_status |
Private Member Functions | |
virtual void | runProtected ()=0 |
Runs computation. May throw. To be called from run(), which catches exceptions. More... | |
Private Attributes | |
std::unique_ptr< DelayedProgressCounter > | m_progress_counter |
IComputation::IComputation | ( | const reSample & | re_sample, |
const SimulationOptions & | options, | ||
ProgressHandler & | progress | ||
) |
Definition at line 20 of file IComputation.cpp.
|
virtualdefault |
void IComputation::compute | ( | ) |
Calls runProtected(), catches exceptions, sets m_status.
Definition at line 41 of file IComputation.cpp.
References ProgressHandler::alive(), m_progress, m_status, runProtected(), ComputationStatus::setCompleted(), ComputationStatus::setFailed(), setProgressHandler(), and ComputationStatus::setRunning().
|
inline |
Definition at line 47 of file IComputation.h.
References ComputationStatus::errorMessage(), and m_status.
|
inline |
Definition at line 46 of file IComputation.h.
References ComputationStatus::isCompleted(), and m_status.
|
privatepure virtual |
Runs computation. May throw. To be called from run(), which catches exceptions.
Implemented in SpecularComputation, DWBAComputation, and DepthProbeComputation.
Referenced by compute().
|
protected |
Definition at line 30 of file IComputation.cpp.
References m_progress_counter.
Referenced by compute().
|
protected |
Definition at line 35 of file IComputation.cpp.
References m_progress_counter.
Referenced by DepthProbeComputation::runProtected(), DWBAComputation::runProtected(), and SpecularComputation::runProtected().
|
protected |
Definition at line 54 of file IComputation.h.
|
protected |
Definition at line 55 of file IComputation.h.
Referenced by compute(), and DWBAComputation::runProtected().
|
mutableprivate |
Definition at line 62 of file IComputation.h.
Referenced by setProgressHandler(), and stepProgress().
|
protected |
Definition at line 53 of file IComputation.h.
Referenced by DepthProbeComputation::runProtected(), DWBAComputation::runProtected(), and SpecularComputation::runProtected().
|
protected |
Definition at line 56 of file IComputation.h.
Referenced by compute(), errorMessage(), and isCompleted().