34template <
typename T,
void Finalizer(T*) >
53 template <
class>
class StoragePolicy = PreserveStorage,
55 #ifdef RCPP_USE_FINALIZE_ON_EXIT
62 public StoragePolicy< XPtr<T,StoragePolicy, Finalizer, finalizeOnExit> >,
63 public SlotProxyPolicy< XPtr<T,StoragePolicy, Finalizer, finalizeOnExit> >,
65 public TagProxyPolicy< XPtr<T,StoragePolicy, Finalizer, finalizeOnExit> >,
67 public RObjectMethods< XPtr<T,StoragePolicy, Finalizer, finalizeOnExit> >
106 RCPP_DEBUG_2(
"XPtr(T* p = <%p>, bool set_delete_finalizer = %s, SEXP tag = R_NilValue, SEXP prot = R_NilValue)", p, (
set_delete_finalizer ?
"true" :
"false"))
114 Storage::copy__(
other);
118 Storage::copy__(
other);
149 throw ::Rcpp::exception(
"external pointer is not valid");
195 inline operator T*() {
204 const char*
fmt =
"Expecting an external pointer: [type=%s].";
void setDeleteFinalizer()
static void unspecified_bool_true()
XPtr(T *p, bool set_delete_finalizer=true, SEXP tag=R_NilValue, SEXP prot=R_NilValue)
XPtr(SEXP x, SEXP tag, SEXP prot)
XPtr & operator=(const XPtr &other)
StoragePolicy< XPtr > Storage
void(* unspecified_bool_type)()
#define RCPP_DEBUG_2(fmt, M1, M2)
#define RCPP_DEBUG_3(fmt, M1, M2, M3)
#define DEMANGLE(__TYPE__)
void standard_delete_finalizer(T *obj)
void finalizer_wrapper(SEXP p)