[Rprotobuf-commits] r326 - pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jul 14 02:12:54 CEST 2010
Author: edd
Date: 2010-07-14 02:12:54 +0200 (Wed, 14 Jul 2010)
New Revision: 326
Modified:
pkg/src/extractors.cpp
pkg/src/rprotobuf.cpp
pkg/src/rprotobuf.h
pkg/src/wrapper_Descriptor.cpp
Log:
more progress building against Rcpp 0.8.4 but not quite there yet...
Modified: pkg/src/extractors.cpp
===================================================================
--- pkg/src/extractors.cpp 2010-07-13 21:54:00 UTC (rev 325)
+++ pkg/src/extractors.cpp 2010-07-14 00:12:54 UTC (rev 326)
@@ -120,7 +120,7 @@
return Rcpp::wrap( ref->GetEnum( *message, fieldDesc )->number() ) ;
case CPPTYPE_MESSAGE:
- return S4_Message_( CLONE( &ref->GetMessage( *message, fieldDesc ) ) ) ;
+ return S4_Message( CLONE( &ref->GetMessage( *message, fieldDesc ) ) ) ;
break ;
}
}
Modified: pkg/src/rprotobuf.cpp
===================================================================
--- pkg/src/rprotobuf.cpp 2010-07-13 21:54:00 UTC (rev 325)
+++ pkg/src/rprotobuf.cpp 2010-07-14 00:12:54 UTC (rev 326)
@@ -80,7 +80,7 @@
}
}
- return( RS4_Descriptor( desc ) ) ;
+ return( S4_Descriptor( desc ) ) ;
}
/**
@@ -133,7 +133,7 @@
if( desc->field_count() ){
const GPB::FieldDescriptor* fd = desc->FindFieldByName(what) ;
if( fd ){
- return( RS4_FieldDescriptor(fd ) ) ;
+ return( S4_FieldDescriptor(fd ) ) ;
}
}
Modified: pkg/src/rprotobuf.h
===================================================================
--- pkg/src/rprotobuf.h 2010-07-13 21:54:00 UTC (rev 325)
+++ pkg/src/rprotobuf.h 2010-07-14 00:12:54 UTC (rev 326)
@@ -329,6 +329,8 @@
RcppExport SEXP ConnectionOutputStream_new( SEXP , SEXP) ;
+RcppExport SEXP new_RS4_Message_( const GPB::Message* message );
+
} // namespace rprotobuf
Modified: pkg/src/wrapper_Descriptor.cpp
===================================================================
--- pkg/src/wrapper_Descriptor.cpp 2010-07-13 21:54:00 UTC (rev 325)
+++ pkg/src/wrapper_Descriptor.cpp 2010-07-14 00:12:54 UTC (rev 326)
@@ -10,7 +10,7 @@
RCPP_XP_METHOD_0( METHOD(nested_type_count), GPB::Descriptor, nested_type_count )
RCPP_XP_METHOD_0( METHOD(enum_type_count), GPB::Descriptor, enum_type_count )
-RCPP_XP_METHOD_CAST_0( METHOD(containing_type), GPB::Descriptor, containing_type, RS4_Descriptor )
+RCPP_XP_METHOD_CAST_0( METHOD(containing_type), GPB::Descriptor, containing_type, S4_Descriptor )
/**
@@ -21,7 +21,7 @@
*
* @return member names, as an R character vector (STRSXP)
*/
-RCPP_FUNCTION_1( Rcpp::CharacterVector, METHOD(getMemberNames), Rcpp::XPtr<GPB::Decriptor> desc ){
+RCPP_FUNCTION_1( Rcpp::CharacterVector, METHOD(getMemberNames), Rcpp::XPtr<GPB::Descriptor> desc ){
int nfields = desc->field_count() ;
int ntypes = desc->nested_type_count() ;
@@ -29,13 +29,13 @@
Rcpp::CharacterVector res(nfields + ntypes + nenums ) ;
int j=0;
- for(i=0; i<nfields; i++, j++){
+ for (int i=0; i<nfields; i++, j++){
res[j] = desc->field(i)->name() ;
}
- for(i=0;i<ntypes; i++, j++){
+ for (int i=0;i<ntypes; i++, j++){
res[j] = desc->nested_type(i)->name() ;
}
- for( i=0; i<nenums; i++, j++){
+ for (int i=0; i<nenums; i++, j++){
res[j] = desc->enum_type(i)->name();
}
return( res );
@@ -67,7 +67,7 @@
names[j] = d->name() ;
}
for( i=0; i<nenums; j++, i++){
- const EnumDescriptor* ed = desc->enum_type(i) ;
+ const GPB::EnumDescriptor* ed = desc->enum_type(i) ;
res[j] = S4_EnumDescriptor( ed );
names[j] = ed->name() ;
}
More information about the Rprotobuf-commits
mailing list