Le 13/04/11 07:29, Christian Gunning a écrit :
On Tue, Apr 12, 2011 at 7:06 AM, Douglas Bates<ba...@stat.wisc.edu>  wrote:

The documented behavior is that an external pointer is replaced by a
null pointer when an object is serialized.

Thanks. Got it.

  I was planning to
experiment with an object that has enough information saved as R
objects to be able to regenerate the C++ object and an external
pointer to the module instance.  The methods that use the object will
check first to see if the pointer is null, in which case they will
regenerate the module instance, otherwise go directly to invoking
methods on the module instance.

No rush on my part -- as usual, I'm just trying to figure out how the
pieces fit together :)

Just to clarify --  does your plan include storing user-modified
fields and properties in objects?  E.g. below, modtest with the msg
set?

yes. Although the way I see it, this will require more work for the developper, who would have to provide a serialization/deserialization couple for his/her classes.

This is a nice goal for a future version.

best,
Christian

Rcpp.package.skeleton('testpkg1', module=T)
require(testpkg1)
modtest<- new(World)
show(modtest)
modtest$set('hello')



--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
http://romain-francois.com
|- http://bit.ly/fhqbRC : Rcpp workshop in Chicago on April 28th
|- http://bit.ly/dFyZGB : Hydraulique au Montpellier Comedie Club
`- http://bit.ly/eVXit9 : Eponyme : 40 minutes stand up


_______________________________________________
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

Reply via email to