Common handling of the error case for RResult<T> (T != void) and RResult<void>
RResultBase captures a possible runtime error that might have occured. If the RResultBase leaves the scope unchecked, it will throw an exception. RResultBase should only be allocated on the stack, which is helped by deleting the new operator. RResultBase is movable but not copyable to avoid throwing multiple exceptions about the same failure.
Definition at line 98 of file RError.hxx.
Public Member Functions | |
RResultBase (const RResultBase &other)=delete | |
RResultBase (RResultBase &&other)=default | |
~RResultBase () noexcept(false) | |
RError * | GetError () |
void * | operator new (std::size_t size)=delete |
void * | operator new (std::size_t, void *)=delete |
void * | operator new[] (std::size_t)=delete |
void * | operator new[] (std::size_t, void *)=delete |
RResultBase & | operator= (const RResultBase &other)=delete |
RResultBase & | operator= (RResultBase &&other)=default |
void | Throw () |
Throws an RException with fError. | |
Static Public Member Functions | |
static RError | ForwardError (RResultBase &&result, RError::RLocation &&sourceLocation) |
Used by R__FORWARD_ERROR in order to keep track of the stack trace. | |
Protected Member Functions | |
RResultBase ()=default | |
RResultBase (RError &&error) | |
bool | Check () |
Used by the RResult<T> bool operator. | |
Protected Attributes | |
std::unique_ptr< RError > | fError |
This is the nullptr for an RResult representing success. | |
bool | fIsChecked {false} |
Switches to true once the user of an RResult object checks the object status. | |
#include <ROOT/RError.hxx>
|
protecteddefault |
|
inlineexplicitprotected |
Definition at line 106 of file RError.hxx.
|
delete |
|
default |
ROOT::Experimental::Internal::RResultBase::~RResultBase | ( | ) |
Definition at line 51 of file RError.cxx.
|
inlineprotected |
Used by the RResult<T> bool operator.
Definition at line 109 of file RError.hxx.
|
inlinestatic |
Used by R__FORWARD_ERROR in order to keep track of the stack trace.
Definition at line 127 of file RError.hxx.
|
inline |
Definition at line 122 of file RError.hxx.
|
delete |
|
delete |
|
delete |
|
delete |
|
delete |
|
default |
void ROOT::Experimental::Internal::RResultBase::Throw | ( | ) |
Throws an RException with fError.
Definition at line 69 of file RError.cxx.
|
protected |
This is the nullptr for an RResult representing success.
Definition at line 101 of file RError.hxx.
|
protected |
Switches to true once the user of an RResult object checks the object status.
Definition at line 103 of file RError.hxx.