MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / AttributeProxy

Class AttributeProxy

inst/include/Rcpp/proxy/AttributeProxy.h:27–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25public:
26
27 class AttributeProxy : public GenericProxy<AttributeProxy> {
28 public:
29 AttributeProxy( CLASS& v, const std::string& name)
30 : parent(v), attr_name(Rf_install(name.c_str()))
31 {}
32
33 AttributeProxy& operator=(const AttributeProxy& rhs){
34 if( this != &rhs ) set( rhs.get() ) ;
35 return *this ;
36 }
37
38 template <typename T> AttributeProxy& operator=(const T& rhs);
39
40 template <typename T> operator T() const;
41
42 inline operator SEXP() const;
43
44 private:
45 CLASS& parent;
46 SEXP attr_name ;
47
48 SEXP get() const {
49 return Rf_getAttrib( parent, attr_name ) ;
50 }
51 void set(SEXP x ){
52 Rf_setAttrib( parent, attr_name, Shield<SEXP>(x) ) ;
53 }
54 } ;
55
56 class const_AttributeProxy : public GenericProxy<const_AttributeProxy> {
57 public:

Callers 1

attrMethod · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected