[Rprotobuf-commits] r320 - in pkg: R src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat May 8 12:32:15 CEST 2010


Author: romain
Date: 2010-05-08 12:32:14 +0200 (Sat, 08 May 2010)
New Revision: 320

Removed:
   pkg/src/containing_type.cpp
Modified:
   pkg/R/containing_type.R
   pkg/src/rprotobuf.h
   pkg/src/wrapper_Descriptor.cpp
   pkg/src/wrapper_EnumDescriptor.cpp
   pkg/src/wrapper_FieldDescriptor.cpp
Log:
move containingtype.cpp to wrapper_* files

Modified: pkg/R/containing_type.R
===================================================================
--- pkg/R/containing_type.R	2010-05-08 10:22:29 UTC (rev 319)
+++ pkg/R/containing_type.R	2010-05-08 10:32:14 UTC (rev 320)
@@ -4,12 +4,12 @@
 } )
 
 setMethod( "containing_type", "Descriptor", function(object){
-	.Call( "containing_type__Descriptor", object at pointer, PACKAGE = "RProtoBuf" )
+	.Call( "Descriptor__containing_type", object at pointer, PACKAGE = "RProtoBuf" )
 } )
 setMethod( "containing_type", "EnumDescriptor", function(object){
-	.Call( "containing_type__EnumDescriptor", object at pointer, PACKAGE = "RProtoBuf" )
+	.Call( "EnumDescriptor__containing_type", object at pointer, PACKAGE = "RProtoBuf" )
 } )
 setMethod( "containing_type", "FieldDescriptor", function(object){
-	.Call( "containing_type__FieldDescriptor", object at pointer, PACKAGE = "RProtoBuf" )
+	.Call( "FieldDescriptor__containing_type", object at pointer, PACKAGE = "RProtoBuf" )
 } )
 

Deleted: pkg/src/containing_type.cpp
===================================================================
--- pkg/src/containing_type.cpp	2010-05-08 10:22:29 UTC (rev 319)
+++ pkg/src/containing_type.cpp	2010-05-08 10:32:14 UTC (rev 320)
@@ -1,20 +0,0 @@
-#include "rprotobuf.h"
-
-namespace rprotobuf {
-
-#define CONTAINING_TYPE(CLAZZ) CLAZZ* d = (CLAZZ*)EXTPTR_PTR(xp) ; \
-	const GPB::Descriptor* parent = d->containing_type() ; \
-	if( !parent ) return R_NilValue ; \
-	return new_RS4_Descriptor( parent ) ;
-	
-	SEXP containing_type__Descriptor( SEXP xp ){
-		CONTAINING_TYPE(GPB::Descriptor); 
-	}
-	SEXP containing_type__EnumDescriptor( SEXP xp ){
-		CONTAINING_TYPE(GPB::EnumDescriptor); 
-	}
-	SEXP containing_type__FieldDescriptor( SEXP xp ){
-		CONTAINING_TYPE(GPB::FieldDescriptor); 
-	}
-
-} // namespace rprotobuf

Modified: pkg/src/rprotobuf.h
===================================================================
--- pkg/src/rprotobuf.h	2010-05-08 10:22:29 UTC (rev 319)
+++ pkg/src/rprotobuf.h	2010-05-08 10:32:14 UTC (rev 320)
@@ -308,9 +308,6 @@
 RcppExport SEXP readMessageFromConnection( SEXP, SEXP ) ;
 RcppExport SEXP readMessageFromRawVector( SEXP, SEXP );
 
-/* in size.cpp */
-RcppExport SEXP set_field_size(SEXP, SEXP, SEXP);
-
 /* in swap.cpp */
 RcppExport SEXP message_swap_fields(SEXP, SEXP, SEXP, SEXP) ;
 
@@ -341,13 +338,6 @@
 RcppExport SEXP name_method_descriptor( SEXP, SEXP ) ;
 RcppExport SEXP name_file_descriptor( SEXP ) ;
 
-/* in containing_type.cpp */
-RcppExport SEXP containing_type__Descriptor( SEXP ); 
-RcppExport SEXP containing_type__EnumDescriptor( SEXP ); 
-RcppExport SEXP containing_type__FieldDescriptor( SEXP ); 
-RcppExport SEXP containing_type__ServiceDescriptor( SEXP ); 
-RcppExport SEXP containing_type__MethodDescriptor( SEXP ); 
-
 /* in field_count.cpp */
 RcppExport SEXP field_count__Descriptor( SEXP );
 RcppExport SEXP nested_type_count__Descriptor( SEXP );

Modified: pkg/src/wrapper_Descriptor.cpp
===================================================================
--- pkg/src/wrapper_Descriptor.cpp	2010-05-08 10:22:29 UTC (rev 319)
+++ pkg/src/wrapper_Descriptor.cpp	2010-05-08 10:32:14 UTC (rev 320)
@@ -5,7 +5,8 @@
 #undef METHOD
 #define METHOD(__NAME__) RCPP_PP_CAT(Descriptor__,__NAME__)	
 
-RCPP_XP_METHOD_0( METHOD(as_character), GPB::Descriptor          , DebugString) ;
+RCPP_XP_METHOD_0( METHOD(as_character), GPB::Descriptor          , DebugString)
+RCPP_XP_METHOD_CAST_0( METHOD(containing_type), GPB::Descriptor, containing_type, RS4_Descriptor )
 
 /**
  * @param xp external pointer to a Descriptor
@@ -42,7 +43,6 @@
 	return message  ;
 }
 
-
 #undef METHOD
 
 } // namespace rprotobuf

Modified: pkg/src/wrapper_EnumDescriptor.cpp
===================================================================
--- pkg/src/wrapper_EnumDescriptor.cpp	2010-05-08 10:22:29 UTC (rev 319)
+++ pkg/src/wrapper_EnumDescriptor.cpp	2010-05-08 10:32:14 UTC (rev 320)
@@ -9,6 +9,8 @@
 	RCPP_XP_METHOD_0(METHOD(length)      ,GPB::EnumDescriptor,value_count)
 	RCPP_XP_METHOD_0(METHOD(value_count) ,GPB::EnumDescriptor,value_count)
 	
+	RCPP_XP_METHOD_CAST_0(METHOD(containing_type), GPB::EnumDescriptor, containing_type, RS4_Descriptor )
+
 	RCPP_XP_METHOD_CAST_1(METHOD(getValueByIndex) , GPB::EnumDescriptor , value            , S4_EnumValueDescriptor ) 
 	RCPP_XP_METHOD_CAST_1(METHOD(getValueByNumber), GPB::EnumDescriptor , FindValueByNumber, S4_EnumValueDescriptor )
 	RCPP_XP_METHOD_CAST_1(METHOD(getValueByName)  , GPB::EnumDescriptor , FindValueByName  , S4_EnumValueDescriptor )

Modified: pkg/src/wrapper_FieldDescriptor.cpp
===================================================================
--- pkg/src/wrapper_FieldDescriptor.cpp	2010-05-08 10:22:29 UTC (rev 319)
+++ pkg/src/wrapper_FieldDescriptor.cpp	2010-05-08 10:32:14 UTC (rev 320)
@@ -16,8 +16,9 @@
 	RCPP_XP_METHOD_0( METHOD(is_optional)       , GPB::FieldDescriptor, is_optional )  
 	RCPP_XP_METHOD_0( METHOD(is_required)       , GPB::FieldDescriptor, is_required )  
 	RCPP_XP_METHOD_0( METHOD(has_default_value) , GPB::FieldDescriptor, has_default_value )  
+
+	RCPP_XP_METHOD_CAST_0( METHOD(containing_type), GPB::FieldDescriptor, containing_type, RS4_Descriptor )
 	
-
 #define RPB_HANDLE_CASE(__CPP__,__LC__)                           \
 case CPPTYPE_##__CPP__:                                           \
 	{                                                             \



More information about the Rprotobuf-commits mailing list