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
4namespace Rcpp{
5
6 template <typename CLASS>
8 public:
9
11
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
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:
50 } ;
51
52}
53
54#endif
CLASS & copy__(const CLASS &other)
bool inherits(const char *clazz) const
Rcpp API.
Definition algo.h:28
T as(SEXP x)
Definition as.h:151