[Rprotobuf-yada] make prototypes of message , field extraction

Romain François francoisromain at free.fr
Fri Oct 30 11:17:21 CET 2009


Hello,

We might now use the new method to create prototypes of messages as 
described by a given descriptor :

Person <- P( "tutorial.Person", file = "/tmp/person.proto" )
p <- new( Person )


I have added some code to prepare field extraction (but no code yet). It 
is in extractors.cpp

SEXP extractFieldAsSEXP( const Message * message, const Descriptor* 
desc, const FieldDescriptor * fieldDesc ){
	
	/* depending on the type, we need to create some regular SEXP (INTSXP)
        or a message */
	
     FieldDescriptor::Type type =    fieldDesc->type() ;

	return R_NilValue;
	
}


The idea basically is to have a switch on the type and make the 
appropriate SEXP (INTSXP, STRSXP) for primitives or new instances of 
protobufMessage for messages.

I'll have a look tonight if noone beats me to it (I need to get out now)

Romain

Ps: I have removed the #define foo Rf_foo

-- 
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