* Returns a list that contains: * - an external pointer that encapsulates a CppFunction* * - voidness of the function (logical) * - docstring (character) * - signature (character) * - formal arguments of the function * * The R code in Module.R uses this information to create a C++Function * object */
| 152 | * object |
| 153 | */ |
| 154 | inline SEXP get_function( const std::string& name_ ){ |
| 155 | MAP::iterator it = functions.begin() ; |
| 156 | size_t n = functions.size() ; |
| 157 | CppFunction* fun = 0 ; |
| 158 | for( size_t i=0; i<n; i++, ++it){ |
| 159 | if( name_.compare( it->first ) == 0){ |
| 160 | fun = it->second ; |
| 161 | break ; |
| 162 | } |
| 163 | } |
| 164 | std::string sign ; |
| 165 | fun->signature( sign, name_.data() ) ; |
| 166 | return List::create( |
| 167 | XPtr<CppFunction>( fun, false ), |
| 168 | fun->is_void(), |
| 169 | fun->docstring, |
| 170 | sign, |
| 171 | fun->get_formals(), |
| 172 | fun->nargs() |
| 173 | ) ; |
| 174 | } |
| 175 | |
| 176 | /** |
| 177 | * get the underlying C++ function pointer as a DL_FUNC |
no test coverage detected