Mantid
Loading...
Searching...
No Matches
Framework
API
inc
MantidAPI
Result.h
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2023 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8
9
#include <string>
10
11
namespace
Mantid
{
12
namespace
API
{
13
14
template
<
typename
T>
class
Result
{
15
public
:
16
Result
(T
result
, std::string
errors
=
""
) :
m_result
(
std
::move(
result
)),
m_errors
(
std
::move(
errors
)) {}
17
18
// accessors
19
inline
const
T &
result
()
const
{
return
m_result
; }
20
inline
const
std::string &
errors
()
const
{
return
m_errors
; }
21
22
// boolean conversion so you can use it directly in an if
23
operator
bool()
const
{
return
m_errors
.empty(); }
24
25
private
:
26
T
m_result
;
27
std::string
m_errors
;
28
};
29
}
// namespace API
30
}
// namespace Mantid
Mantid::API::Result
Definition
Result.h:14
Mantid::API::Result::errors
const std::string & errors() const
Definition
Result.h:20
Mantid::API::Result::m_result
T m_result
Definition
Result.h:26
Mantid::API::Result::Result
Result(T result, std::string errors="")
Definition
Result.h:16
Mantid::API::Result::m_errors
std::string m_errors
Definition
Result.h:27
Mantid::API::Result::result
const T & result() const
Definition
Result.h:19
API
Definition
ChudleyElliotSQE.h:11
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition
AbsorptionCorrection.h:18
std
STL namespace.
Generated by
1.9.8