R/Rcpp_exceptions.R

Defines functions .rcpp_collect_warnings .rcpp_warning_recorder .rcpp_error_recorder

.rcpp_error_recorder <- function(e){  
    invisible( .Call( "rcpp_error_recorder", e ) )
}

.warningsEnv <- new.env()
.warningsEnv$warnings <- character()

.rcpp_warning_recorder <- function(w){
    .warningsEnv$warnings <- append(.warningsEnv$warnings, w$message)
    invokeRestart("muffleWarning")
}

.rcpp_collect_warnings <- function() {
    warnings <- .warningsEnv$warnings
    .warningsEnv$warnings <- character()
    warnings
}
rohan-shah/mpMap2 documentation built on July 21, 2020, 8:58 p.m.