[Rprotobuf-commits] r312 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 28 15:42:54 CEST 2010


Author: romain
Date: 2010-04-28 15:42:54 +0200 (Wed, 28 Apr 2010)
New Revision: 312

Added:
   pkg/R/wrapper_EnumDescriptor.R
   pkg/R/wrapper_EnumValueDescriptor.R
   pkg/R/wrapper_FieldDescriptor.R
   pkg/R/wrapper_MethodDescriptor.R
   pkg/R/wrapper_ServiceDescriptor.R
Removed:
   pkg/R/EnumDescriptor_wrapper.R
   pkg/R/EnumValueDescriptor_wrapper.R
   pkg/R/FieldDescriptor_wrapper.R
   pkg/R/MethodDescriptor_wrapper.R
   pkg/R/ServiceDescriptor_wrapper.R
Log:
change file names

Deleted: pkg/R/EnumDescriptor_wrapper.R
===================================================================
--- pkg/R/EnumDescriptor_wrapper.R	2010-04-28 13:38:47 UTC (rev 311)
+++ pkg/R/EnumDescriptor_wrapper.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -1,36 +0,0 @@
-
-setGeneric( "value_count", function(object ){
-	standardGeneric( "value_count" )
-} )
-setMethod( "value_count", "EnumDescriptor", function(object){
-	.Call( "EnumDescriptor__value_count", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-
-setGeneric( "value", function(object, index, name, number ){
-	standardGeneric( "value" )
-} )
-setMethod( "value", "EnumDescriptor", function(object, index, name, number){
-	
-	has_index  <- !missing(index)
-	has_number <- !missing(number)
-	has_name   <- !missing(name)
-	
-	if( as.integer(has_index) + as.integer(has_number) + as.integer(has_name) != 1L ){
-		stop( "need exactly one of `index`, `number` or `name`" )
-	}
-	
-	if( has_index ){
-		return( .Call( "EnumDescriptor_getValueByIndex", object at pointer, as.integer(index)-1L, PACKAGE = "RProtoBuf" ) )
-	}
-	
-	if( has_number ){
-		return( .Call( "EnumDescriptor_getValueByNumber", object at pointer, as.integer(number), PACKAGE = "RProtoBuf" ) )
-	}
-	
-	if( has_name ){
-		return( .Call( "EnumDescriptor_getValueByName", object at pointer, as.character(name), PACKAGE = "RProtoBuf" ) )
-	}
-	
-} )
-

Deleted: pkg/R/EnumValueDescriptor_wrapper.R
===================================================================
--- pkg/R/EnumValueDescriptor_wrapper.R	2010-04-28 13:38:47 UTC (rev 311)
+++ pkg/R/EnumValueDescriptor_wrapper.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -1,5 +0,0 @@
-
-setMethod( "enum_type", c( object = "EnumValueDescriptor", index = "missing", name = "missing"), function(object, index, name){
-	.Call( "EnumValueDescriptor__enum_type", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-

Deleted: pkg/R/FieldDescriptor_wrapper.R
===================================================================
--- pkg/R/FieldDescriptor_wrapper.R	2010-04-28 13:38:47 UTC (rev 311)
+++ pkg/R/FieldDescriptor_wrapper.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -1,125 +0,0 @@
-
-setGeneric( "is_extension", function(object){
-	standardGeneric("is_extension")
-} )
-setMethod( "is_extension", "FieldDescriptor", function(object){
-	.Call( "FieldDescriptor_is_extension", object at pointer, PACKAGE = "RProtoBuf" )
-})
-
-setGeneric( "number", function(object){
-	standardGeneric( "number" )
-} )
-setMethod( "number", "FieldDescriptor", function(object){
-	.Call( "FieldDescriptor_number", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-TYPE_DOUBLE   <- 1L
-TYPE_FLOAT    <- 2L
-TYPE_INT64    <- 3L
-TYPE_UINT64   <- 4L
-TYPE_INT32    <- 5L
-TYPE_FIXED64  <- 6L
-TYPE_FIXED32  <- 7L
-TYPE_BOOL     <- 8L
-TYPE_STRING   <- 9L
-TYPE_GROUP    <- 10L
-TYPE_MESSAGE  <- 11L
-TYPE_BYTES    <- 12L
-TYPE_UINT32   <- 13L
-TYPE_ENUM     <- 14L
-TYPE_SFIXED32 <- 15L
-TYPE_SFIXED64 <- 16L
-TYPE_SINT32   <- 17L
-TYPE_SINT64   <- 18L
-
-.TYPES <- ls( pattern = "^TYPE_" )
-
-setGeneric( "type", function(object, as.string = FALSE){
-	standardGeneric( "type" )
-} )
-setMethod( "type", "FieldDescriptor", function(object, as.string = FALSE){
-	type <- .Call( "FieldDescriptor_type", object at pointer, PACKAGE = "RProtoBuf" )
-	if( as.string ) .TYPES[type] else type
-} )
-
-
-CPPTYPE_INT32 <- 1L
-CPPTYPE_INT64 <- 2L
-CPPTYPE_UINT32 <- 3L
-CPPTYPE_UINT64 <- 4L
-CPPTYPE_DOUBLE <- 5L
-CPPTYPE_FLOAT <- 6L
-CPPTYPE_BOOL <- 7L
-CPPTYPE_ENUM <- 8L
-CPPTYPE_STRING <- 9L
-CPPTYPE_MESSAGE <- 10L
-.CPPTYPES <- ls( pattern = "^CPPTYPE_" )
-
-setGeneric( "cpp_type", function(object, as.string = FALSE ){
-	standardGeneric( "cpp_type" )
-} )
-setMethod( "cpp_type", "FieldDescriptor", function(object, as.string = FALSE){
-	cpptype <- .Call( "FieldDescriptor_cpp_type", object at pointer, PACKAGE = "RProtoBuf" )
-	if( as.string ) .CPPTYPES[cpptype] else cpptype
-} )
-
-LABEL_OPTIONAL <- 1L
-LABEL_REQUIRED <- 2L
-LABEL_REPEATED <- 3L
-.LABELS <-  ls( pattern = "^LABEL_" )
-
-setGeneric( "label", function(object, as.string = FALSE ){
-	standardGeneric( "label" )
-} )
-setMethod( "label", "FieldDescriptor", function(object, as.string = FALSE){
-	lab <- .Call( "FieldDescriptor_label", object at pointer, PACKAGE = "RProtoBuf" )
-	if( as.string ) .LABELS[lab] else lab
-} )
-
-setGeneric( "is_repeated", function(object ){
-	standardGeneric( "is_repeated" )
-} )
-setMethod( "is_repeated", "FieldDescriptor", function(object){
-	.Call( "FieldDescriptor_is_repeated", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-setGeneric( "is_optional", function(object){
-	standardGeneric( "is_optional" )
-} )
-setMethod( "is_optional", "FieldDescriptor", function(object){
-	.Call( "FieldDescriptor_is_optional", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-setGeneric( "is_required", function(object ){
-	standardGeneric( "is_required" )
-} )
-setMethod( "is_required", "FieldDescriptor", function(object){
-	.Call( "FieldDescriptor_is_required", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-setGeneric( "has_default_value", function(object ){
-	standardGeneric( "has_default_value" )
-} )
-setMethod( "has_default_value", "FieldDescriptor", function(object){
-	.Call( "FieldDescriptor_has_default_value", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-setGeneric( "default_value", function(object ){
-	standardGeneric( "default_value" )
-} )
-setMethod( "default_value", "FieldDescriptor", function(object){
-	.Call( "FieldDescriptor_default_value", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-
-setGeneric( "message_type", function(object ){
-	standardGeneric( "message_type" )
-} )
-setMethod( "message_type", "FieldDescriptor", function(object){
-	.Call( "FieldDescriptor_message_type", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-setMethod( "enum_type", c( object = "FieldDescriptor", index = "missing", name = "missing"), function(object){
-	.Call( "FieldDescriptor_enum_type", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-

Deleted: pkg/R/MethodDescriptor_wrapper.R
===================================================================
--- pkg/R/MethodDescriptor_wrapper.R	2010-04-28 13:38:47 UTC (rev 311)
+++ pkg/R/MethodDescriptor_wrapper.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -1,16 +0,0 @@
-
-setGeneric( "input_type", function(object){
-	standardGeneric( "input_type" )
-} )
-setGeneric( "output_type", function(object){
-	standardGeneric( "output_type" )
-} )
-
-setMethod( "input_type", "MethodDescriptor", function(object){
-	.Call("get_method_input_type", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-setMethod( "output_type", "MethodDescriptor", function(object){
-	.Call("get_method_output_type", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-

Deleted: pkg/R/ServiceDescriptor_wrapper.R
===================================================================
--- pkg/R/ServiceDescriptor_wrapper.R	2010-04-28 13:38:47 UTC (rev 311)
+++ pkg/R/ServiceDescriptor_wrapper.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -1,31 +0,0 @@
-setGeneric( "method_count", function(object ){
-	standardGeneric( "method_count" )
-} )
-setMethod( "method_count", "ServiceDescriptor", function(object){
-	.Call( "ServiceDescriptor_method_count", object at pointer, PACKAGE = "RProtoBuf" )
-} )
-
-
-setGeneric( "method", function(object, index, name ){
-	standardGeneric( "method" )
-} )
-setMethod( "method", "ServiceDescriptor", function(object, index, name){
-	
-	has_index  <- !missing(index)
-	has_name   <- !missing(name)
-	
-	if( as.integer(has_index) + as.integer(has_name) != 1L ){
-		stop( "need exactly one of `index` or `name`" )
-	}
-	
-	if( has_index ){
-		return( .Call( "ServiceDescriptor_getMethodByIndex", object at pointer, as.integer(index)-1L, PACKAGE = "RProtoBuf" ) )
-	}
-	
-	if( has_name ){
-		return( .Call( "ServiceDescriptor_getMethodByName", object at pointer, as.character(name), PACKAGE = "RProtoBuf" ) )
-	}
-	
-} )
-
-

Copied: pkg/R/wrapper_EnumDescriptor.R (from rev 306, pkg/R/EnumDescriptor_wrapper.R)
===================================================================
--- pkg/R/wrapper_EnumDescriptor.R	                        (rev 0)
+++ pkg/R/wrapper_EnumDescriptor.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -0,0 +1,36 @@
+
+setGeneric( "value_count", function(object ){
+	standardGeneric( "value_count" )
+} )
+setMethod( "value_count", "EnumDescriptor", function(object){
+	.Call( "EnumDescriptor__value_count", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+
+setGeneric( "value", function(object, index, name, number ){
+	standardGeneric( "value" )
+} )
+setMethod( "value", "EnumDescriptor", function(object, index, name, number){
+	
+	has_index  <- !missing(index)
+	has_number <- !missing(number)
+	has_name   <- !missing(name)
+	
+	if( as.integer(has_index) + as.integer(has_number) + as.integer(has_name) != 1L ){
+		stop( "need exactly one of `index`, `number` or `name`" )
+	}
+	
+	if( has_index ){
+		return( .Call( "EnumDescriptor_getValueByIndex", object at pointer, as.integer(index)-1L, PACKAGE = "RProtoBuf" ) )
+	}
+	
+	if( has_number ){
+		return( .Call( "EnumDescriptor_getValueByNumber", object at pointer, as.integer(number), PACKAGE = "RProtoBuf" ) )
+	}
+	
+	if( has_name ){
+		return( .Call( "EnumDescriptor_getValueByName", object at pointer, as.character(name), PACKAGE = "RProtoBuf" ) )
+	}
+	
+} )
+

Copied: pkg/R/wrapper_EnumValueDescriptor.R (from rev 306, pkg/R/EnumValueDescriptor_wrapper.R)
===================================================================
--- pkg/R/wrapper_EnumValueDescriptor.R	                        (rev 0)
+++ pkg/R/wrapper_EnumValueDescriptor.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -0,0 +1,5 @@
+
+setMethod( "enum_type", c( object = "EnumValueDescriptor", index = "missing", name = "missing"), function(object, index, name){
+	.Call( "EnumValueDescriptor__enum_type", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+

Copied: pkg/R/wrapper_FieldDescriptor.R (from rev 306, pkg/R/FieldDescriptor_wrapper.R)
===================================================================
--- pkg/R/wrapper_FieldDescriptor.R	                        (rev 0)
+++ pkg/R/wrapper_FieldDescriptor.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -0,0 +1,125 @@
+
+setGeneric( "is_extension", function(object){
+	standardGeneric("is_extension")
+} )
+setMethod( "is_extension", "FieldDescriptor", function(object){
+	.Call( "FieldDescriptor_is_extension", object at pointer, PACKAGE = "RProtoBuf" )
+})
+
+setGeneric( "number", function(object){
+	standardGeneric( "number" )
+} )
+setMethod( "number", "FieldDescriptor", function(object){
+	.Call( "FieldDescriptor_number", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+TYPE_DOUBLE   <- 1L
+TYPE_FLOAT    <- 2L
+TYPE_INT64    <- 3L
+TYPE_UINT64   <- 4L
+TYPE_INT32    <- 5L
+TYPE_FIXED64  <- 6L
+TYPE_FIXED32  <- 7L
+TYPE_BOOL     <- 8L
+TYPE_STRING   <- 9L
+TYPE_GROUP    <- 10L
+TYPE_MESSAGE  <- 11L
+TYPE_BYTES    <- 12L
+TYPE_UINT32   <- 13L
+TYPE_ENUM     <- 14L
+TYPE_SFIXED32 <- 15L
+TYPE_SFIXED64 <- 16L
+TYPE_SINT32   <- 17L
+TYPE_SINT64   <- 18L
+
+.TYPES <- ls( pattern = "^TYPE_" )
+
+setGeneric( "type", function(object, as.string = FALSE){
+	standardGeneric( "type" )
+} )
+setMethod( "type", "FieldDescriptor", function(object, as.string = FALSE){
+	type <- .Call( "FieldDescriptor_type", object at pointer, PACKAGE = "RProtoBuf" )
+	if( as.string ) .TYPES[type] else type
+} )
+
+
+CPPTYPE_INT32 <- 1L
+CPPTYPE_INT64 <- 2L
+CPPTYPE_UINT32 <- 3L
+CPPTYPE_UINT64 <- 4L
+CPPTYPE_DOUBLE <- 5L
+CPPTYPE_FLOAT <- 6L
+CPPTYPE_BOOL <- 7L
+CPPTYPE_ENUM <- 8L
+CPPTYPE_STRING <- 9L
+CPPTYPE_MESSAGE <- 10L
+.CPPTYPES <- ls( pattern = "^CPPTYPE_" )
+
+setGeneric( "cpp_type", function(object, as.string = FALSE ){
+	standardGeneric( "cpp_type" )
+} )
+setMethod( "cpp_type", "FieldDescriptor", function(object, as.string = FALSE){
+	cpptype <- .Call( "FieldDescriptor_cpp_type", object at pointer, PACKAGE = "RProtoBuf" )
+	if( as.string ) .CPPTYPES[cpptype] else cpptype
+} )
+
+LABEL_OPTIONAL <- 1L
+LABEL_REQUIRED <- 2L
+LABEL_REPEATED <- 3L
+.LABELS <-  ls( pattern = "^LABEL_" )
+
+setGeneric( "label", function(object, as.string = FALSE ){
+	standardGeneric( "label" )
+} )
+setMethod( "label", "FieldDescriptor", function(object, as.string = FALSE){
+	lab <- .Call( "FieldDescriptor_label", object at pointer, PACKAGE = "RProtoBuf" )
+	if( as.string ) .LABELS[lab] else lab
+} )
+
+setGeneric( "is_repeated", function(object ){
+	standardGeneric( "is_repeated" )
+} )
+setMethod( "is_repeated", "FieldDescriptor", function(object){
+	.Call( "FieldDescriptor_is_repeated", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+setGeneric( "is_optional", function(object){
+	standardGeneric( "is_optional" )
+} )
+setMethod( "is_optional", "FieldDescriptor", function(object){
+	.Call( "FieldDescriptor_is_optional", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+setGeneric( "is_required", function(object ){
+	standardGeneric( "is_required" )
+} )
+setMethod( "is_required", "FieldDescriptor", function(object){
+	.Call( "FieldDescriptor_is_required", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+setGeneric( "has_default_value", function(object ){
+	standardGeneric( "has_default_value" )
+} )
+setMethod( "has_default_value", "FieldDescriptor", function(object){
+	.Call( "FieldDescriptor_has_default_value", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+setGeneric( "default_value", function(object ){
+	standardGeneric( "default_value" )
+} )
+setMethod( "default_value", "FieldDescriptor", function(object){
+	.Call( "FieldDescriptor_default_value", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+
+setGeneric( "message_type", function(object ){
+	standardGeneric( "message_type" )
+} )
+setMethod( "message_type", "FieldDescriptor", function(object){
+	.Call( "FieldDescriptor_message_type", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+setMethod( "enum_type", c( object = "FieldDescriptor", index = "missing", name = "missing"), function(object){
+	.Call( "FieldDescriptor_enum_type", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+

Copied: pkg/R/wrapper_MethodDescriptor.R (from rev 306, pkg/R/MethodDescriptor_wrapper.R)
===================================================================
--- pkg/R/wrapper_MethodDescriptor.R	                        (rev 0)
+++ pkg/R/wrapper_MethodDescriptor.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -0,0 +1,16 @@
+
+setGeneric( "input_type", function(object){
+	standardGeneric( "input_type" )
+} )
+setGeneric( "output_type", function(object){
+	standardGeneric( "output_type" )
+} )
+
+setMethod( "input_type", "MethodDescriptor", function(object){
+	.Call("get_method_input_type", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+setMethod( "output_type", "MethodDescriptor", function(object){
+	.Call("get_method_output_type", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+

Copied: pkg/R/wrapper_ServiceDescriptor.R (from rev 306, pkg/R/ServiceDescriptor_wrapper.R)
===================================================================
--- pkg/R/wrapper_ServiceDescriptor.R	                        (rev 0)
+++ pkg/R/wrapper_ServiceDescriptor.R	2010-04-28 13:42:54 UTC (rev 312)
@@ -0,0 +1,31 @@
+setGeneric( "method_count", function(object ){
+	standardGeneric( "method_count" )
+} )
+setMethod( "method_count", "ServiceDescriptor", function(object){
+	.Call( "ServiceDescriptor_method_count", object at pointer, PACKAGE = "RProtoBuf" )
+} )
+
+
+setGeneric( "method", function(object, index, name ){
+	standardGeneric( "method" )
+} )
+setMethod( "method", "ServiceDescriptor", function(object, index, name){
+	
+	has_index  <- !missing(index)
+	has_name   <- !missing(name)
+	
+	if( as.integer(has_index) + as.integer(has_name) != 1L ){
+		stop( "need exactly one of `index` or `name`" )
+	}
+	
+	if( has_index ){
+		return( .Call( "ServiceDescriptor_getMethodByIndex", object at pointer, as.integer(index)-1L, PACKAGE = "RProtoBuf" ) )
+	}
+	
+	if( has_name ){
+		return( .Call( "ServiceDescriptor_getMethodByName", object at pointer, as.character(name), PACKAGE = "RProtoBuf" ) )
+	}
+	
+} )
+
+



More information about the Rprotobuf-commits mailing list