156 return RError(
"internal error: attempt to forward error of successful operation",
sourceLocation);
237 fError->AppendToMessage(
" (unchecked RResult access!)");
278 return std::move(*
fValue);
322#define R__FAIL(msg) ROOT::RError(msg, {R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__})
324#define R__FORWARD_RESULT(res) std::move(res.Forward({R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__}))
326#define R__FORWARD_ERROR(res) res.ForwardError(res, {R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__})
#define R__unlikely(expr)
#define R__LOG_PRETTY_FUNCTION
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
Captures diagnostics related to a ROOT runtime error.
RError(std::string_view message, const RLocation &sourceLocation)
Used by R__FAIL.
std::string fMessage
User-facing error message.
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.
void AppendToMessage(std::string_view info)
Add more information to the diagnostics.
void AddFrame(const RLocation &sourceLocation)
Used by R__FORWARD_RESULT.
const std::vector< RLocation > & GetStackTrace() const
Base class for all ROOT issued exceptions.
RException(const RException &other) noexcept
RException & operator=(const RException &other)=default
RException(const RError &error)
RException(RException &&other)=default
RException & operator=(RException &&other)=default
std::optional< RError > fError
const RError & GetError() const
Common handling of the error case for RResult<T> (T != void) and RResult<void>
RResultBase & operator=(RResultBase &&other)=default
~RResultBase() noexcept(false)
void Throw()
Throws an RException with fError.
RResultBase(RResultBase &&other)=default
bool Check()
Used by the RResult<T> bool operator.
static RError ForwardError(const RResultBase &result, const 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)
RResultBase & operator=(const RResultBase &other)=delete
bool fIsChecked
Switches to true once the user of an RResult object checks the object status.
std::optional< RError > GetError() const
std::unique_ptr< RError > fError
This is the nullptr for an RResult representing success.
void ThrowOnError()
Short-hand method to throw an exception in the case of errors.
RResult & operator=(RResult &&other)=default
RResult & operator=(const RResult &other)=delete
RResult & Forward(const RError::RLocation &sourceLocation)
Used by R__FORWARD_RESULT in order to keep track of the stack trace in case of errors.
RResult(const RResult &other)=delete
RResult(RResult &&other)=default
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...
T Unwrap()
If the operation was successful, returns the inner type by value.
RResult(RResult &&other)=default
RResult & Forward(const RError::RLocation &sourceLocation)
Used by R__FORWARD_RESULT in order to keep track of the stack trace in case of errors.
RResult(const RResult &other)=delete
RResult & operator=(RResult &&other)=default
std::optional< T > fValue
The result value, only present in case of successful execution.
const T & Inspect()
If the operation was successful, returns a const reference to the inner type.
RResult & operator=(const RResult &other)=delete
RLocation(const char *func, const char *file, unsigned int line)