BornAgain  1.19.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 reflection and scattering
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_CORE_COMPUTATION_COMPUTATIONSTATUS_H
21 #define BORNAGAIN_CORE_COMPUTATION_COMPUTATIONSTATUS_H
22 
23 #include <string>
24 
25 //! Completion status (flag and text) of a numeric computation.
26 //! @ingroup algorithms_internal
27 
29 public:
31 
32  bool isCompleted() const { return m_status == COMPLETED; }
33  std::string errorMessage() const { return m_error_message; }
34 
35  void setRunning() { m_status = RUNNING; }
37  void setFailed(const std::string& message)
38  {
39  m_error_message = message;
40  m_status = FAILED;
41  }
42 
43 private:
45 
47  std::string m_error_message;
48 };
49 
50 #endif // BORNAGAIN_CORE_COMPUTATION_COMPUTATIONSTATUS_H
51 #endif // USER_API
Completion status (flag and text) of a numeric computation.
std::string errorMessage() const
ESimulationStatus m_status
bool isCompleted() const
std::string m_error_message
void setFailed(const std::string &message)