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

Method invoke_void

inst/include/Rcpp/module/class.h:201–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199 }
200
201 SEXP invoke_void( SEXP method_xp, SEXP object, SEXP *args, int nargs ){
202 BEGIN_RCPP
203
204 vec_signed_method* mets = reinterpret_cast< vec_signed_method* >( R_ExternalPtrAddr( method_xp ) ) ;
205 typename vec_signed_method::iterator it = mets->begin() ;
206 size_t n = mets->size() ;
207 method_class* m = 0 ;
208 bool ok = false ;
209 for( size_t i=0; i<n; i++, ++it ){
210 if( ( (*it)->valid )( args, nargs) ){
211 m = (*it)->method ;
212 ok = true ;
213 break ;
214 }
215 }
216 if( !ok ){
217 throw std::range_error( "could not find valid method" ) ;
218 }
219 m->operator()( XP(object), args );
220 END_RCPP
221 }
222
223 SEXP invoke_notvoid( SEXP method_xp, SEXP object, SEXP *args, int nargs ){
224 BEGIN_RCPP

Callers 1

CppMethod__invoke_voidFunction · 0.45

Calls 3

beginMethod · 0.45
sizeMethod · 0.45
operator()Method · 0.45

Tested by

no test coverage detected