That's a lot of somewhat elementary questions.
Maybe you should not start with a module and class? How about
- You could rewrite your class containing a
std::vector<double> a
. - You write a simple 'init()' function that assigns the class to file-local variable (usually a pointer).
- You write little setter and getter functions, see Rcpp Attributes.
Once a few things are more clear more doing basics, revisit the Rcpp Modules vignette.