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*/
24
25
26namespace Rcpp {
28 {
29public:
30
31 RCPP_GENERATE_CTOR_ASSIGN(TRInternalFunction_Impl)
32
33#if RCPP_VERSION >= Rcpp_Version(1,0,13)
34 template <typename OUT, typename... T>
35 TRInternalFunction_Impl(OUT(*fun)(T...))
36 {
37 set(Rcpp::XPtr< Rcpp::CppFunctionN<OUT, T...> >(new Rcpp::CppFunctionN<OUT, T...>(fun), false));
38 }
39#else
41#endif
42 void update(SEXP) {}
43private:
44
45 inline void set(SEXP xp) {
46 Rcpp::Environment RCPP = Rcpp::Environment::Rcpp_namespace() ;
47 Rcpp::Function intf = RCPP["internal_function"] ;
48 Storage::set__(intf(xp)) ;
49 }
50
51 };
52
53
54}
55
56
57namespace ROOT {
58 namespace R {
59
60 typedef Rcpp::TRInternalFunction_Impl<Rcpp::PreserveStorage> TRInternalFunction ;
61 }
62}
63
64#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))
STL class.
namespace associated R package for ROOT.
Definition RExports.h:72
Rcpp::TRInternalFunction_Impl< Rcpp::PreserveStorage > TRInternalFunction
This is a class to support deprecated method to pass function to R's Environment, based in Rcpp::Inte...
Definition RExports.h:80
RCPP_API_CLASS(TRInternalFunction_Impl)