[Rcpp-devel] Rcpp/C++ serialization of R objects?

Dirk Eddelbuettel edd at debian.org
Fri Nov 1 00:25:59 CET 2013


On 29 October 2013 at 10:38, Dirk Eddelbuettel wrote:
| Yes, I think I would like to have that functionality to some extent.
| 
| Now, _for basic C++ types_serialization is of course understood and
| implemented so you could just the appropriate, say, Boost library.
| 
| For _R_ types I think we will be hard-pressed to do better than R, and at
| pain to do it without R. The nestedness of types, attributes, lazy
| evaluation, ... all come in.

Simon U., in another off-list exchange, reminded me that Rinternals.h has

  void R_Serialize(SEXP s, R_outpstream_t stream);
  SEXP R_Unserialize(R_inpstream_t stream);

using

  R_Init*PStream, R_InitFile*PStream, R_InitConn*PStream

That might be worth a shot if you want to serialize at the C++ level.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list