BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ComputationStatus.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Core/Computation/ComputationStatus.h
6 //! @brief Defines and implements interface class ComputationStatus.
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_COMPUTATIONSTATUS_H
16 #define BORNAGAIN_CORE_COMPUTATION_COMPUTATIONSTATUS_H
17 
18 #include <string>
19 
20 //! Completion status (flag and text) of a numeric computation.
21 //! @ingroup algorithms_internal
22 
24 {
25 public:
27 
28  bool isCompleted() const { return m_status == COMPLETED; }
29  std::string errorMessage() const { return m_error_message; }
30 
31  void setRunning() { m_status = RUNNING; }
33  void setFailed() { m_status = FAILED; }
34  void setErrorMessage(const std::string& message) { m_error_message = message; }
35 
36 private:
38 
40  std::string m_error_message;
41 };
42 
43 #endif // BORNAGAIN_CORE_COMPUTATION_COMPUTATIONSTATUS_H
Completion status (flag and text) of a numeric computation.
std::string errorMessage() const
ESimulationStatus m_status
void setErrorMessage(const std::string &message)
bool isCompleted() const
std::string m_error_message