Rcpp Version 1.0.14
|
#include <XPtr.h>
Public Types | |
typedef StoragePolicy< XPtr > | Storage |
typedef void(* | unspecified_bool_type) () |
Static Public Member Functions | |
static void | unspecified_bool_true () |
Private Member Functions | |
void | checked_set (SEXP x) |
typedef void(* Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::unspecified_bool_type) () |
Boolean operator wrapper for get() using the "safe bool idiom", see: http://www.boost.org/doc/libs/1_57_0/boost/smart_ptr/detail/operator_bool.hpp
|
inlineexplicit |
constructs a XPtr wrapping the external pointer (EXTPTRSXP SEXP)
xp | external pointer to wrap |
Definition at line 78 of file XPtr.h.
References Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::checked_set().
|
inlineexplicit |
constructs a XPtr wrapping the external pointer (EXTPTRSXP SEXP)
xp | external pointer to wrap |
tag | tag to assign to external pointer |
prot | protected data to assign to external pointer |
Definition at line 87 of file XPtr.h.
References Rcpp::as(), Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::checked_set(), Rcpp::ProtectedProxyPolicy< XPtrClass >::prot(), and Rcpp::TagProxyPolicy< XPtrClass >::tag().
|
inlineexplicit |
creates a new external pointer wrapping the dumb pointer p.
p | dumb pointer to some object |
set_delete_finalizer | if set to true, a finalizer will be registered for the external pointer. The finalizer is called when the xp is garbage collected. The finalizer is merely a call to the delete operator or the pointer so you need to make sure the pointer can be "delete" d this way (has to be a C++ object) |
Definition at line 104 of file XPtr.h.
References Rcpp::as(), Rcpp::ProtectedProxyPolicy< XPtrClass >::prot(), RCPP_DEBUG_2, Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::setDeleteFinalizer(), and Rcpp::TagProxyPolicy< XPtrClass >::tag().
|
inline |
Definition at line 113 of file XPtr.h.
References Rcpp::as().
|
inline |
Access underlying pointer throwing an exception if the ptr is NULL
Definition at line 146 of file XPtr.h.
References Rcpp::as(), and Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::get().
Referenced by Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::operator T*(), Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::operator*(), and Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::operator->().
|
inlineprivate |
Definition at line 202 of file XPtr.h.
References Rcpp::as().
Referenced by Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::XPtr(), and Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::XPtr().
|
inline |
Typesafe accessor for underlying pointer (use checked_get if you want an exception thrown if the pointer is NULL)
Definition at line 126 of file XPtr.h.
References Rcpp::as().
Referenced by Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::checked_get(), Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::operator unspecified_bool_type(), Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::operator!(), and Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::release().
|
inline |
Definition at line 195 of file XPtr.h.
References Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::checked_get().
|
inline |
Definition at line 136 of file XPtr.h.
References Rcpp::as(), Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::get(), and Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::unspecified_bool_true().
|
inline |
Definition at line 139 of file XPtr.h.
References Rcpp::as(), and Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::get().
|
inline |
Returns a reference to the object wrapped. This allows this object to look and feel like a dumb pointer to T
Definition at line 157 of file XPtr.h.
References Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::checked_get().
|
inline |
Returns the dumb pointer. This allows to call the -> operator on this as if it was the dumb pointer
Definition at line 165 of file XPtr.h.
References Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::checked_get().
|
inline |
Definition at line 117 of file XPtr.h.
References Rcpp::as().
|
inline |
Release the external pointer (if any) immediately. This will cause the pointer to be deleted and it's storage to be set to NULL. After this call the get() method returns NULL and the checked_get() method throws an exception.
See the discussion here for the basic logic behind release: https://stat.ethz.ch/pipermail/r-help/2007-August/137871.html
Definition at line 183 of file XPtr.h.
References Rcpp::as(), and Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::get().
|
inline |
Definition at line 169 of file XPtr.h.
References Rcpp::as().
Referenced by Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::XPtr().
|
inlinestatic |
Definition at line 135 of file XPtr.h.
Referenced by Rcpp::XPtr< T, StoragePolicy, Finalizer, finalizeOnExit >::operator unspecified_bool_type().