| 151 | #ifndef RCPP_NO_MODULES |
| 152 | |
| 153 | inline bool is_module_object_internal(SEXP obj, const char* clazz){ |
| 154 | Environment env(obj); |
| 155 | SEXP sexp = env.get(".cppclass"); |
| 156 | if (TYPEOF(sexp) != EXTPTRSXP) return false; |
| 157 | XPtr<class_Base> xp(sexp); |
| 158 | return xp->has_typeinfo_name(clazz); |
| 159 | } |
| 160 | template <typename T> bool is__module__object(SEXP x) { |
| 161 | if (!is__simple<S4>(x)) return false; |
| 162 | typedef typename Rcpp::traits::un_pointer<T>::type CLASS; |
no test coverage detected