67namespace Experimental {
164 if (!result.fError) {
165 return RError(
"internal error: attempt to forward error of successful operation",
166 std::move(sourceLocation));
168 result.fError->AddFrame(std::move(sourceLocation));
169 return *result.fError;
176 void *
operator new(std::size_t
size) =
delete;
177 void *
operator new(std::size_t,
void *) =
delete;
178 void *
operator new[](std::size_t) =
delete;
179 void *
operator new[](std::size_t,
void *) =
delete;
209 fError->AppendToMessage(
" (unchecked RResult access!)");
229 fError->AddFrame(std::move(sourceLocation));
276 fError->AddFrame(std::move(sourceLocation));
291#define R__FAIL(msg) ROOT::Experimental::RError(msg, {R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__})
293#define R__FORWARD_RESULT(res) std::move(res.Forward({R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__}))
295#define R__FORWARD_ERROR(res) res.ForwardError(std::move(res), {R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__})
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
#define R__unlikely(expr)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Common handling of the error case for RResult<T> (T != void) and RResult<void>
RResultBase & operator=(const RResultBase &other)=delete
bool fIsChecked
Switches to true once the user of an RResult object checks the object status.
RResultBase(RResultBase &&other)=default
std::unique_ptr< RError > fError
This is the nullptr for an RResult representing success.
void Throw()
Throws an RException with fError.
~RResultBase() noexcept(false)
bool Check()
Used by the RResult<T> bool operator.
static RError ForwardError(RResultBase &&result, RError::RLocation &&sourceLocation)
Used by R__FORWARD_ERROR in order to keep track of the stack trace.
RResultBase(const RResultBase &other)=delete
RResultBase(RError &&error)
Captures diagnostics related to a ROOT runtime error.
const std::vector< RLocation > & GetStackTrace() const
std::string fMessage
User-facing error message.
void AddFrame(RLocation &&sourceLocation)
Used by R__FORWARD_RESULT.
void AppendToMessage(const std::string &info)
Add more information to the diagnostics.
std::vector< RLocation > fStackTrace
The location of the error related to fMessage plus upper frames if the error is forwarded through the...
std::string GetReport() const
Format a dignostics report, e.g. for an exception message.
Base class for all ROOT issued exceptions.
RException(const RError &error)
const RError & GetError() const
RResult(const RResult &other)=delete
RResult & Forward(RError::RLocation &&sourceLocation)
Used by R__FORWARD_RESULT in order to keep track of the stack trace in case of errors.
RResult(RResult &&other)=default
void ThrowOnError()
Short-hand method to throw an exception in the case of errors.
static RResult Success()
Returns a RResult<void> that captures the successful execution of the function.
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
const T & Inspect()
If the operation was successful, returns a const reference to the inner type.
T fValue
The result value in case of successful execution.
RResult(const RResult &other)=delete
T Unwrap()
If the operation was successful, returns the inner type by value.
RResult & Forward(RError::RLocation &&sourceLocation)
Used by R__FORWARD_RESULT in order to keep track of the stack trace in case of errors.
RResult(RResult &&other)=default
RResult & operator=(const RResult &other)=delete
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
RLocation(const char *func, const char *file, int line)