[Rprotobuf-yada] skeletic implementation of proto messages using external pointers
Romain François
francoisromain at free.fr
Thu Oct 29 11:01:14 CET 2009
Hello,
(Don't get too excited about the title)
I've commited some R and C (maybe need to C++ it at some point) that
prepare the space for mirroring proto messages as R S4 objects of class
"protobufMessage".
The design is much inspired from the new features of rJava. Here are
some insights. The "P" function takes either a message type (i.e.
"tutorial.Person") or a proto file, goes C internal, grabs a pointer to
some descriptor object (not sure what this will be right now), and
creates an R object of S4 class "protobufDescriptor".
Then, we can throw the created descriptor into "new", made generic by
the package. So you'd create a Person message like this :
message <- new( P("tutorial.Person" ) )
I've also added hooks so that
message$name
goes internal to grab the "name" field from the message.
Please note that at the moment, none of this is real, I now need to play
with the headers of libproto to actually grab useful information. Those
are essentially placeholders at the moment. I told you not to get too
excited...
Romain
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/BcPw : celebrating R commit #50000
|- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc
`- http://tr.im/yw8E : New R package : sos
More information about the Rprotobuf-yada
mailing list