// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- // // RcppCommon.h: Rcpp R/C++ interface class library -- common include and defines statements // // Copyright (C) 2008 - 2009 Dirk Eddelbuettel // Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois // // 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 #include #include #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 namespace Rcpp{ SEXP Rcpp_eval(SEXP expr_, SEXP env = R_GlobalEnv ) ; class Module ; namespace traits{ template class named_object ; } 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( Rf_isNull(x) ){ Rcpp_PreserveObject( y ) ; } else if( Rf_isNull(y) ){ 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 ; } } #include #include #include #include #include #include #include #include #define RcppExport extern "C" #include #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