Code-generation wrapping C++ classes as R6 classes