12 #ifndef ROOT_R_RExports
13 #define ROOT_R_RExports
40 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
41 #pragma GCC diagnostic ignored "-Wshadow"
42 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
43 #pragma GCC diagnostic ignored "-Wunused-parameter"
44 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
45 #pragma GCC diagnostic ignored "-Wextra"
46 #pragma GCC diagnostic ignored "-Wignored-qualifiers"
51 typedef std::vector<TString> TVectorString;
54 #include<RcppCommon.h>
57 class TRFunctionExport;
58 class TRFunctionImport;
67 template<>
inline SEXP wrap(
const TString &s)
69 return wrap(std::string(s.Data()));
71 template<>
inline TString as(SEXP s)
73 return TString(::Rcpp::as<std::string>(s).c_str());
77 template<> SEXP wrap(
const TVectorT<Double_t> &v);
78 template<> TVectorT<Double_t> as(SEXP v);
80 template<> SEXP wrap(
const TVectorT<Float_t> &v);
81 template<> TVectorT<Float_t> as(SEXP v);
84 template<> SEXP wrap(
const TMatrixT<Double_t> &m);
85 template<> TMatrixT<Double_t> as(SEXP) ;
86 template<> SEXP wrap(
const TMatrixT<Float_t> &m);
87 template<> TMatrixT<Float_t> as(SEXP) ;
90 template<> SEXP wrap(
const ROOT::R::TRDataFrame &o);
91 template<> ROOT::R::TRDataFrame as(SEXP) ;
94 template<> SEXP wrap(
const ROOT::R::TRObject &o);
95 template<> ROOT::R::TRObject as(SEXP) ;
98 template<> SEXP wrap(
const ROOT::R::TRFunctionImport &o);
99 template<> ROOT::R::TRFunctionImport as(SEXP) ;
101 template<
class T,
size_t i> std::array<T, i> as(SEXP &obj)
103 std::vector<T> v = Rcpp::as<std::vector<T> >(obj);
105 std::copy(v.begin(), v.end(), a.begin());
110 template <
typename T,
size_t i>
111 class Exporter<std::array<T, i> > {
115 t = Rcpp::as<T, i>(x);
117 std::array<T, i>
get()
127 #if !defined(R_Version)
128 #define R_Version(v,p,s) ((v * 65536) + (p * 256) + (s))
131 #include<Rcpp/Named.h>
132 #undef HAVE_UINTPTR_T
143 extern VARIABLE_IS_NOT_USED SEXP ModuleSymRef;
144 template<
class T>
class class_:
public Rcpp::class_<T> {
146 class_(
const Char_t *name_,
const Char_t *doc = 0) : Rcpp::class_<T>(name_, doc) {}
151 void function(
const Char_t *name_, T fun,
const Char_t *docstring = 0)
154 Rcpp::function(name_, fun, docstring);
157 extern const Rcpp::internal::NamedPlaceHolder &Label;
163 #define ROOTR_MODULE RCPP_MODULE
164 #define ROOTR_EXPOSED_CLASS RCPP_EXPOSED_CLASS
167 #define ROOTR_EXPOSED_CLASS_INTERNAL(CLASS)\
172 RCPP_EXPOSED_CLASS_NODECL(ROOT::R::CLASS)
177 #define LOAD_ROOTR_MODULE(NAME) Rf_eval( Rf_lang2( ( ROOT::R::ModuleSymRef == NULL ? ROOT::R::ModuleSymRef = Rf_install("Module") : ROOT::R::ModuleSymRef ), _rcpp_module_boot_##NAME() ), R_GlobalEnv )