r - Exposing headers with C++ classes to other packages -
i writing custom functionality r package. classes inherit classes in package, i.e.
package orig
has src/myclass.h
class
class myclass { public: virtual int blub(int bla) { return(bla + 1); } }
i want package derivedpackage
use
#include "orig/myclass.h" class derivclass : public myclass { ... }
i aware need in description
:
linkingto: orig
and somewhere guess [[rcpp:depends(orig)]]
in src/derivclass.h
or so.
and aware original package orig
need headers in inst/include
.
questions:
- what else need add
orig
? - is there automated way via rcpp attributes headers
inst/include
? know[[rcpp::interfaces(r, cpp)]]
exists doesn't seem apply exporting classes, functions; putting[[rcpp::export]]
in front of class doesn't seem doing anything.
for simplicity let's assume maintain both packages don't want have derivedpackage
functionality in orig
because more specific , useful special case.
Comments
Post a Comment