forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TRInternalFunction.h
63 lines (44 loc) · 1.53 KB
/
TRInternalFunction.h
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
// @(#)root/r:$Id$
// Author: Omar Zapata 07/06/2014
/*************************************************************************
* Copyright (C) 2013-2014, Omar Andres Zapata Mesa *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_R_TRInternalFunction
#define ROOT_R_TRInternalFunction
#ifndef ROOT_R_RExports
#include<RExports.h>
#endif
#ifndef Rcpp_hpp
#include <Rcpp.h>
#endif
//________________________________________________________________________________________________________
/**
This is a class to support deprecated method to pass function to R's Environment,
based in Rcpp::InternalFunction
@ingroup R
*/
namespace Rcpp {
RCPP_API_CLASS(TRInternalFunction_Impl)
{
public:
RCPP_GENERATE_CTOR_ASSIGN(TRInternalFunction_Impl)
#include <TRInternalFunction__ctors.h>
void update(SEXP) {}
private:
inline void set(SEXP xp) {
Rcpp::Environment RCPP = Rcpp::Environment::Rcpp_namespace() ;
Rcpp::Function intf = RCPP["internal_function"] ;
Storage::set__(intf(xp)) ;
}
};
}
namespace ROOT {
namespace R {
typedef Rcpp::TRInternalFunction_Impl<Rcpp::PreserveStorage> TRInternalFunction ;
}
}
#endif