1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#ifndef _bindrcpp_bindrcpp_types_H_
#define _bindrcpp_bindrcpp_types_H_
#include <RcppCommon.h>
#include <Rcpp.h>
namespace bindrcpp {
struct PAYLOAD { void* p; explicit PAYLOAD(void* p_) : p(p_) {}; };
typedef SEXP (*GETTER_FUNC_STRING_TYPED)(const Rcpp::String& name, bindrcpp::PAYLOAD payload);
typedef SEXP (*GETTER_FUNC_SYMBOL_TYPED)(const Rcpp::Symbol& name, bindrcpp::PAYLOAD payload);
typedef SEXP (*GETTER_FUNC_STRING_WRAPPED)(const Rcpp::String& name, Rcpp::List payload);
typedef SEXP (*GETTER_FUNC_SYMBOL_WRAPPED)(const Rcpp::Symbol& name, Rcpp::List payload);
typedef GETTER_FUNC_SYMBOL_TYPED GETTER_FUNC_SYMBOL;
typedef GETTER_FUNC_STRING_TYPED GETTER_FUNC_STRING;
}
namespace Rcpp {
using namespace bindrcpp;
template <> inline SEXP wrap(const PAYLOAD& payload) {
return List::create(XPtr<PAYLOAD>(new PAYLOAD(payload)));
}
template <> inline SEXP wrap(const GETTER_FUNC_STRING_TYPED& fun) {
return List::create(XPtr<GETTER_FUNC_STRING_TYPED>(new GETTER_FUNC_STRING_TYPED(fun)));
}
template <> inline SEXP wrap(const GETTER_FUNC_SYMBOL_TYPED& fun) {
return List::create(XPtr<GETTER_FUNC_SYMBOL_TYPED>(new GETTER_FUNC_SYMBOL_TYPED(fun)));
}
template <> inline SEXP wrap(const GETTER_FUNC_STRING_WRAPPED& fun) {
return List::create(XPtr<GETTER_FUNC_STRING_WRAPPED>(new GETTER_FUNC_STRING_WRAPPED(fun)));
}
template <> inline SEXP wrap(const GETTER_FUNC_SYMBOL_WRAPPED& fun) {
return List::create(XPtr<GETTER_FUNC_SYMBOL_WRAPPED>(new GETTER_FUNC_SYMBOL_WRAPPED(fun)));
}
template <> inline PAYLOAD as(SEXP x) {
List xl = x;
XPtr<PAYLOAD> xpayload(static_cast<SEXP>(xl[0]));
return *xpayload.get();
}
template <> inline GETTER_FUNC_STRING_TYPED as(SEXP x) {
List xl = x;
XPtr<GETTER_FUNC_STRING_TYPED> xfun(static_cast<SEXP>(xl[0]));
return *xfun.get();
}
template <> inline GETTER_FUNC_SYMBOL_TYPED as(SEXP x) {
List xl = x;
XPtr<GETTER_FUNC_SYMBOL_TYPED> xfun(static_cast<SEXP>(xl[0]));
return *xfun.get();
}
template <> inline GETTER_FUNC_STRING_WRAPPED as(SEXP x) {
List xl = x;
XPtr<GETTER_FUNC_STRING_WRAPPED> xfun(static_cast<SEXP>(xl[0]));
return *xfun.get();
}
template <> inline GETTER_FUNC_SYMBOL_WRAPPED as(SEXP x) {
List xl = x;
XPtr<GETTER_FUNC_SYMBOL_WRAPPED> xfun(static_cast<SEXP>(xl[0]));
return *xfun.get();
}
}
#endif
|