[Rcpp-devel] Serialize with RProtoBuf and deserialize with C++?

Dirk Eddelbuettel edd at debian.org
Fri Sep 21 13:36:19 CEST 2012


On 21 September 2012 at 17:05, SHEN Fei wrote:
| Dear all,
| 
| I have been doing some serialization work with RProtoBuf and that's very
| helpful and convenient.
| 
| My now question is, with the same .proto file, can i serialize some objects in
| R into a file, and deserialize them back into Rcpp objects in C++?

Well: .proto files can be used with the appropriate converters to create accessors
in many languages; Google support C++, Java and Python.  We help with RProtoBuf.

So yes, because ProtocolBuffers are cross-languages you can do something from
R and pick it up C++ ... but you need to learn how to use the Protocol
Buffers library from C++.  Rcpp is no help here.
 
| I know with the help of RInside, i can creat a R session in C++ and do the
| deserialization job, then convert them into C++.

Yes, but that has nothing to do with ProtocolBuffers. That is just R.

| But could i avoid using RInside? I mean using C++ to deserialize the file that
| has been serialize by RProtoBuf directly.

Yes, see above.

Dirk
 
| Best regards and thank you all~
| 
| --
| SHEN Fei
| 
| ----------------------------------------------------------------------
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com  


More information about the Rcpp-devel mailing list