[Rprotobuf-commits] r310 - pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Apr 28 15:38:07 CEST 2010
Author: romain
Date: 2010-04-28 15:38:07 +0200 (Wed, 28 Apr 2010)
New Revision: 310
Added:
pkg/src/wrapper_EnumDescriptor.cpp
pkg/src/wrapper_FieldDescriptor.cpp
Removed:
pkg/src/EnumDescriptor_wrapper.cpp
pkg/src/FieldDescriptor_wrapper.cpp
Log:
change file names
Deleted: pkg/src/EnumDescriptor_wrapper.cpp
===================================================================
--- pkg/src/EnumDescriptor_wrapper.cpp 2010-04-28 13:35:58 UTC (rev 309)
+++ pkg/src/EnumDescriptor_wrapper.cpp 2010-04-28 13:38:07 UTC (rev 310)
@@ -1,12 +0,0 @@
-#include "rprotobuf.h"
-
-namespace rprotobuf{
-
- RCPP_XP_METHOD_0(EnumDescriptor_length ,GPB::EnumDescriptor,value_count)
- RCPP_XP_METHOD_0(EnumDescriptor__value_count,GPB::EnumDescriptor,value_count)
-
- RCPP_XP_METHOD_CAST_1(EnumDescriptor_getValueByIndex , GPB::EnumDescriptor , value , S4_EnumValueDescriptor )
- RCPP_XP_METHOD_CAST_1(EnumDescriptor_getValueByNumber, GPB::EnumDescriptor , FindValueByNumber, S4_EnumValueDescriptor )
- RCPP_XP_METHOD_CAST_1(EnumDescriptor_getValueByName , GPB::EnumDescriptor , FindValueByName , S4_EnumValueDescriptor )
-
-} // namespace rprotobuf
Deleted: pkg/src/FieldDescriptor_wrapper.cpp
===================================================================
--- pkg/src/FieldDescriptor_wrapper.cpp 2010-04-28 13:35:58 UTC (rev 309)
+++ pkg/src/FieldDescriptor_wrapper.cpp 2010-04-28 13:38:07 UTC (rev 310)
@@ -1,64 +0,0 @@
-#include "rprotobuf.h"
-#include "fieldtypes.h"
-
-namespace rprotobuf {
-
- RCPP_XP_METHOD_0( FieldDescriptor_is_extension , GPB::FieldDescriptor, is_extension)
- RCPP_XP_METHOD_0( FieldDescriptor_number , GPB::FieldDescriptor, number)
- RCPP_XP_METHOD_0( FieldDescriptor_type , GPB::FieldDescriptor, type )
- RCPP_XP_METHOD_0( FieldDescriptor_cpp_type , GPB::FieldDescriptor, cpp_type )
- RCPP_XP_METHOD_0( FieldDescriptor_label , GPB::FieldDescriptor, label )
- RCPP_XP_METHOD_0( FieldDescriptor_is_repeated , GPB::FieldDescriptor, is_repeated )
- RCPP_XP_METHOD_0( FieldDescriptor_is_optional , GPB::FieldDescriptor, is_optional )
- RCPP_XP_METHOD_0( FieldDescriptor_is_required , GPB::FieldDescriptor, is_required )
- RCPP_XP_METHOD_0( FieldDescriptor_has_default_value , GPB::FieldDescriptor, has_default_value )
-
-
-#define RPB_HANDLE_CASE(__CPP__,__LC__) \
-case CPPTYPE_##__CPP__: \
- { \
- return Rcpp::wrap( d->default_value_##__LC__() ); \
- break ; \
- }
-
- RCPP_FUNCTION_1( SEXP, FieldDescriptor_default_value , Rcpp::XPtr<GPB::FieldDescriptor> d ){
- switch( d->cpp_type() ){
-
- RPB_HANDLE_CASE(INT32,int32)
- RPB_HANDLE_CASE(INT64,int64)
- RPB_HANDLE_CASE(UINT32,uint32)
- RPB_HANDLE_CASE(UINT64,uint64)
- RPB_HANDLE_CASE(DOUBLE,double)
- RPB_HANDLE_CASE(FLOAT,float)
- RPB_HANDLE_CASE(BOOL,bool)
- RPB_HANDLE_CASE(STRING,string)
-
- case CPPTYPE_ENUM:
- {
- return Rf_ScalarInteger( d->default_value_enum()->number() ) ;
- break ;
- }
- default:
- break ;
- }
- return R_NilValue ;
- }
-
- RCPP_FUNCTION_1(S4_Descriptor, FieldDescriptor_message_type, Rcpp::XPtr<GPB::FieldDescriptor> d){
- if( d->cpp_type() != CPPTYPE_MESSAGE ){
- throw Rcpp::not_compatible( "not a message type field" ) ;
- }
- return S4_Descriptor( d->message_type() ) ;
- }
-
- RCPP_FUNCTION_1(S4_EnumDescriptor, FieldDescriptor_enum_type, Rcpp::XPtr<GPB::FieldDescriptor> d){
- if( d->cpp_type() != CPPTYPE_ENUM ){
- throwException( "not an enum type field", "NotEnumType" );
- }
- return S4_EnumDescriptor( d->enum_type() ) ;
- }
-
-#undef RPB_HANDLE_CASE
-
-} // namespace rprotobuf
-
Copied: pkg/src/wrapper_EnumDescriptor.cpp (from rev 307, pkg/src/EnumDescriptor_wrapper.cpp)
===================================================================
--- pkg/src/wrapper_EnumDescriptor.cpp (rev 0)
+++ pkg/src/wrapper_EnumDescriptor.cpp 2010-04-28 13:38:07 UTC (rev 310)
@@ -0,0 +1,12 @@
+#include "rprotobuf.h"
+
+namespace rprotobuf{
+
+ RCPP_XP_METHOD_0(EnumDescriptor_length ,GPB::EnumDescriptor,value_count)
+ RCPP_XP_METHOD_0(EnumDescriptor__value_count,GPB::EnumDescriptor,value_count)
+
+ RCPP_XP_METHOD_CAST_1(EnumDescriptor_getValueByIndex , GPB::EnumDescriptor , value , S4_EnumValueDescriptor )
+ RCPP_XP_METHOD_CAST_1(EnumDescriptor_getValueByNumber, GPB::EnumDescriptor , FindValueByNumber, S4_EnumValueDescriptor )
+ RCPP_XP_METHOD_CAST_1(EnumDescriptor_getValueByName , GPB::EnumDescriptor , FindValueByName , S4_EnumValueDescriptor )
+
+} // namespace rprotobuf
Copied: pkg/src/wrapper_FieldDescriptor.cpp (from rev 307, pkg/src/FieldDescriptor_wrapper.cpp)
===================================================================
--- pkg/src/wrapper_FieldDescriptor.cpp (rev 0)
+++ pkg/src/wrapper_FieldDescriptor.cpp 2010-04-28 13:38:07 UTC (rev 310)
@@ -0,0 +1,64 @@
+#include "rprotobuf.h"
+#include "fieldtypes.h"
+
+namespace rprotobuf {
+
+ RCPP_XP_METHOD_0( FieldDescriptor_is_extension , GPB::FieldDescriptor, is_extension)
+ RCPP_XP_METHOD_0( FieldDescriptor_number , GPB::FieldDescriptor, number)
+ RCPP_XP_METHOD_0( FieldDescriptor_type , GPB::FieldDescriptor, type )
+ RCPP_XP_METHOD_0( FieldDescriptor_cpp_type , GPB::FieldDescriptor, cpp_type )
+ RCPP_XP_METHOD_0( FieldDescriptor_label , GPB::FieldDescriptor, label )
+ RCPP_XP_METHOD_0( FieldDescriptor_is_repeated , GPB::FieldDescriptor, is_repeated )
+ RCPP_XP_METHOD_0( FieldDescriptor_is_optional , GPB::FieldDescriptor, is_optional )
+ RCPP_XP_METHOD_0( FieldDescriptor_is_required , GPB::FieldDescriptor, is_required )
+ RCPP_XP_METHOD_0( FieldDescriptor_has_default_value , GPB::FieldDescriptor, has_default_value )
+
+
+#define RPB_HANDLE_CASE(__CPP__,__LC__) \
+case CPPTYPE_##__CPP__: \
+ { \
+ return Rcpp::wrap( d->default_value_##__LC__() ); \
+ break ; \
+ }
+
+ RCPP_FUNCTION_1( SEXP, FieldDescriptor_default_value , Rcpp::XPtr<GPB::FieldDescriptor> d ){
+ switch( d->cpp_type() ){
+
+ RPB_HANDLE_CASE(INT32,int32)
+ RPB_HANDLE_CASE(INT64,int64)
+ RPB_HANDLE_CASE(UINT32,uint32)
+ RPB_HANDLE_CASE(UINT64,uint64)
+ RPB_HANDLE_CASE(DOUBLE,double)
+ RPB_HANDLE_CASE(FLOAT,float)
+ RPB_HANDLE_CASE(BOOL,bool)
+ RPB_HANDLE_CASE(STRING,string)
+
+ case CPPTYPE_ENUM:
+ {
+ return Rf_ScalarInteger( d->default_value_enum()->number() ) ;
+ break ;
+ }
+ default:
+ break ;
+ }
+ return R_NilValue ;
+ }
+
+ RCPP_FUNCTION_1(S4_Descriptor, FieldDescriptor_message_type, Rcpp::XPtr<GPB::FieldDescriptor> d){
+ if( d->cpp_type() != CPPTYPE_MESSAGE ){
+ throw Rcpp::not_compatible( "not a message type field" ) ;
+ }
+ return S4_Descriptor( d->message_type() ) ;
+ }
+
+ RCPP_FUNCTION_1(S4_EnumDescriptor, FieldDescriptor_enum_type, Rcpp::XPtr<GPB::FieldDescriptor> d){
+ if( d->cpp_type() != CPPTYPE_ENUM ){
+ throwException( "not an enum type field", "NotEnumType" );
+ }
+ return S4_EnumDescriptor( d->enum_type() ) ;
+ }
+
+#undef RPB_HANDLE_CASE
+
+} // namespace rprotobuf
+
More information about the Rprotobuf-commits
mailing list