Logo ROOT  
Reference Guide
No Matches
ROOT::Experimental::RResultBase Class Reference

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 96 of file RError.hxx.

Public Member Functions

 RResultBase (const RResultBase &other)=delete
 RResultBase (RResultBase &&other)=default
 ~RResultBase () noexcept(false)
RErrorGetError ()
RResultBaseoperator= (const RResultBase &other)=delete
RResultBaseoperator= (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< RErrorfError
 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>

Inheritance diagram for ROOT::Experimental::RResultBase:

Constructor & Destructor Documentation

◆ RResultBase() [1/4]

ROOT::Experimental::RResultBase::RResultBase ( )

◆ RResultBase() [2/4]

ROOT::Experimental::RResultBase::RResultBase ( RError &&  error)

Definition at line 104 of file RError.hxx.

◆ RResultBase() [3/4]

ROOT::Experimental::RResultBase::RResultBase ( const RResultBase other)

◆ RResultBase() [4/4]

ROOT::Experimental::RResultBase::RResultBase ( RResultBase &&  other)

◆ ~RResultBase()

ROOT::Experimental::RResultBase::~RResultBase ( )

Definition at line 50 of file RError.cxx.

Member Function Documentation

◆ Check()

bool ROOT::Experimental::RResultBase::Check ( )

Used by the RResult<T> bool operator.

Definition at line 107 of file RError.hxx.

◆ ForwardError()

static RError ROOT::Experimental::RResultBase::ForwardError ( RResultBase &&  result,
RError::RLocation &&  sourceLocation 

Used by R__FORWARD_ERROR in order to keep track of the stack trace.

Definition at line 125 of file RError.hxx.

◆ GetError()

RError * ROOT::Experimental::RResultBase::GetError ( )

Definition at line 120 of file RError.hxx.

◆ operator=() [1/2]

RResultBase & ROOT::Experimental::RResultBase::operator= ( const RResultBase other)

◆ operator=() [2/2]

RResultBase & ROOT::Experimental::RResultBase::operator= ( RResultBase &&  other)

◆ Throw()

void ROOT::Experimental::RResultBase::Throw ( )

Throws an RException with fError.

Definition at line 67 of file RError.cxx.

Member Data Documentation

◆ fError

std::unique_ptr<RError> ROOT::Experimental::RResultBase::fError

This is the nullptr for an RResult representing success.

Definition at line 99 of file RError.hxx.

◆ fIsChecked

bool ROOT::Experimental::RResultBase::fIsChecked {false}

Switches to true once the user of an RResult object checks the object status.

Definition at line 101 of file RError.hxx.

Libraries for ROOT::Experimental::RResultBase:

The documentation for this class was generated from the following files: