Rcpp Version 1.0.14
Loading...
Searching...
No Matches
NoProtectStorage.h
Go to the documentation of this file.
1
#ifndef Rcpp_NoProtectStorage_h
2
#define Rcpp_NoProtectStorage_h
3
4
namespace
Rcpp
{
5
6
template
<
typename
CLASS>
7
class
NoProtectStorage
{
8
public
:
9
10
NoProtectStorage
() :
data
(
R_NilValue
){}
11
12
~NoProtectStorage
(){
13
data
=
R_NilValue
;
14
}
15
16
inline
void
set__
(
SEXP
x){
17
data
= x ;
18
19
// calls the update method of CLASS
20
// this is where to react to changes in the underlying SEXP
21
static_cast<
CLASS
&
>
(*this).update(
data
) ;
22
}
23
24
inline
SEXP
get__
()
const
{
25
return
data
;
26
}
27
28
inline
SEXP
invalidate__
(){
29
data
=
R_NilValue
;
30
return
data
;
31
}
32
33
inline
CLASS
&
copy__
(
const
CLASS
&
other
){
34
if
(
this
!= &
other
){
35
set__
(
other
.get__());
36
}
37
return
static_cast<
CLASS
&
>
(*this) ;
38
}
39
40
inline
bool
inherits
(
const
char
*
clazz
)
const
{
41
return ::Rf_inherits(
data
,
clazz
) ;
42
}
43
44
inline
operator
SEXP
()
const
{
45
return
data
;
46
}
47
48
private
:
49
SEXP
data
;
50
} ;
51
52
}
53
54
#endif
Rcpp::NoProtectStorage
Definition
NoProtectStorage.h:7
Rcpp::NoProtectStorage::get__
SEXP get__() const
Definition
NoProtectStorage.h:24
Rcpp::NoProtectStorage::~NoProtectStorage
~NoProtectStorage()
Definition
NoProtectStorage.h:12
Rcpp::NoProtectStorage::copy__
CLASS & copy__(const CLASS &other)
Definition
NoProtectStorage.h:33
Rcpp::NoProtectStorage::invalidate__
SEXP invalidate__()
Definition
NoProtectStorage.h:28
Rcpp::NoProtectStorage::set__
void set__(SEXP x)
Definition
NoProtectStorage.h:16
Rcpp::NoProtectStorage::data
SEXP data
Definition
NoProtectStorage.h:49
Rcpp::NoProtectStorage::NoProtectStorage
NoProtectStorage()
Definition
NoProtectStorage.h:10
Rcpp::NoProtectStorage::inherits
bool inherits(const char *clazz) const
Definition
NoProtectStorage.h:40
Rcpp
Rcpp API.
Definition
algo.h:28
Rcpp::as
T as(SEXP x)
Definition
as.h:151
inst
include
Rcpp
storage
NoProtectStorage.h
Generated on Sun Jan 12 2025 11:21:43 for Rcpp Version 1.0.14 by
1.9.8