Displaying 1 result from an estimated 1 matches for "definemethod".
Did you mean:
define_method
2005 Apr 18
3
A 'true' R-wrapper for C++ classes
...1);
return res;
}
extern "C" SEXP R_foo_fun(SEXP obj)
{
foo *ptr= (foo *) R_ExternalPtrAddr(obj);
ptr->fun();
return R_NilValue;
}
---------------------
R-wrapper:
defineClass(className = "foo");
vtkObject$defineFields(ptr = "externalptr");
vtkObject$defineMethod(
"initialize",
function(){
ptr <- .Call("R_foo_init")
}
);
vtkObject$defineMethod(
"fun",
function()
{
.Call("R_foo_fun", ptr);
}
);
--------------------
(3) The above model lacks something like an 'environment' for t...