-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathis.h
More file actions
46 lines (41 loc) · 1.03 KB
/
is.h
File metadata and controls
46 lines (41 loc) · 1.03 KB
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
#ifndef Rcpp_api_meat_is_h
#define Rcpp_api_meat_is_h
namespace Rcpp{
namespace internal{
template <>
struct Is<RObject> {
inline bool test(SEXP /* x */){ return true; }
} ;
template <>
struct Is<DataFrame> {
inline bool test(SEXP x ){
return Rf_inherits( x, "data.frame" ) ;
}
} ;
template <>
struct Is<S4> {
inline bool test(SEXP x ){
return ::Rf_isS4(x);
}
} ;
template <>
struct Is<Reference> {
inline bool test(SEXP x ){
return ::Rf_inherits(x, "envRefClass" ) ;
}
} ;
template <>
struct Is<Formula> {
inline bool test(SEXP x ){
return Rf_inherits( x, "formula" ) ;
}
} ;
template <>
struct Is<Function> {
inline bool test(SEXP x ){
return TYPEOF(x) == CLOSXP || TYPEOF(x) == SPECIALSXP || TYPEOF(x) == BUILTINSXP ;
}
} ;
} // namespace internal
} // namespace Rcpp
#endif