Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Core/include/Acts/Utilities/Result.hpp>
Public Member Functions | |
Result ()=default | |
Default constructor which initializes the result in the ok state. | |
Result (const Result< void, E > &other)=default | |
The copy constructor is deleted. | |
Result< void, E > & | operator= (const Result< void, E > &other)=default |
The (self) assignment operator is deleted. | |
Result (Result< void, E > &&other) | |
Result< void, E > & | operator= (Result< void, E > &&other) noexcept |
template<typename E2 > | |
Result (E2 error) noexcept | |
template<typename E2 > | |
Result< void, E > & | operator= (E2 error) |
bool | ok () const noexcept |
E & | error ()&noexcept |
const E & | error () const &noexcept |
E | error ()&&noexcept |
Static Public Member Functions | |
static Result< void, E > | success () |
static Result< void, E > | failure (E error) |
Private Attributes | |
std::optional< E > | m_opt |
Template specialization for the void case. This specialization handles the case where there is no actual return value, but an error might be returned. Returning the error directly would make handling different from other functions using the Result<T, E>
mechanism. Result<void, E>
does not have the dereference operator, and value methods. The static success
factory does not accept a value.
Result<void, E>
is default constructible in the ok state, whereas Result<T, E>
is not. E | The type of the error |
Definition at line 208 of file Result.hpp.
View newest version in sPHENIX GitHub at line 208 of file Result.hpp
|
default |
Default constructor which initializes the result in the ok state.
|
default |
The copy constructor is deleted.
|
inline |
Move constructor
other | The other result object, rvalue ref |
Definition at line 221 of file Result.hpp.
View newest version in sPHENIX GitHub at line 221 of file Result.hpp
|
inlinenoexcept |
Constructor from error. This implicitly requires E2 to be convertible to E.
E2 | The type of the actual error |
error | The instance of the actual error |
Definition at line 235 of file Result.hpp.
View newest version in sPHENIX GitHub at line 235 of file Result.hpp
|
inlinenoexcept |
Returns a reference to the error stored in the result.
res.ok()
this method will abort (noexcept) Definition at line 265 of file Result.hpp.
View newest version in sPHENIX GitHub at line 265 of file Result.hpp
|
inlinenoexcept |
Returns a reference to the error stored in the result.
res.ok()
this method will abort (noexcept) Definition at line 270 of file Result.hpp.
View newest version in sPHENIX GitHub at line 270 of file Result.hpp
|
inlinenoexcept |
Returns the error by-value.
res.ok()
this method will abort (noexcept) Definition at line 275 of file Result.hpp.
View newest version in sPHENIX GitHub at line 275 of file Result.hpp
References testing::internal::move().
|
inlinestatic |
Static factory function to initialize the result in the error state.
error | The error to initialize with. |
Definition at line 254 of file Result.hpp.
View newest version in sPHENIX GitHub at line 254 of file Result.hpp
References testing::internal::move().
|
inlinenoexcept |
Checks whether this result is in the ok state, and no error.
Definition at line 260 of file Result.hpp.
View newest version in sPHENIX GitHub at line 260 of file Result.hpp
|
default |
The (self) assignment operator is deleted.
|
inlinenoexcept |
Move assignment operator
other | The other result object, rvalue ref |
Definition at line 225 of file Result.hpp.
View newest version in sPHENIX GitHub at line 225 of file Result.hpp
References m_opt, and testing::internal::move().
|
inline |
Assignment operator from an error.
E2 | The type of the actual error |
error | The instance of the actual error |
Definition at line 242 of file Result.hpp.
View newest version in sPHENIX GitHub at line 242 of file Result.hpp
References testing::internal::move().
|
inlinestatic |
Static factory function to initialize the result in the ok state.
Definition at line 249 of file Result.hpp.
View newest version in sPHENIX GitHub at line 249 of file Result.hpp
|
private |
Definition at line 278 of file Result.hpp.
View newest version in sPHENIX GitHub at line 278 of file Result.hpp
Referenced by operator=().