31namespace Experimental {
129 return RError(
"internal error: attempt to forward error of successful operation",
130 std::move(sourceLocation));
132 result.fError->AddFrame(std::move(sourceLocation));
140 void *
operator new(std::size_t
size) =
delete;
141 void *
operator new(std::size_t,
void *) =
delete;
142 void *
operator new[](std::size_t) =
delete;
143 void *
operator new[](std::size_t,
void *) =
delete;
221 fError->AppendToMessage(
" (unchecked RResult access!)");
241 fError->AddFrame(std::move(sourceLocation));
288 fError->AddFrame(std::move(sourceLocation));
303#define R__FAIL(msg) ROOT::Experimental::RError(msg, {R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__})
305#define R__FORWARD_RESULT(res) std::move(res.Forward({R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__}))
307#define R__FORWARD_ERROR(res) res.ForwardError(std::move(res), {R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__})
#define R__unlikely(expr)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
RLocation(const char *func, const char *file, int line)