[Rprotobuf-commits] r313 - in pkg: R src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Apr 28 15:58:36 CEST 2010
Author: romain
Date: 2010-04-28 15:58:36 +0200 (Wed, 28 Apr 2010)
New Revision: 313
Modified:
pkg/R/00classes.R
pkg/R/descriptor.R
pkg/src/extractors.cpp
pkg/src/rprotobuf.h
pkg/src/wrapper_Message.cpp
Log:
move some Message methods to wrapp_Message.cpp
Modified: pkg/R/00classes.R
===================================================================
--- pkg/R/00classes.R 2010-04-28 13:42:54 UTC (rev 312)
+++ pkg/R/00classes.R 2010-04-28 13:58:36 UTC (rev 313)
@@ -153,6 +153,8 @@
"has" = function( ... ) .Call( "Message__has_field" , x at pointer, ..., PACKAGE = "RProtoBuf"),
"clone" = function( ... ) .Call( "Message__clone" , x at pointer, ..., PACKAGE = "RProtoBuf"),
"isInitialized" = function() .Call( "Message__is_initialized", x at pointer, PACKAGE = "RProtoBuf"),
+ "descriptor" = function() .Call("Message__descriptor" , x at pointer, PACKAGE = "RProtoBuf" ),
+
"size" = function(field, ...) size(x, field, ... ),
"bytesize" = function() bytesize(x),
"swap" = function(...) swap(x,...),
@@ -169,7 +171,6 @@
"serialize" = function(...) serialize( x, ... ),
"clear" = function(...) clear( x, ... ),
- "descriptor" = function() descriptor(x),
"fileDescriptor" = function() fileDescriptor(x ),
# default
Modified: pkg/R/descriptor.R
===================================================================
--- pkg/R/descriptor.R 2010-04-28 13:42:54 UTC (rev 312)
+++ pkg/R/descriptor.R 2010-04-28 13:58:36 UTC (rev 313)
@@ -3,7 +3,7 @@
standardGeneric( "descriptor" )
} )
setMethod( "descriptor", "Message", function(object, ...){
- .Call( "get_message_descriptor", object at pointer, PACKAGE = "RProtoBuf" )
+ .Call( "Message__descriptor", object at pointer, PACKAGE = "RProtoBuf" )
} )
setGeneric( "fileDescriptor", function(object, ...){
Modified: pkg/src/extractors.cpp
===================================================================
--- pkg/src/extractors.cpp 2010-04-28 13:42:54 UTC (rev 312)
+++ pkg/src/extractors.cpp 2010-04-28 13:58:36 UTC (rev 313)
@@ -174,18 +174,6 @@
}
/**
- * Get the message descriptor of a Message
- *
- * @param xp (GPB::Message*) external pointer
- * @return the descriptor, as a Descriptor R S4 object
- */
-SEXP get_message_descriptor( SEXP xp){
- Rcpp::XPtr<GPB::Message> message(xp) ;
- return( new_RS4_Descriptor( message->GetDescriptor() ) ) ;
-}
-
-
-/**
* extract a method descriptor from a service descriptor using its
* name or position
*
Modified: pkg/src/rprotobuf.h
===================================================================
--- pkg/src/rprotobuf.h 2010-04-28 13:42:54 UTC (rev 312)
+++ pkg/src/rprotobuf.h 2010-04-28 13:58:36 UTC (rev 313)
@@ -270,7 +270,6 @@
/* in extractors.cpp */
RcppExport SEXP getMessageField( SEXP, SEXP );
RcppExport SEXP extractFieldAsSEXP( const Rcpp::XPtr<GPB::Message>& , const GPB::Descriptor*, const GPB::FieldDescriptor* ) ;
-RcppExport SEXP get_message_descriptor( SEXP );
RcppExport int MESSAGE_GET_REPEATED_INT( GPB::Message*, GPB::FieldDescriptor*, int) ;
RcppExport double MESSAGE_GET_REPEATED_DOUBLE( GPB::Message*, GPB::FieldDescriptor*, int) ;
RcppExport SEXP get_service_method( SEXP, SEXP) ;
Modified: pkg/src/wrapper_Message.cpp
===================================================================
--- pkg/src/wrapper_Message.cpp 2010-04-28 13:42:54 UTC (rev 312)
+++ pkg/src/wrapper_Message.cpp 2010-04-28 13:58:36 UTC (rev 313)
@@ -149,5 +149,17 @@
}
+/**
+ * Get the message descriptor of a Message
+ *
+ * @param xp (GPB::Message*) external pointer
+ * @return the descriptor, as a Descriptor R S4 object
+ */
+RCPP_FUNCTION_1(S4_Descriptor, Message__descriptor, Rcpp::XPtr<GPB::Message> message ){
+ return( message->GetDescriptor() ) ;
}
+
+
+}
+
More information about the Rprotobuf-commits
mailing list