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

Class const_FieldProxy

inst/include/Rcpp/proxy/FieldProxy.h:56–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54 } ;
55
56 class const_FieldProxy : public GenericProxy<const_FieldProxy> {
57 public:
58 const_FieldProxy( const CLASS& v, const std::string& name) :
59 parent(v), field_name(name) {}
60
61 template <typename T> operator T() const;
62 inline operator SEXP() const {
63 return get() ;
64 }
65
66 private:
67 const CLASS& parent;
68 const std::string& field_name ;
69
70 SEXP get() const {
71 Shield<SEXP> str(Rf_mkString(field_name.c_str()));
72 Shield<SEXP> call(Rf_lang3(R_DollarSymbol, parent, str));
73 return Rcpp_fast_eval( call, R_GlobalEnv ) ;
74 }
75 } ;
76
77 FieldProxy field(const std::string& name){
78 return FieldProxy( static_cast<CLASS&>(*this), name ) ;

Callers 1

fieldMethod · 0.85

Calls 1

getFunction · 0.85

Tested by

no test coverage detected