Rcpp Version 1.1.2
Loading...
Searching...
No Matches
exceptions.h File Reference
#include <Rversion.h>
#include <cstdio>
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

namespace  Rcpp
 Rcpp API.
namespace  Rcpp::internal
 internal implementation details

Macros

#define RCPP_DEFAULT_INCLUDE_CALL   true
#define GET_STACKTRACE()
#define RCPP_ADVANCED_EXCEPTION_CLASS(__CLASS__, __WHAT__)
#define RCPP_EXCEPTION_CLASS(__CLASS__, __WHAT__)
#define RCPP_SIMPLE_EXCEPTION_CLASS(__CLASS__, __MESSAGE__)
#define DEMANGLE(__TYPE__)

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)
template<typename... Args>
void Rcpp::warning (const char *fmt, Args &&... args)
template<typename... Args>
void NORET Rcpp::stop (const char *fmt, Args &&... args)
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__)
Value:
demangle( typeid(__TYPE__).name() ).c_str()
std::string demangle(const std::string &name)
Definition routines.h:192

Definition at line 403 of file exceptions.h.

Referenced by Rcpp::sugar::IndexHash< RTYPE >::add_value(), Rcpp::String::append_wide_string(), Rcpp::internal::as(), CppProperty_GetConstMethod< Class, PROP >::CppProperty_GetConstMethod(), CppProperty_GetConstMethod_SetMethod< Class, PROP >::CppProperty_GetConstMethod_SetMethod(), CppProperty_GetConstMethod_SetPointer< Class, PROP >::CppProperty_GetConstMethod_SetPointer(), CppProperty_GetMethod< Class, PROP >::CppProperty_GetMethod(), CppProperty_GetMethod_SetMethod< Class, PROP >::CppProperty_GetMethod_SetMethod(), CppProperty_GetMethod_SetPointer< Class, PROP >::CppProperty_GetMethod_SetPointer(), CppProperty_GetPointer_SetMethod< Class, PROP >::CppProperty_GetPointer_SetMethod(), CppProperty_GetPointer_SetPointer< Class, PROP >::CppProperty_GetPointer_SetPointer(), CppProperty_GetPointerMethod< Class, PROP >::CppProperty_GetPointerMethod(), CppProperty_Getter< PROP >::CppProperty_Getter(), CppProperty_Getter_Setter< PROP >::CppProperty_Getter_Setter(), Rcpp::finalizer_wrapper(), Rcpp::internal::string_element_converter< STRSXP >::get(), Rcpp::sugar::IfElse< RTYPE, COND_NA, COND_T, LHS_NA, LHS_T, RHS_NA, RHS_T >::IfElse(), Rcpp::Vector< VECSXP, StoragePolicy >::import_sugar_expression(), Rcpp::Vector< VECSXP, StoragePolicy >::import_sugar_expression(), class_< Class >::property(), Rcpp::internal::range_wrap_dispatch___impl__pair(), Rcpp::Vector< VECSXP, StoragePolicy >::replace_element__dispatch__isArgument(), Rcpp::Vector< VECSXP, StoragePolicy >::replace_element__dispatch__isArgument(), Rcpp::sugar::Sapply< RTYPE, NA, T, Function, NO_CONVERSION >::Sapply(), Rcpp::sugar::Sapply< RTYPE, NA, T, Function, true >::Sapply(), Rcpp::Vector< VECSXP, StoragePolicy >::Vector(), Rcpp::Vector< VECSXP, StoragePolicy >::Vector(), and Rcpp::internal::wrap_range_sugar_expression().

◆ GET_STACKTRACE

#define GET_STACKTRACE ( )
Value:
R_NilValue

Definition at line 33 of file exceptions.h.

◆ RCPP_ADVANCED_EXCEPTION_CLASS

#define RCPP_ADVANCED_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 + "."){} \
template <typename... Args> \
__CLASS__( const char* fmt, Args&&... args ) throw() : \
message( tfm::format(fmt, std::forward<Args>(args)... ) ){} \
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 String.h:736
void format(std::ostream &out, const char *fmt)
Definition tinyformat.h:996

Definition at line 173 of file exceptions.h.

◆ RCPP_DEFAULT_INCLUDE_CALL

#define RCPP_DEFAULT_INCLUDE_CALL   true

◆ 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 ; \
} ;

Definition at line 208 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 220 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 345 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 373 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 397 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 407 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 414 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 309 of file exceptions.h.

Referenced by exception_to_condition_template().

◆ get_last_call()

SEXP get_last_call ( )
inline

Definition at line 289 of file exceptions.h.

References Rcpp::internal::is_Rcpp_eval_call().

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 323 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 368 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 377 of file exceptions.h.

Referenced by exception_to_try_error().