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

Class const_SlotProxy

inst/include/Rcpp/proxy/SlotProxy.h:59–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 } ;
58
59 class const_SlotProxy : public GenericProxy<const_SlotProxy> {
60 public:
61 const_SlotProxy( const CLASS& v, const std::string& name) : parent(v), slot_name(Rf_install(name.c_str())) {
62 if( !R_has_slot( v, slot_name) ){
63 throw no_such_slot(name);
64 }
65 }
66
67 template <typename T> operator T() const {
68 return as<T>( get() );
69 }
70 inline operator SEXP() const {
71 return get() ;
72 }
73
74 private:
75 const CLASS& parent;
76 SEXP slot_name ;
77
78 SEXP get() const {
79 return R_do_slot( parent, slot_name ) ;
80 }
81 } ;
82
83 SlotProxy slot(const std::string& name){
84 SEXP x = static_cast<CLASS&>(*this) ;

Callers 1

slotMethod · 0.85

Calls 1

getFunction · 0.85

Tested by

no test coverage detected