Logo ROOT  
Reference Guide
ROOT::Experimental::Internal::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 135 of file RError.hxx.

Public Member Functions

 RResultBase (const RResultBase &other)=delete
 
 RResultBase (RResultBase &&other)=default
 
 ~RResultBase () noexcept(false)
 
RErrorGetError ()
 
voidoperator new (std::size_t size)=delete
 
voidoperator new (std::size_t, void *)=delete
 
voidoperator new[] (std::size_t)=delete
 
voidoperator new[] (std::size_t, void *)=delete
 
RResultBaseoperator= (const RResultBase &other)=delete
 
RResultBaseoperator= (RResultBase &&other)=default
 
void Throw ()
 Throws an RException with fError. More...
 

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. More...
 

Protected Member Functions

 RResultBase ()=default
 
 RResultBase (RError &&error)
 
bool Check ()
 Used by the RResult<T> bool operator. More...
 

Protected Attributes

std::unique_ptr< RErrorfError
 This is the nullptr for an RResult representing success. More...
 
bool fIsChecked {false}
 Switches to true once the user of an RResult object checks the object status. More...
 

#include <ROOT/RError.hxx>

Inheritance diagram for ROOT::Experimental::Internal::RResultBase:
[legend]

Constructor & Destructor Documentation

◆ RResultBase() [1/4]

ROOT::Experimental::Internal::RResultBase::RResultBase ( )
protecteddefault

◆ RResultBase() [2/4]

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

Definition at line 143 of file RError.hxx.

◆ RResultBase() [3/4]

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

◆ RResultBase() [4/4]

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

◆ ~RResultBase()

ROOT::Experimental::Internal::RResultBase::~RResultBase ( )
noexcept

Definition at line 51 of file RError.cxx.

Member Function Documentation

◆ Check()

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

Used by the RResult<T> bool operator.

Definition at line 146 of file RError.hxx.

◆ ForwardError()

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

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

Definition at line 164 of file RError.hxx.

◆ GetError()

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

Definition at line 159 of file RError.hxx.

◆ operator new() [1/2]

void* ROOT::Experimental::Internal::RResultBase::operator new ( std::size_t  size)
delete

◆ operator new() [2/2]

void* ROOT::Experimental::Internal::RResultBase::operator new ( std::size_t  ,
void  
)
delete

◆ operator new[]() [1/2]

void* ROOT::Experimental::Internal::RResultBase::operator new[] ( std::size_t  )
delete

◆ operator new[]() [2/2]

void* ROOT::Experimental::Internal::RResultBase::operator new[] ( std::size_t  ,
void  
)
delete

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Throw()

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

Throws an RException with fError.

Definition at line 69 of file RError.cxx.

Member Data Documentation

◆ fError

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

This is the nullptr for an RResult representing success.

Definition at line 138 of file RError.hxx.

◆ fIsChecked

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

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

Definition at line 140 of file RError.hxx.


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