MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / RCPP_API_CLASS

Function RCPP_API_CLASS

inst/include/Rcpp/InternalFunction.h:33–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace Rcpp{
32
33 RCPP_API_CLASS(InternalFunction_Impl) {
34 public:
35
36 RCPP_GENERATE_CTOR_ASSIGN(InternalFunction_Impl)
37
38 template <typename RESULT_TYPE, typename... Args>
39 InternalFunction_Impl(const std::function<RESULT_TYPE(Args...)> &fun) {
40 set(
41 XPtr<Rcpp::InternalFunctionWithStdFunction::CppFunctionBaseFromStdFunction<RESULT_TYPE, Args...> >(
42 new Rcpp::InternalFunctionWithStdFunction::CppFunctionBaseFromStdFunction<RESULT_TYPE, Args...>(fun),
43 false
44 )
45 );
46 }
47 template <typename RESULT_TYPE, typename... T>
48 InternalFunction_Impl(RESULT_TYPE (*fun)(T...)) {
49 set(XPtr<CppFunctionN<RESULT_TYPE, T...> >(new CppFunctionN<RESULT_TYPE, T...>(fun), true));
50 }
51
52 void update(SEXP){}
53 private:
54
55 inline void set( SEXP xp){
56 Environment RCPP = Environment::Rcpp_namespace() ;
57 Function intf = RCPP["internal_function"] ;
58 Storage::set__( intf( xp ) ) ;
59 }
60
61 };
62

Callers

nothing calls this directly

Calls 1

Rcpp_namespaceFunction · 0.85

Tested by

no test coverage detected