Rcpp Version 1.0.9
exceptions.h File Reference
#include <Rversion.h>
#include <Rcpp/exceptions/cpp98/exceptions.h>
Include dependency graph for exceptions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Rcpp::exception
 
class  Rcpp::no_such_env
 
class  Rcpp::file_io_error
 
class  Rcpp::file_not_found
 
class  Rcpp::file_exists
 
struct  Rcpp::LongjumpException
 

Namespaces

 Rcpp
 Rcpp API.
 
 Rcpp::internal
 internal implementation details
 

Macros

#define RCPP_DEFAULT_INCLUDE_CALL   true
 
#define GET_STACKTRACE()   R_NilValue
 
#define RCPP_EXCEPTION_CLASS(__CLASS__, __WHAT__)
 
#define RCPP_SIMPLE_EXCEPTION_CLASS(__CLASS__, __MESSAGE__)
 
#define DEMANGLE(__TYPE__)   demangle( typeid(__TYPE__).name() ).c_str()
 

Functions

static std::string Rcpp::toString (const int i)
 
void Rcpp::warning (const std::string &message)
 
void NORET Rcpp::stop (const std::string &message)
 
SEXP Rcpp::internal::longjumpSentinel (SEXP token)
 
bool Rcpp::internal::isLongjumpSentinel (SEXP x)
 
SEXP Rcpp::internal::getLongjumpToken (SEXP sentinel)
 
void Rcpp::internal::resumeJump (SEXP token)
 
 Rcpp::RCPP_SIMPLE_EXCEPTION_CLASS (not_a_matrix, "Not a matrix.") RCPP_SIMPLE_EXCEPTION_CLASS(no_such_field
 
No such field Rcpp::RCPP_EXCEPTION_CLASS (reference_creation_error, "Error creating object of reference class") RCPP_ADVANCED_EXCEPTION_CLASS(not_compatible
 
SEXP Rcpp::internal::nth (SEXP s, int n)
 
bool Rcpp::internal::is_Rcpp_eval_call (SEXP expr)
 
SEXP get_last_call ()
 
SEXP get_exception_classes (const std::string &ex_class)
 
SEXP make_condition (const std::string &ex_msg, SEXP call, SEXP cppstack, SEXP classes)
 
template<typename Exception >
SEXP exception_to_condition_template (const Exception &ex, bool include_call)
 
SEXP rcpp_exception_to_r_condition (const Rcpp::exception &ex)
 
SEXP exception_to_r_condition (const std::exception &ex)
 
SEXP string_to_try_error (const std::string &str)
 
SEXP exception_to_try_error (const std::exception &ex)
 
std::string demangle (const std::string &name)
 
void forward_exception_to_r (const std::exception &ex)
 
void forward_rcpp_exception_to_r (const Rcpp::exception &ex)
 

Macro Definition Documentation

◆ DEMANGLE

#define DEMANGLE (   __TYPE__)    demangle( typeid(__TYPE__).name() ).c_str()

Definition at line 382 of file exceptions.h.

◆ GET_STACKTRACE

#define GET_STACKTRACE ( )    R_NilValue

Definition at line 31 of file exceptions.h.

◆ RCPP_DEFAULT_INCLUDE_CALL

#define RCPP_DEFAULT_INCLUDE_CALL   true

Definition at line 28 of file exceptions.h.

◆ RCPP_EXCEPTION_CLASS

#define RCPP_EXCEPTION_CLASS (   __CLASS__,
  __WHAT__ 
)
Value:
class __CLASS__ : public std::exception{ \
public: \
__CLASS__( ) throw() : message( std::string(__WHAT__) + "." ){} ; \
__CLASS__( const std::string& message ) throw() : \
message( std::string(__WHAT__) + ": " + message + "." ){} ; \
virtual ~__CLASS__() throw(){} ; \
virtual const char* what() const throw() { return message.c_str() ; } \
private: \
std::string message ; \
} ;
void message(SEXP s)
Definition: message.h:26
Definition: swap.h:25

Definition at line 187 of file exceptions.h.

◆ RCPP_SIMPLE_EXCEPTION_CLASS

#define RCPP_SIMPLE_EXCEPTION_CLASS (   __CLASS__,
  __MESSAGE__ 
)
Value:
class __CLASS__ : public std::exception{ \
public: \
__CLASS__() throw() {} ; \
virtual ~__CLASS__() throw(){} ; \
virtual const char* what() const throw() { return __MESSAGE__ ; } \
} ;

Definition at line 199 of file exceptions.h.

Function Documentation

◆ demangle()

std::string demangle ( const std::string &  name)
inline

◆ exception_to_condition_template()

template<typename Exception >
SEXP exception_to_condition_template ( const Exception &  ex,
bool  include_call 
)
inline

Definition at line 324 of file exceptions.h.

References demangle(), get_exception_classes(), get_last_call(), make_condition(), rcpp_get_stack_trace(), and rcpp_set_stack_trace().

Referenced by exception_to_r_condition(), and rcpp_exception_to_r_condition().

Here is the call graph for this function:

◆ exception_to_r_condition()

SEXP exception_to_r_condition ( const std::exception &  ex)
inline

Definition at line 352 of file exceptions.h.

References exception_to_condition_template(), and RCPP_DEFAULT_INCLUDE_CALL.

Referenced by forward_exception_to_r(), and forward_rcpp_exception_to_r().

Here is the call graph for this function:

◆ exception_to_try_error()

SEXP exception_to_try_error ( const std::exception &  ex)
inline

Definition at line 376 of file exceptions.h.

References string_to_try_error().

Here is the call graph for this function:

◆ forward_exception_to_r()

void forward_exception_to_r ( const std::exception &  ex)
inline

Definition at line 386 of file exceptions.h.

References exception_to_r_condition().

Here is the call graph for this function:

◆ forward_rcpp_exception_to_r()

void forward_rcpp_exception_to_r ( const Rcpp::exception ex)
inline

Definition at line 393 of file exceptions.h.

References exception_to_r_condition().

Here is the call graph for this function:

◆ get_exception_classes()

SEXP get_exception_classes ( const std::string &  ex_class)
inline

Definition at line 288 of file exceptions.h.

Referenced by exception_to_condition_template().

◆ get_last_call()

SEXP get_last_call ( )
inline

Definition at line 268 of file exceptions.h.

References Rcpp::internal::is_Rcpp_eval_call(), and Rcpp::Rcpp_fast_eval().

Referenced by exception_to_condition_template().

Here is the call graph for this function:

◆ make_condition()

SEXP make_condition ( const std::string &  ex_msg,
SEXP  call,
SEXP  cppstack,
SEXP  classes 
)
inline

Definition at line 302 of file exceptions.h.

Referenced by exception_to_condition_template().

◆ rcpp_exception_to_r_condition()

SEXP rcpp_exception_to_r_condition ( const Rcpp::exception ex)
inline

Definition at line 347 of file exceptions.h.

References Rcpp::exception::copy_stack_trace_to_r(), exception_to_condition_template(), and Rcpp::exception::include_call().

Here is the call graph for this function:

◆ string_to_try_error()

SEXP string_to_try_error ( const std::string &  str)
inline

Definition at line 356 of file exceptions.h.

Referenced by exception_to_try_error().