#ifndef Rcpp11_h #define Rcpp11_h // #define RCPP_DEBUG_LEVEL 1 #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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace Rcpp{ // we need to copy to a buffer because destruction of the string can // remove the contents of the short file name static char sfn[1024]; inline char* short_file_name(const char* file) { std::string f(file) ; std::string substr = f.substr( f.find_last_of("/") + 1 ); strncpy(sfn, substr.c_str(), 1024); return sfn; } class String ; template class PreserveStorage ; template class NoProtectStorage ; template class StoragePolicy = PreserveStorage> class Vector ; template class StoragePolicy = PreserveStorage> class Matrix ; using CharacterVector = Vector ; using List = Vector ; using ExpressionVector = Vector ; RCPP_API_CLASS_DECL(RObject) RCPP_API_CLASS_DECL(Language) RCPP_API_CLASS_DECL(Pairlist) ; RCPP_API_CLASS_DECL(Environment) ; RCPP_API_CLASS_DECL(Promise) ; RCPP_API_CLASS_DECL(WeakReference) ; RCPP_API_CLASS_DECL(S4) ; RCPP_API_CLASS_DECL(Formula) ; RCPP_API_CLASS_DECL(Reference) ; RCPP_API_CLASS_DECL(Function) ; template < template class StoragePolicy > class Symbol_Impl ; using Symbol = Symbol_Impl ; template < template class StoragePolicy > class DataFrame_Impl ; using DataFrame = DataFrame_Impl ; } namespace Rcpp{ 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( x == R_NilValue ){ Rcpp_PreserveObject( y ) ; } else if( y == R_NilValue ){ Rcpp_ReleaseObject( x ) ; } else { // if we are setting to the same SEXP as we already have, do nothing if (x != y) { // the previous SEXP was not NULL, so release it Rcpp_ReleaseObject(x); // the new SEXP is not NULL, so preserve it Rcpp_PreserveObject(y); } } return y ; } template T as( SEXP ) ; } #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 #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 #include #include #include #include #include #include #include #include #include #endif