// // RcppCommon.h: Rcpp R/C++ interface class library -- common include and defines statements // // Copyright (C) 2008 - 2009 Dirk Eddelbuettel // Copyright (C) 2009 - 2020 Dirk Eddelbuettel and Romain Francois // Copyright (C) 2021 Dirk Eddelbuettel, Romain Francois and IƱaki Ucar // // This file is part of Rcpp. // // Rcpp is free software: you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // Rcpp is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Rcpp. If not, see . #ifndef RcppCommon_h #define RcppCommon_h // #define RCPP_DEBUG_LEVEL 1 // #define RCPP_DEBUG_MODULE_LEVEL 1 #include /** * \brief Rcpp API */ namespace Rcpp { /** * \brief traits used to dispatch wrap */ namespace traits { } // traits /** * \brief internal implementation details */ namespace internal { } // internal } // Rcpp #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace Rcpp { SEXP Rcpp_fast_eval(SEXP expr_, SEXP env); SEXP Rcpp_eval(SEXP expr_, SEXP env = R_GlobalEnv); SEXP Rcpp_precious_preserve(SEXP object); void Rcpp_precious_remove(SEXP token); namespace internal { SEXP Rcpp_eval_impl(SEXP expr, SEXP env); } class Module; namespace traits { template class named_object; } // begin deprecated interface not using precious list // use Rcpp_PreciousPreserve + Rcpp_PreciousRelease below it inline SEXP Rcpp_PreserveObject(SEXP x) { if (x != R_NilValue) R_PreserveObject(x); return x; } inline void Rcpp_ReleaseObject(SEXP x) { if (x != R_NilValue) R_ReleaseObject(x); } inline SEXP Rcpp_ReplaceObject(SEXP x, SEXP y) { // if we are setting to the same SEXP as we already have, do nothing if (x != y) { Rcpp_ReleaseObject(x); Rcpp_PreserveObject(y); } return y; } // end deprecated interface not using precious list // new preferred interface using token-based precious list inline SEXP Rcpp_PreciousPreserve(SEXP object) { return Rcpp_precious_preserve(object); } inline void Rcpp_PreciousRelease(SEXP token) { Rcpp_precious_remove(token); } } #include #include #include #include #include #ifdef RCPP_USING_UNWIND_PROTECT #include #endif #include #include #include #define RcppExport extern "C" attribute_visible #include namespace Rcpp { template class object; class String; namespace internal { template SEXP make_new_object(Class* ptr); } } #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif