[Rprotobuf-commits] r355 - in pkg: inst/examples/HighFrequencyFinance inst/unitTests src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 30 09:50:41 CEST 2010


Author: romain
Date: 2010-07-30 09:50:40 +0200 (Fri, 30 Jul 2010)
New Revision: 355

Modified:
   pkg/inst/examples/HighFrequencyFinance/TradeData.pb.cc
   pkg/inst/examples/HighFrequencyFinance/TradeData.pb.h
   pkg/inst/unitTests/runTests.R
   pkg/src/wrapper_Descriptor.cpp
Log:
typo

Modified: pkg/inst/examples/HighFrequencyFinance/TradeData.pb.cc
===================================================================
--- pkg/inst/examples/HighFrequencyFinance/TradeData.pb.cc	2010-07-29 01:34:46 UTC (rev 354)
+++ pkg/inst/examples/HighFrequencyFinance/TradeData.pb.cc	2010-07-30 07:50:40 UTC (rev 355)
@@ -8,6 +8,7 @@
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/reflection_ops.h>
 #include <google/protobuf/wire_format.h>
+// @@protoc_insertion_point(includes)
 
 namespace TradeData {
 
@@ -127,14 +128,16 @@
 const int Fill::kSizeFieldNumber;
 #endif  // !_MSC_VER
 
-Fill::Fill() {
+Fill::Fill()
+  : ::google::protobuf::Message() {
   SharedCtor();
 }
 
 void Fill::InitAsDefaultInstance() {
 }
 
-Fill::Fill(const Fill& from) {
+Fill::Fill(const Fill& from)
+  : ::google::protobuf::Message() {
   SharedCtor();
   MergeFrom(from);
 }
@@ -160,6 +163,11 @@
   }
 }
 
+void Fill::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
 const ::google::protobuf::Descriptor* Fill::descriptor() {
   protobuf_AssignDescriptorsOnce();
   return Fill_descriptor_;
@@ -198,57 +206,64 @@
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
       // required double timestamp = 1;
       case 1: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) !=
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
             ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
+                 input, &timestamp_)));
+          _set_bit(0);
+        } else {
           goto handle_uninterpreted;
         }
-        DO_(::google::protobuf::internal::WireFormatLite::ReadDouble(
-              input, &timestamp_));
-        _set_bit(0);
         if (input->ExpectTag(18)) goto parse_symbol;
         break;
       }
       
       // required string symbol = 2;
       case 2: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) !=
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
             ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_symbol:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_symbol()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+            this->symbol().data(), this->symbol().length(),
+            ::google::protobuf::internal::WireFormat::PARSE);
+        } else {
           goto handle_uninterpreted;
         }
-       parse_symbol:
-        DO_(::google::protobuf::internal::WireFormatLite::ReadString(
-              input, this->mutable_symbol()));
-        ::google::protobuf::internal::WireFormat::VerifyUTF8String(
-          this->symbol().data(), this->symbol().length(),
-          ::google::protobuf::internal::WireFormat::PARSE);
         if (input->ExpectTag(25)) goto parse_price;
         break;
       }
       
       // required double price = 3;
       case 3: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) !=
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
             ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
+         parse_price:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
+                 input, &price_)));
+          _set_bit(2);
+        } else {
           goto handle_uninterpreted;
         }
-       parse_price:
-        DO_(::google::protobuf::internal::WireFormatLite::ReadDouble(
-              input, &price_));
-        _set_bit(2);
         if (input->ExpectTag(32)) goto parse_size;
         break;
       }
       
       // required int32 size = 4;
       case 4: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) !=
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
             ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_size:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &size_)));
+          _set_bit(3);
+        } else {
           goto handle_uninterpreted;
         }
-       parse_size:
-        DO_(::google::protobuf::internal::WireFormatLite::ReadInt32(
-              input, &size_));
-        _set_bit(3);
         if (input->ExpectAtEnd()) return true;
         break;
       }
@@ -271,12 +286,6 @@
 
 void Fill::SerializeWithCachedSizes(
     ::google::protobuf::io::CodedOutputStream* output) const {
-  ::google::protobuf::uint8* raw_buffer = output->GetDirectBufferForNBytesAndAdvance(_cached_size_);
-  if (raw_buffer != NULL) {
-    Fill::SerializeWithCachedSizesToArray(raw_buffer);
-    return;
-  }
-  
   // required double timestamp = 1;
   if (_has_bit(0)) {
     ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->timestamp(), output);
@@ -375,7 +384,9 @@
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         unknown_fields());
   }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
   return total_size;
 }
 
@@ -455,14 +466,16 @@
 const int Trades::kFillFieldNumber;
 #endif  // !_MSC_VER
 
-Trades::Trades() {
+Trades::Trades()
+  : ::google::protobuf::Message() {
   SharedCtor();
 }
 
 void Trades::InitAsDefaultInstance() {
 }
 
-Trades::Trades(const Trades& from) {
+Trades::Trades(const Trades& from)
+  : ::google::protobuf::Message() {
   SharedCtor();
   MergeFrom(from);
 }
@@ -481,6 +494,11 @@
   }
 }
 
+void Trades::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
 const ::google::protobuf::Descriptor* Trades::descriptor() {
   protobuf_AssignDescriptorsOnce();
   return Trades_descriptor_;
@@ -510,13 +528,14 @@
     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
       // repeated .TradeData.Fill fill = 1;
       case 1: {
-        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) !=
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
             ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_fill:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+                input, add_fill()));
+        } else {
           goto handle_uninterpreted;
         }
-       parse_fill:
-        DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
-              input, add_fill()));
         if (input->ExpectTag(10)) goto parse_fill;
         if (input->ExpectAtEnd()) return true;
         break;
@@ -540,15 +559,9 @@
 
 void Trades::SerializeWithCachedSizes(
     ::google::protobuf::io::CodedOutputStream* output) const {
-  ::google::protobuf::uint8* raw_buffer = output->GetDirectBufferForNBytesAndAdvance(_cached_size_);
-  if (raw_buffer != NULL) {
-    Trades::SerializeWithCachedSizesToArray(raw_buffer);
-    return;
-  }
-  
   // repeated .TradeData.Fill fill = 1;
   for (int i = 0; i < this->fill_size(); i++) {
-    ::google::protobuf::internal::WireFormatLite::WriteMessageNoVirtual(
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
       1, this->fill(i), output);
   }
   
@@ -590,7 +603,9 @@
       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
         unknown_fields());
   }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
   _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
   return total_size;
 }
 
@@ -650,4 +665,8 @@
 }
 
 
+// @@protoc_insertion_point(namespace_scope)
+
 }  // namespace TradeData
+
+// @@protoc_insertion_point(global_scope)

Modified: pkg/inst/examples/HighFrequencyFinance/TradeData.pb.h
===================================================================
--- pkg/inst/examples/HighFrequencyFinance/TradeData.pb.h	2010-07-29 01:34:46 UTC (rev 354)
+++ pkg/inst/examples/HighFrequencyFinance/TradeData.pb.h	2010-07-30 07:50:40 UTC (rev 355)
@@ -1,4 +1,5 @@
 // Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: TradeData.proto
 
 #ifndef PROTOBUF_TradeData_2eproto__INCLUDED
 #define PROTOBUF_TradeData_2eproto__INCLUDED
@@ -7,12 +8,12 @@
 
 #include <google/protobuf/stubs/common.h>
 
-#if GOOGLE_PROTOBUF_VERSION < 2002000
+#if GOOGLE_PROTOBUF_VERSION < 2003000
 #error This file was generated by a newer version of protoc which is
 #error incompatible with your Protocol Buffer headers.  Please update
 #error your headers.
 #endif
-#if 2002000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#if 2003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
 #error This file was generated by an older version of protoc which is
 #error incompatible with your Protocol Buffer headers.  Please
 #error regenerate this file with a newer version of protoc.
@@ -22,6 +23,7 @@
 #include <google/protobuf/repeated_field.h>
 #include <google/protobuf/extension_set.h>
 #include <google/protobuf/generated_message_reflection.h>
+// @@protoc_insertion_point(includes)
 
 namespace TradeData {
 
@@ -57,6 +59,7 @@
   
   static const ::google::protobuf::Descriptor* descriptor();
   static const Fill& default_instance();
+  
   void Swap(Fill* other);
   
   // implements Message ----------------------------------------------
@@ -79,7 +82,7 @@
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const { _cached_size_ = size; }
+  void SetCachedSize(int size) const;
   public:
   
   ::google::protobuf::Metadata GetMetadata() const;
@@ -119,6 +122,7 @@
   inline ::google::protobuf::int32 size() const;
   inline void set_size(::google::protobuf::int32 value);
   
+  // @@protoc_insertion_point(class_scope:TradeData.Fill)
  private:
   ::google::protobuf::UnknownFieldSet _unknown_fields_;
   mutable int _cached_size_;
@@ -172,6 +176,7 @@
   
   static const ::google::protobuf::Descriptor* descriptor();
   static const Trades& default_instance();
+  
   void Swap(Trades* other);
   
   // implements Message ----------------------------------------------
@@ -194,7 +199,7 @@
   private:
   void SharedCtor();
   void SharedDtor();
-  void SetCachedSize(int size) const { _cached_size_ = size; }
+  void SetCachedSize(int size) const;
   public:
   
   ::google::protobuf::Metadata GetMetadata() const;
@@ -207,12 +212,15 @@
   inline int fill_size() const;
   inline void clear_fill();
   static const int kFillFieldNumber = 1;
-  inline const ::google::protobuf::RepeatedPtrField< ::TradeData::Fill >& fill() const;
-  inline ::google::protobuf::RepeatedPtrField< ::TradeData::Fill >* mutable_fill();
   inline const ::TradeData::Fill& fill(int index) const;
   inline ::TradeData::Fill* mutable_fill(int index);
   inline ::TradeData::Fill* add_fill();
+  inline const ::google::protobuf::RepeatedPtrField< ::TradeData::Fill >&
+      fill() const;
+  inline ::google::protobuf::RepeatedPtrField< ::TradeData::Fill >*
+      mutable_fill();
   
+  // @@protoc_insertion_point(class_scope:TradeData.Trades)
  private:
   ::google::protobuf::UnknownFieldSet _unknown_fields_;
   mutable int _cached_size_;
@@ -243,9 +251,6 @@
 
 // ===================================================================
 
-
-// ===================================================================
-
 // Fill
 
 // required double timestamp = 1;
@@ -349,14 +354,6 @@
 inline void Trades::clear_fill() {
   fill_.Clear();
 }
-inline const ::google::protobuf::RepeatedPtrField< ::TradeData::Fill >&
-Trades::fill() const {
-  return fill_;
-}
-inline ::google::protobuf::RepeatedPtrField< ::TradeData::Fill >*
-Trades::mutable_fill() {
-  return &fill_;
-}
 inline const ::TradeData::Fill& Trades::fill(int index) const {
   return fill_.Get(index);
 }
@@ -366,8 +363,18 @@
 inline ::TradeData::Fill* Trades::add_fill() {
   return fill_.Add();
 }
+inline const ::google::protobuf::RepeatedPtrField< ::TradeData::Fill >&
+Trades::fill() const {
+  return fill_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::TradeData::Fill >*
+Trades::mutable_fill() {
+  return &fill_;
+}
 
 
+// @@protoc_insertion_point(namespace_scope)
+
 }  // namespace TradeData
 
 #ifndef SWIG
@@ -379,4 +386,6 @@
 }  // namespace protobuf
 #endif  // SWIG
 
+// @@protoc_insertion_point(global_scope)
+
 #endif  // PROTOBUF_TradeData_2eproto__INCLUDED

Modified: pkg/inst/unitTests/runTests.R
===================================================================
--- pkg/inst/unitTests/runTests.R	2010-07-29 01:34:46 UTC (rev 354)
+++ pkg/inst/unitTests/runTests.R	2010-07-30 07:50:40 UTC (rev 355)
@@ -52,6 +52,3 @@
     "for package", pkg,"\n")
 }
 
-
-################################################################################
-

Modified: pkg/src/wrapper_Descriptor.cpp
===================================================================
--- pkg/src/wrapper_Descriptor.cpp	2010-07-29 01:34:46 UTC (rev 354)
+++ pkg/src/wrapper_Descriptor.cpp	2010-07-30 07:50:40 UTC (rev 355)
@@ -45,7 +45,7 @@
  * @param xp external pointer to a Descriptor
  * @return the descriptor as an R list
  */
-RCPP_FUNCTION_1( Rcpp::List, METHOD(as_lis), Rcpp::XPtr<GPB::Descriptor> desc ){
+RCPP_FUNCTION_1( Rcpp::List, METHOD(as_list), Rcpp::XPtr<GPB::Descriptor> desc ){
 	
 	int nfields = desc->field_count() ;
 	int ntypes  = desc->nested_type_count() ;



More information about the Rprotobuf-commits mailing list