Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TRInternalFunction.h
Go to the documentation of this file.
1// @(#)root/r:$Id$
2// Author: Omar Zapata Omar.Zapata@cern.ch 07/06/2014
3
4
5/*************************************************************************
6 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12#ifndef ROOT_R_TRInternalFunction
13#define ROOT_R_TRInternalFunction
14
15#include <RExports.h>
16
17//________________________________________________________________________________________________________
18/**
19 This is a class to support deprecated method to pass function to R's Environment,
20 based in Rcpp::InternalFunction
21
22
23 @ingroup R
24*/
25
26
27namespace Rcpp {
29 {
30public:
31
32 RCPP_GENERATE_CTOR_ASSIGN(TRInternalFunction_Impl)
33
34#if RCPP_VERSION >= Rcpp_Version(1,0,13)
35 template <typename OUT, typename... T>
36 TRInternalFunction_Impl(OUT(*fun)(T...))
37 {
38 set(Rcpp::XPtr< Rcpp::CppFunctionN<OUT, T...> >(new Rcpp::CppFunctionN<OUT, T...>(fun), false));
39 }
40#else
42#endif
43 void update(SEXP) {}
44private:
45
46 inline void set(SEXP xp) {
47 Rcpp::Environment RCPP = Rcpp::Environment::Rcpp_namespace() ;
48 Rcpp::Function intf = RCPP["internal_function"] ;
49 Storage::set__(intf(xp)) ;
50 }
51
52 };
53
54
55}
56
57
58namespace ROOT {
59 namespace R {
60
61 typedef Rcpp::TRInternalFunction_Impl<Rcpp::PreserveStorage> TRInternalFunction ;
62 }
63}
64
65#endif
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
TRInternalFunction_Impl(OUT(*fun)(void))
Rcpp::TRInternalFunction_Impl< Rcpp::PreserveStorage > TRInternalFunction
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
This is a class to support deprecated method to pass function to R's Environment, based in Rcpp::Inte...
Definition RExports.h:79
RCPP_API_CLASS(TRInternalFunction_Impl)