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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat May 8 12:14:21 CEST 2010


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

Removed:
   pkg/src/ascharacter.cpp
Modified:
   pkg/R/00classes.R
   pkg/R/debug_string.R
   pkg/src/wrapper_Descriptor.cpp
   pkg/src/wrapper_EnumDescriptor.cpp
   pkg/src/wrapper_EnumValueDescriptor.cpp
   pkg/src/wrapper_FieldDescriptor.cpp
   pkg/src/wrapper_FileDescriptor.cpp
   pkg/src/wrapper_MethodDescriptor.cpp
   pkg/src/wrapper_ServiceDescriptor.cpp
Log:
moving ascharacter.cpp to wrapper_* files

Modified: pkg/R/00classes.R
===================================================================
--- pkg/R/00classes.R	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/R/00classes.R	2010-05-08 10:14:19 UTC (rev 316)
@@ -512,10 +512,10 @@
 	.Call( "MethodDescriptor__as_Message", from at pointer, PACKAGE = "RProtoBuf" )
 })
 setAs("FileDescriptor", "Message", function(from){
-	.Call( "asMessage_FileDescriptor", from at pointer, PACKAGE = "RProtoBuf" )
+	.Call( "FileDescriptor__as_Message", from at pointer, PACKAGE = "RProtoBuf" )
 })
 setAs("EnumValueDescriptor", "Message", function(from){
-	.Call( "asMessage_EnumValueDescriptor", from at pointer, PACKAGE = "RProtoBuf" )
+	.Call( "EnumValueDescriptor__as_Message", from at pointer, PACKAGE = "RProtoBuf" )
 })
 asMessage <- function( x, ... ){
 	as( x, "Message", ... )

Modified: pkg/R/debug_string.R
===================================================================
--- pkg/R/debug_string.R	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/R/debug_string.R	2010-05-08 10:14:19 UTC (rev 316)
@@ -1,27 +1,27 @@
 
 ._toString_Message <- function(x, ...){
-	.Call( "as_character_message", x at pointer, PACKAGE = "RProtoBuf" ) 
+	.Call( "Message__as_character", x at pointer, PACKAGE = "RProtoBuf" ) 
 }
 ._toString_Descriptor <- function(x, ...){
-	.Call( "as_character_descriptor", x at pointer, PACKAGE = "RProtoBuf" ) 
+	.Call( "Descriptor__as_character", x at pointer, PACKAGE = "RProtoBuf" ) 
 }
 ._toString_EnumDescriptor <- function(x, ...){
-	.Call( "as_character_enum_descriptor", x at pointer, PACKAGE = "RProtoBuf" ) 
+	.Call( "EnumDescriptor__as_character", x at pointer, PACKAGE = "RProtoBuf" ) 
 }
 ._toString_FieldDescriptor <- function(x, ...){
-	.Call( "as_character_field_descriptor", x at pointer, PACKAGE = "RProtoBuf" ) 
+	.Call( "FieldDescripor__as_character", x at pointer, PACKAGE = "RProtoBuf" ) 
 }
 ._toString_ServiceDescriptor <- function(x, ...){
-	.Call( "as_character_service_descriptor", x at pointer, PACKAGE = "RProtoBuf" ) 
+	.Call( "ServiceDescriptor__as_character", x at pointer, PACKAGE = "RProtoBuf" ) 
 }
 ._toString_MethodDescriptor <- function(x, ...){
-	.Call( "as_character_method_descriptor", x at pointer, PACKAGE = "RProtoBuf" ) 
+	.Call( "MethodDescriptor__as_character", x at pointer, PACKAGE = "RProtoBuf" ) 
 }
 ._toString_FileDescriptor <- function(x, ...){
-	.Call( "as_character_file_descriptor", x at pointer, PACKAGE = "RProtoBuf" ) 
+	.Call( "FileDescriptor__as_character", x at pointer, PACKAGE = "RProtoBuf" ) 
 }
 ._toString_EnumValueDescriptor <- function(x, ...){
-	.Call( "as_character_enum_value_descriptor", x at pointer, PACKAGE = "RProtoBuf" ) 
+	.Call( "EnumValueDescriptor__as_character", x at pointer, PACKAGE = "RProtoBuf" ) 
 }
 
 

Deleted: pkg/src/ascharacter.cpp
===================================================================
--- pkg/src/ascharacter.cpp	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/src/ascharacter.cpp	2010-05-08 10:14:19 UTC (rev 316)
@@ -1,34 +0,0 @@
-#include "rprotobuf.h"
-
-namespace rprotobuf{
-
-RCPP_XP_METHOD_0(as_character_enum_descriptor       , GPB::EnumDescriptor      , DebugString) ;
-RCPP_XP_METHOD_0(as_character_field_descriptor      , GPB::FieldDescriptor     , DebugString) ;
-RCPP_XP_METHOD_0(as_character_file_descriptor       , GPB::FileDescriptor      , DebugString) ;
-RCPP_XP_METHOD_0(as_character_enum_value_descriptor , GPB::EnumValueDescriptor , DebugString) ;
-RCPP_XP_METHOD_0(as_character_descriptor            , GPB::Descriptor          , DebugString) ;
-RCPP_XP_METHOD_0(as_character_service_descriptor    , GPB::ServiceDescriptor   , DebugString) ;
-RCPP_XP_METHOD_0(as_character_method_descriptor     , GPB::MethodDescriptor    , DebugString) ;
-
-
-/**
- * Get the value of the enum called name
- *
- * @param xp external pointer to an EnumDescriptor
- * @param name the name of the enum
- * 
- * @param the value associated with the name
- */
-RCPP_FUNCTION_2(int,get_value_of_enum, 
-	Rcpp::XPtr<GPB::EnumDescriptor> d, std::string name){
-	
-	const GPB::EnumValueDescriptor* evd = d->FindValueByName(name) ;
-    if( !evd ){
-    	/* or maybe it should just be NA */
-    	throwException( "cannot get the value", "UnknownEnumValueException" ) ;
-    }
-	return evd->number(); 
-}
-
-} // namespace rprotobuf
-

Modified: pkg/src/wrapper_Descriptor.cpp
===================================================================
--- pkg/src/wrapper_Descriptor.cpp	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/src/wrapper_Descriptor.cpp	2010-05-08 10:14:19 UTC (rev 316)
@@ -4,7 +4,9 @@
 
 #undef METHOD
 #define METHOD(__NAME__) RCPP_PP_CAT(Descriptor__,__NAME__)	
-	
+
+RCPP_XP_METHOD_0( METHOD(as_character), GPB::Descriptor          , DebugString) ;
+
 /**
  * @param xp external pointer to a Descriptor
  * @return the descriptor as an R list

Modified: pkg/src/wrapper_EnumDescriptor.cpp
===================================================================
--- pkg/src/wrapper_EnumDescriptor.cpp	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/src/wrapper_EnumDescriptor.cpp	2010-05-08 10:14:19 UTC (rev 316)
@@ -5,6 +5,7 @@
 #undef METHOD
 #define METHOD(__NAME__) RCPP_PP_CAT(Descriptor__,__NAME__)	
 
+	RCPP_XP_METHOD_0(METHOD(as_character), GPB::EnumDescriptor      , DebugString) ;
 	RCPP_XP_METHOD_0(METHOD(length)      ,GPB::EnumDescriptor,value_count)
 	RCPP_XP_METHOD_0(METHOD(value_count) ,GPB::EnumDescriptor,value_count)
 	
@@ -18,7 +19,27 @@
 		return message ;
 	}
 	
- 
+/**
+ * Get the value of the enum called name
+ *
+ * @param xp external pointer to an EnumDescriptor
+ * @param name the name of the enum
+ * 
+ * @param the value associated with the name
+ */
+RCPP_FUNCTION_2(int,get_value_of_enum, 
+	Rcpp::XPtr<GPB::EnumDescriptor> d, std::string name){
+	
+	const GPB::EnumValueDescriptor* evd = d->FindValueByName(name) ;
+    if( !evd ){
+    	/* or maybe it should just be NA */
+    	throwException( "cannot get the value", "UnknownEnumValueException" ) ;
+    }
+	return evd->number(); 
+}
+
+
+
 #undef METHOD
 
 } // namespace rprotobuf

Modified: pkg/src/wrapper_EnumValueDescriptor.cpp
===================================================================
--- pkg/src/wrapper_EnumValueDescriptor.cpp	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/src/wrapper_EnumValueDescriptor.cpp	2010-05-08 10:14:19 UTC (rev 316)
@@ -4,8 +4,10 @@
 
 #undef METHOD
 #define METHOD(__NAME__) RCPP_PP_CAT(EnumValueDescriptor__,__NAME__)
-	
-RCPP_FUNCTION_1(S4_EnumValueDescriptor, asMessage_EnumValueDescriptor, Rcpp::XPtr<GPB::EnumValueDescriptor> d ){
+
+RCPP_XP_METHOD_0( METHOD(as_character) , GPB::EnumValueDescriptor , DebugString) ;
+
+RCPP_FUNCTION_1(S4_EnumValueDescriptor, METHOD(as_Message) , Rcpp::XPtr<GPB::EnumValueDescriptor> d ){
 	GPB::EnumValueDescriptorProto* message = new GPB::EnumValueDescriptorProto() ; 
 	d->CopyTo( message ); 
 	return message ;

Modified: pkg/src/wrapper_FieldDescriptor.cpp
===================================================================
--- pkg/src/wrapper_FieldDescriptor.cpp	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/src/wrapper_FieldDescriptor.cpp	2010-05-08 10:14:19 UTC (rev 316)
@@ -6,6 +6,7 @@
 #undef METHOD
 #define METHOD(__NAME__) RCPP_PP_CAT(FieldDescriptor__,__NAME__)	
 
+	RCPP_XP_METHOD_0( METHOD(as_character)      , GPB::FieldDescriptor, DebugString)
 	RCPP_XP_METHOD_0( METHOD(is_extension)      , GPB::FieldDescriptor, is_extension)  
 	RCPP_XP_METHOD_0( METHOD(number)            , GPB::FieldDescriptor, number)  
 	RCPP_XP_METHOD_0( METHOD(type)              , GPB::FieldDescriptor, type )  

Modified: pkg/src/wrapper_FileDescriptor.cpp
===================================================================
--- pkg/src/wrapper_FileDescriptor.cpp	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/src/wrapper_FileDescriptor.cpp	2010-05-08 10:14:19 UTC (rev 316)
@@ -4,7 +4,9 @@
 
 #undef METHOD
 #define METHOD(__NAME__) RCPP_PP_CAT(FileDescriptor__,__NAME__)
-	
+
+RCPP_XP_METHOD_0( METHOD(as_character)       , GPB::FileDescriptor      , DebugString) ;
+
 RCPP_FUNCTION_1(S4_FileDescriptor, METHOD(as_Message), Rcpp::XPtr<GPB::FileDescriptor> d ){
 	GPB::FileDescriptorProto* message = new GPB::FileDescriptorProto() ; 
 	d->CopyTo( message ); 

Modified: pkg/src/wrapper_MethodDescriptor.cpp
===================================================================
--- pkg/src/wrapper_MethodDescriptor.cpp	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/src/wrapper_MethodDescriptor.cpp	2010-05-08 10:14:19 UTC (rev 316)
@@ -5,6 +5,8 @@
 #undef METHOD
 #define METHOD(__NAME__) RCPP_PP_CAT(MethodDescriptor__,__NAME__)
 
+RCPP_XP_METHOD_0( METHOD(as_character)     , GPB::MethodDescriptor    , DebugString)
+
 RCPP_FUNCTION_1(S4_MethodDescriptor, METHOD(as_Message), Rcpp::XPtr<GPB::MethodDescriptor> d ){
 	GPB::MethodDescriptorProto* message = new GPB::MethodDescriptorProto() ; 
 	d->CopyTo( message ); 

Modified: pkg/src/wrapper_ServiceDescriptor.cpp
===================================================================
--- pkg/src/wrapper_ServiceDescriptor.cpp	2010-05-08 10:03:36 UTC (rev 315)
+++ pkg/src/wrapper_ServiceDescriptor.cpp	2010-05-08 10:14:19 UTC (rev 316)
@@ -7,6 +7,7 @@
 	
 	RCPP_XP_METHOD_0( METHOD(length),GPB::ServiceDescriptor, method_count )
 	RCPP_XP_METHOD_0( METHOD(method_count),GPB::ServiceDescriptor, method_count )
+	RCPP_XP_METHOD_0( METHOD(as_character)    , GPB::ServiceDescriptor   , DebugString)
 	
 	RCPP_XP_METHOD_CAST_1( METHOD(getMethodByIndex) , GPB::ServiceDescriptor , method          , S4_MethodDescriptor ) 
 	RCPP_XP_METHOD_CAST_1( METHOD(getMethodByName)  , GPB::ServiceDescriptor , FindMethodByName, S4_MethodDescriptor ) 



More information about the Rprotobuf-commits mailing list