You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2013/07/12 22:26:39 UTC

[1/3] Added a JSON::Protobuf for constructing JSON::Objects from protobufs.

Updated Branches:
  refs/heads/master fec1a180c -> d2484213d


http://git-wip-us.apache.org/repos/asf/mesos/blob/d33efc97/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.pb.h
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.pb.h b/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.pb.h
new file mode 100644
index 0000000..aef5b29
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.pb.h
@@ -0,0 +1,1340 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: protobuf_tests.proto
+
+#ifndef PROTOBUF_protobuf_5ftests_2eproto__INCLUDED
+#define PROTOBUF_protobuf_5ftests_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 2004000
+#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 2004001 < 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.
+#endif
+
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/generated_message_reflection.h>
+// @@protoc_insertion_point(includes)
+
+namespace tests {
+
+// Internal implementation detail -- do not call these.
+void  protobuf_AddDesc_protobuf_5ftests_2eproto();
+void protobuf_AssignDesc_protobuf_5ftests_2eproto();
+void protobuf_ShutdownFile_protobuf_5ftests_2eproto();
+
+class Nested;
+class Message;
+
+enum Enum {
+  ONE = 1,
+  TWO = 2
+};
+bool Enum_IsValid(int value);
+const Enum Enum_MIN = ONE;
+const Enum Enum_MAX = TWO;
+const int Enum_ARRAYSIZE = Enum_MAX + 1;
+
+const ::google::protobuf::EnumDescriptor* Enum_descriptor();
+inline const ::std::string& Enum_Name(Enum value) {
+  return ::google::protobuf::internal::NameOfEnum(
+    Enum_descriptor(), value);
+}
+inline bool Enum_Parse(
+    const ::std::string& name, Enum* value) {
+  return ::google::protobuf::internal::ParseNamedEnum<Enum>(
+    Enum_descriptor(), name, value);
+}
+// ===================================================================
+
+class Nested : public ::google::protobuf::Message {
+ public:
+  Nested();
+  virtual ~Nested();
+  
+  Nested(const Nested& from);
+  
+  inline Nested& operator=(const Nested& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  
+  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
+    return _unknown_fields_;
+  }
+  
+  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+  
+  static const ::google::protobuf::Descriptor* descriptor();
+  static const Nested& default_instance();
+  
+  void Swap(Nested* other);
+  
+  // implements Message ----------------------------------------------
+  
+  Nested* New() const;
+  void CopyFrom(const ::google::protobuf::Message& from);
+  void MergeFrom(const ::google::protobuf::Message& from);
+  void CopyFrom(const Nested& from);
+  void MergeFrom(const Nested& from);
+  void Clear();
+  bool IsInitialized() const;
+  
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  
+  ::google::protobuf::Metadata GetMetadata() const;
+  
+  // nested types ----------------------------------------------------
+  
+  // accessors -------------------------------------------------------
+  
+  // optional string str = 1;
+  inline bool has_str() const;
+  inline void clear_str();
+  static const int kStrFieldNumber = 1;
+  inline const ::std::string& str() const;
+  inline void set_str(const ::std::string& value);
+  inline void set_str(const char* value);
+  inline void set_str(const char* value, size_t size);
+  inline ::std::string* mutable_str();
+  inline ::std::string* release_str();
+  
+  // @@protoc_insertion_point(class_scope:tests.Nested)
+ private:
+  inline void set_has_str();
+  inline void clear_has_str();
+  
+  ::google::protobuf::UnknownFieldSet _unknown_fields_;
+  
+  ::std::string* str_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_protobuf_5ftests_2eproto();
+  friend void protobuf_AssignDesc_protobuf_5ftests_2eproto();
+  friend void protobuf_ShutdownFile_protobuf_5ftests_2eproto();
+  
+  void InitAsDefaultInstance();
+  static Nested* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class Message : public ::google::protobuf::Message {
+ public:
+  Message();
+  virtual ~Message();
+  
+  Message(const Message& from);
+  
+  inline Message& operator=(const Message& from) {
+    CopyFrom(from);
+    return *this;
+  }
+  
+  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
+    return _unknown_fields_;
+  }
+  
+  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+  
+  static const ::google::protobuf::Descriptor* descriptor();
+  static const Message& default_instance();
+  
+  void Swap(Message* other);
+  
+  // implements Message ----------------------------------------------
+  
+  Message* New() const;
+  void CopyFrom(const ::google::protobuf::Message& from);
+  void MergeFrom(const ::google::protobuf::Message& from);
+  void CopyFrom(const Message& from);
+  void MergeFrom(const Message& from);
+  void Clear();
+  bool IsInitialized() const;
+  
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  
+  ::google::protobuf::Metadata GetMetadata() const;
+  
+  // nested types ----------------------------------------------------
+  
+  // accessors -------------------------------------------------------
+  
+  // required string str = 1;
+  inline bool has_str() const;
+  inline void clear_str();
+  static const int kStrFieldNumber = 1;
+  inline const ::std::string& str() const;
+  inline void set_str(const ::std::string& value);
+  inline void set_str(const char* value);
+  inline void set_str(const char* value, size_t size);
+  inline ::std::string* mutable_str();
+  inline ::std::string* release_str();
+  
+  // required bytes bytes = 2;
+  inline bool has_bytes() const;
+  inline void clear_bytes();
+  static const int kBytesFieldNumber = 2;
+  inline const ::std::string& bytes() const;
+  inline void set_bytes(const ::std::string& value);
+  inline void set_bytes(const char* value);
+  inline void set_bytes(const void* value, size_t size);
+  inline ::std::string* mutable_bytes();
+  inline ::std::string* release_bytes();
+  
+  // optional int32 int32 = 3;
+  inline bool has_int32() const;
+  inline void clear_int32();
+  static const int kInt32FieldNumber = 3;
+  inline ::google::protobuf::int32 int32() const;
+  inline void set_int32(::google::protobuf::int32 value);
+  
+  // optional int64 int64 = 4;
+  inline bool has_int64() const;
+  inline void clear_int64();
+  static const int kInt64FieldNumber = 4;
+  inline ::google::protobuf::int64 int64() const;
+  inline void set_int64(::google::protobuf::int64 value);
+  
+  // optional uint32 uint32 = 5;
+  inline bool has_uint32() const;
+  inline void clear_uint32();
+  static const int kUint32FieldNumber = 5;
+  inline ::google::protobuf::uint32 uint32() const;
+  inline void set_uint32(::google::protobuf::uint32 value);
+  
+  // optional uint64 uint64 = 6;
+  inline bool has_uint64() const;
+  inline void clear_uint64();
+  static const int kUint64FieldNumber = 6;
+  inline ::google::protobuf::uint64 uint64() const;
+  inline void set_uint64(::google::protobuf::uint64 value);
+  
+  // optional sint32 sint32 = 7;
+  inline bool has_sint32() const;
+  inline void clear_sint32();
+  static const int kSint32FieldNumber = 7;
+  inline ::google::protobuf::int32 sint32() const;
+  inline void set_sint32(::google::protobuf::int32 value);
+  
+  // optional sint64 sint64 = 8;
+  inline bool has_sint64() const;
+  inline void clear_sint64();
+  static const int kSint64FieldNumber = 8;
+  inline ::google::protobuf::int64 sint64() const;
+  inline void set_sint64(::google::protobuf::int64 value);
+  
+  // required float f = 9;
+  inline bool has_f() const;
+  inline void clear_f();
+  static const int kFFieldNumber = 9;
+  inline float f() const;
+  inline void set_f(float value);
+  
+  // required double d = 10;
+  inline bool has_d() const;
+  inline void clear_d();
+  static const int kDFieldNumber = 10;
+  inline double d() const;
+  inline void set_d(double value);
+  
+  // required .tests.Enum e = 11;
+  inline bool has_e() const;
+  inline void clear_e();
+  static const int kEFieldNumber = 11;
+  inline tests::Enum e() const;
+  inline void set_e(tests::Enum value);
+  
+  // required .tests.Nested nested = 12;
+  inline bool has_nested() const;
+  inline void clear_nested();
+  static const int kNestedFieldNumber = 12;
+  inline const ::tests::Nested& nested() const;
+  inline ::tests::Nested* mutable_nested();
+  inline ::tests::Nested* release_nested();
+  
+  // repeated string repeated_string = 13;
+  inline int repeated_string_size() const;
+  inline void clear_repeated_string();
+  static const int kRepeatedStringFieldNumber = 13;
+  inline const ::std::string& repeated_string(int index) const;
+  inline ::std::string* mutable_repeated_string(int index);
+  inline void set_repeated_string(int index, const ::std::string& value);
+  inline void set_repeated_string(int index, const char* value);
+  inline void set_repeated_string(int index, const char* value, size_t size);
+  inline ::std::string* add_repeated_string();
+  inline void add_repeated_string(const ::std::string& value);
+  inline void add_repeated_string(const char* value);
+  inline void add_repeated_string(const char* value, size_t size);
+  inline const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_string() const;
+  inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_string();
+  
+  // repeated bytes repeated_bytes = 14;
+  inline int repeated_bytes_size() const;
+  inline void clear_repeated_bytes();
+  static const int kRepeatedBytesFieldNumber = 14;
+  inline const ::std::string& repeated_bytes(int index) const;
+  inline ::std::string* mutable_repeated_bytes(int index);
+  inline void set_repeated_bytes(int index, const ::std::string& value);
+  inline void set_repeated_bytes(int index, const char* value);
+  inline void set_repeated_bytes(int index, const void* value, size_t size);
+  inline ::std::string* add_repeated_bytes();
+  inline void add_repeated_bytes(const ::std::string& value);
+  inline void add_repeated_bytes(const char* value);
+  inline void add_repeated_bytes(const void* value, size_t size);
+  inline const ::google::protobuf::RepeatedPtrField< ::std::string>& repeated_bytes() const;
+  inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_repeated_bytes();
+  
+  // repeated int32 repeated_int32 = 15;
+  inline int repeated_int32_size() const;
+  inline void clear_repeated_int32();
+  static const int kRepeatedInt32FieldNumber = 15;
+  inline ::google::protobuf::int32 repeated_int32(int index) const;
+  inline void set_repeated_int32(int index, ::google::protobuf::int32 value);
+  inline void add_repeated_int32(::google::protobuf::int32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+      repeated_int32() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+      mutable_repeated_int32();
+  
+  // repeated int64 repeated_int64 = 16;
+  inline int repeated_int64_size() const;
+  inline void clear_repeated_int64();
+  static const int kRepeatedInt64FieldNumber = 16;
+  inline ::google::protobuf::int64 repeated_int64(int index) const;
+  inline void set_repeated_int64(int index, ::google::protobuf::int64 value);
+  inline void add_repeated_int64(::google::protobuf::int64 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+      repeated_int64() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+      mutable_repeated_int64();
+  
+  // repeated uint32 repeated_uint32 = 17;
+  inline int repeated_uint32_size() const;
+  inline void clear_repeated_uint32();
+  static const int kRepeatedUint32FieldNumber = 17;
+  inline ::google::protobuf::uint32 repeated_uint32(int index) const;
+  inline void set_repeated_uint32(int index, ::google::protobuf::uint32 value);
+  inline void add_repeated_uint32(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      repeated_uint32() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_repeated_uint32();
+  
+  // repeated uint64 repeated_uint64 = 18;
+  inline int repeated_uint64_size() const;
+  inline void clear_repeated_uint64();
+  static const int kRepeatedUint64FieldNumber = 18;
+  inline ::google::protobuf::uint64 repeated_uint64(int index) const;
+  inline void set_repeated_uint64(int index, ::google::protobuf::uint64 value);
+  inline void add_repeated_uint64(::google::protobuf::uint64 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
+      repeated_uint64() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
+      mutable_repeated_uint64();
+  
+  // repeated sint32 repeated_sint32 = 19;
+  inline int repeated_sint32_size() const;
+  inline void clear_repeated_sint32();
+  static const int kRepeatedSint32FieldNumber = 19;
+  inline ::google::protobuf::int32 repeated_sint32(int index) const;
+  inline void set_repeated_sint32(int index, ::google::protobuf::int32 value);
+  inline void add_repeated_sint32(::google::protobuf::int32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+      repeated_sint32() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+      mutable_repeated_sint32();
+  
+  // repeated sint64 repeated_sint64 = 20;
+  inline int repeated_sint64_size() const;
+  inline void clear_repeated_sint64();
+  static const int kRepeatedSint64FieldNumber = 20;
+  inline ::google::protobuf::int64 repeated_sint64(int index) const;
+  inline void set_repeated_sint64(int index, ::google::protobuf::int64 value);
+  inline void add_repeated_sint64(::google::protobuf::int64 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+      repeated_sint64() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+      mutable_repeated_sint64();
+  
+  // repeated float repeated_float = 21;
+  inline int repeated_float_size() const;
+  inline void clear_repeated_float();
+  static const int kRepeatedFloatFieldNumber = 21;
+  inline float repeated_float(int index) const;
+  inline void set_repeated_float(int index, float value);
+  inline void add_repeated_float(float value);
+  inline const ::google::protobuf::RepeatedField< float >&
+      repeated_float() const;
+  inline ::google::protobuf::RepeatedField< float >*
+      mutable_repeated_float();
+  
+  // repeated double repeated_double = 22;
+  inline int repeated_double_size() const;
+  inline void clear_repeated_double();
+  static const int kRepeatedDoubleFieldNumber = 22;
+  inline double repeated_double(int index) const;
+  inline void set_repeated_double(int index, double value);
+  inline void add_repeated_double(double value);
+  inline const ::google::protobuf::RepeatedField< double >&
+      repeated_double() const;
+  inline ::google::protobuf::RepeatedField< double >*
+      mutable_repeated_double();
+  
+  // repeated .tests.Enum repeated_enum = 23;
+  inline int repeated_enum_size() const;
+  inline void clear_repeated_enum();
+  static const int kRepeatedEnumFieldNumber = 23;
+  inline tests::Enum repeated_enum(int index) const;
+  inline void set_repeated_enum(int index, tests::Enum value);
+  inline void add_repeated_enum(tests::Enum value);
+  inline const ::google::protobuf::RepeatedField<int>& repeated_enum() const;
+  inline ::google::protobuf::RepeatedField<int>* mutable_repeated_enum();
+  
+  // repeated .tests.Nested repeated_nested = 24;
+  inline int repeated_nested_size() const;
+  inline void clear_repeated_nested();
+  static const int kRepeatedNestedFieldNumber = 24;
+  inline const ::tests::Nested& repeated_nested(int index) const;
+  inline ::tests::Nested* mutable_repeated_nested(int index);
+  inline ::tests::Nested* add_repeated_nested();
+  inline const ::google::protobuf::RepeatedPtrField< ::tests::Nested >&
+      repeated_nested() const;
+  inline ::google::protobuf::RepeatedPtrField< ::tests::Nested >*
+      mutable_repeated_nested();
+  
+  // repeated string empty = 25;
+  inline int empty_size() const;
+  inline void clear_empty();
+  static const int kEmptyFieldNumber = 25;
+  inline const ::std::string& empty(int index) const;
+  inline ::std::string* mutable_empty(int index);
+  inline void set_empty(int index, const ::std::string& value);
+  inline void set_empty(int index, const char* value);
+  inline void set_empty(int index, const char* value, size_t size);
+  inline ::std::string* add_empty();
+  inline void add_empty(const ::std::string& value);
+  inline void add_empty(const char* value);
+  inline void add_empty(const char* value, size_t size);
+  inline const ::google::protobuf::RepeatedPtrField< ::std::string>& empty() const;
+  inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_empty();
+  
+  // @@protoc_insertion_point(class_scope:tests.Message)
+ private:
+  inline void set_has_str();
+  inline void clear_has_str();
+  inline void set_has_bytes();
+  inline void clear_has_bytes();
+  inline void set_has_int32();
+  inline void clear_has_int32();
+  inline void set_has_int64();
+  inline void clear_has_int64();
+  inline void set_has_uint32();
+  inline void clear_has_uint32();
+  inline void set_has_uint64();
+  inline void clear_has_uint64();
+  inline void set_has_sint32();
+  inline void clear_has_sint32();
+  inline void set_has_sint64();
+  inline void clear_has_sint64();
+  inline void set_has_f();
+  inline void clear_has_f();
+  inline void set_has_d();
+  inline void clear_has_d();
+  inline void set_has_e();
+  inline void clear_has_e();
+  inline void set_has_nested();
+  inline void clear_has_nested();
+  
+  ::google::protobuf::UnknownFieldSet _unknown_fields_;
+  
+  ::std::string* str_;
+  ::std::string* bytes_;
+  ::google::protobuf::int64 int64_;
+  ::google::protobuf::int32 int32_;
+  ::google::protobuf::uint32 uint32_;
+  ::google::protobuf::uint64 uint64_;
+  ::google::protobuf::int64 sint64_;
+  ::google::protobuf::int32 sint32_;
+  float f_;
+  double d_;
+  ::tests::Nested* nested_;
+  ::google::protobuf::RepeatedPtrField< ::std::string> repeated_string_;
+  ::google::protobuf::RepeatedPtrField< ::std::string> repeated_bytes_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_int32_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_int64_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > repeated_uint32_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint64 > repeated_uint64_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::int32 > repeated_sint32_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::int64 > repeated_sint64_;
+  ::google::protobuf::RepeatedField< float > repeated_float_;
+  ::google::protobuf::RepeatedField< double > repeated_double_;
+  ::google::protobuf::RepeatedField<int> repeated_enum_;
+  ::google::protobuf::RepeatedPtrField< ::tests::Nested > repeated_nested_;
+  ::google::protobuf::RepeatedPtrField< ::std::string> empty_;
+  int e_;
+  
+  mutable int _cached_size_;
+  ::google::protobuf::uint32 _has_bits_[(25 + 31) / 32];
+  
+  friend void  protobuf_AddDesc_protobuf_5ftests_2eproto();
+  friend void protobuf_AssignDesc_protobuf_5ftests_2eproto();
+  friend void protobuf_ShutdownFile_protobuf_5ftests_2eproto();
+  
+  void InitAsDefaultInstance();
+  static Message* default_instance_;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+// Nested
+
+// optional string str = 1;
+inline bool Nested::has_str() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Nested::set_has_str() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Nested::clear_has_str() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Nested::clear_str() {
+  if (str_ != &::google::protobuf::internal::kEmptyString) {
+    str_->clear();
+  }
+  clear_has_str();
+}
+inline const ::std::string& Nested::str() const {
+  return *str_;
+}
+inline void Nested::set_str(const ::std::string& value) {
+  set_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    str_ = new ::std::string;
+  }
+  str_->assign(value);
+}
+inline void Nested::set_str(const char* value) {
+  set_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    str_ = new ::std::string;
+  }
+  str_->assign(value);
+}
+inline void Nested::set_str(const char* value, size_t size) {
+  set_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    str_ = new ::std::string;
+  }
+  str_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* Nested::mutable_str() {
+  set_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    str_ = new ::std::string;
+  }
+  return str_;
+}
+inline ::std::string* Nested::release_str() {
+  clear_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = str_;
+    str_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// -------------------------------------------------------------------
+
+// Message
+
+// required string str = 1;
+inline bool Message::has_str() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void Message::set_has_str() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void Message::clear_has_str() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void Message::clear_str() {
+  if (str_ != &::google::protobuf::internal::kEmptyString) {
+    str_->clear();
+  }
+  clear_has_str();
+}
+inline const ::std::string& Message::str() const {
+  return *str_;
+}
+inline void Message::set_str(const ::std::string& value) {
+  set_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    str_ = new ::std::string;
+  }
+  str_->assign(value);
+}
+inline void Message::set_str(const char* value) {
+  set_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    str_ = new ::std::string;
+  }
+  str_->assign(value);
+}
+inline void Message::set_str(const char* value, size_t size) {
+  set_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    str_ = new ::std::string;
+  }
+  str_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* Message::mutable_str() {
+  set_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    str_ = new ::std::string;
+  }
+  return str_;
+}
+inline ::std::string* Message::release_str() {
+  clear_has_str();
+  if (str_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = str_;
+    str_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// required bytes bytes = 2;
+inline bool Message::has_bytes() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void Message::set_has_bytes() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void Message::clear_has_bytes() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void Message::clear_bytes() {
+  if (bytes_ != &::google::protobuf::internal::kEmptyString) {
+    bytes_->clear();
+  }
+  clear_has_bytes();
+}
+inline const ::std::string& Message::bytes() const {
+  return *bytes_;
+}
+inline void Message::set_bytes(const ::std::string& value) {
+  set_has_bytes();
+  if (bytes_ == &::google::protobuf::internal::kEmptyString) {
+    bytes_ = new ::std::string;
+  }
+  bytes_->assign(value);
+}
+inline void Message::set_bytes(const char* value) {
+  set_has_bytes();
+  if (bytes_ == &::google::protobuf::internal::kEmptyString) {
+    bytes_ = new ::std::string;
+  }
+  bytes_->assign(value);
+}
+inline void Message::set_bytes(const void* value, size_t size) {
+  set_has_bytes();
+  if (bytes_ == &::google::protobuf::internal::kEmptyString) {
+    bytes_ = new ::std::string;
+  }
+  bytes_->assign(reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* Message::mutable_bytes() {
+  set_has_bytes();
+  if (bytes_ == &::google::protobuf::internal::kEmptyString) {
+    bytes_ = new ::std::string;
+  }
+  return bytes_;
+}
+inline ::std::string* Message::release_bytes() {
+  clear_has_bytes();
+  if (bytes_ == &::google::protobuf::internal::kEmptyString) {
+    return NULL;
+  } else {
+    ::std::string* temp = bytes_;
+    bytes_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+    return temp;
+  }
+}
+
+// optional int32 int32 = 3;
+inline bool Message::has_int32() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void Message::set_has_int32() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void Message::clear_has_int32() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void Message::clear_int32() {
+  int32_ = 0;
+  clear_has_int32();
+}
+inline ::google::protobuf::int32 Message::int32() const {
+  return int32_;
+}
+inline void Message::set_int32(::google::protobuf::int32 value) {
+  set_has_int32();
+  int32_ = value;
+}
+
+// optional int64 int64 = 4;
+inline bool Message::has_int64() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void Message::set_has_int64() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void Message::clear_has_int64() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void Message::clear_int64() {
+  int64_ = GOOGLE_LONGLONG(0);
+  clear_has_int64();
+}
+inline ::google::protobuf::int64 Message::int64() const {
+  return int64_;
+}
+inline void Message::set_int64(::google::protobuf::int64 value) {
+  set_has_int64();
+  int64_ = value;
+}
+
+// optional uint32 uint32 = 5;
+inline bool Message::has_uint32() const {
+  return (_has_bits_[0] & 0x00000010u) != 0;
+}
+inline void Message::set_has_uint32() {
+  _has_bits_[0] |= 0x00000010u;
+}
+inline void Message::clear_has_uint32() {
+  _has_bits_[0] &= ~0x00000010u;
+}
+inline void Message::clear_uint32() {
+  uint32_ = 0u;
+  clear_has_uint32();
+}
+inline ::google::protobuf::uint32 Message::uint32() const {
+  return uint32_;
+}
+inline void Message::set_uint32(::google::protobuf::uint32 value) {
+  set_has_uint32();
+  uint32_ = value;
+}
+
+// optional uint64 uint64 = 6;
+inline bool Message::has_uint64() const {
+  return (_has_bits_[0] & 0x00000020u) != 0;
+}
+inline void Message::set_has_uint64() {
+  _has_bits_[0] |= 0x00000020u;
+}
+inline void Message::clear_has_uint64() {
+  _has_bits_[0] &= ~0x00000020u;
+}
+inline void Message::clear_uint64() {
+  uint64_ = GOOGLE_ULONGLONG(0);
+  clear_has_uint64();
+}
+inline ::google::protobuf::uint64 Message::uint64() const {
+  return uint64_;
+}
+inline void Message::set_uint64(::google::protobuf::uint64 value) {
+  set_has_uint64();
+  uint64_ = value;
+}
+
+// optional sint32 sint32 = 7;
+inline bool Message::has_sint32() const {
+  return (_has_bits_[0] & 0x00000040u) != 0;
+}
+inline void Message::set_has_sint32() {
+  _has_bits_[0] |= 0x00000040u;
+}
+inline void Message::clear_has_sint32() {
+  _has_bits_[0] &= ~0x00000040u;
+}
+inline void Message::clear_sint32() {
+  sint32_ = 0;
+  clear_has_sint32();
+}
+inline ::google::protobuf::int32 Message::sint32() const {
+  return sint32_;
+}
+inline void Message::set_sint32(::google::protobuf::int32 value) {
+  set_has_sint32();
+  sint32_ = value;
+}
+
+// optional sint64 sint64 = 8;
+inline bool Message::has_sint64() const {
+  return (_has_bits_[0] & 0x00000080u) != 0;
+}
+inline void Message::set_has_sint64() {
+  _has_bits_[0] |= 0x00000080u;
+}
+inline void Message::clear_has_sint64() {
+  _has_bits_[0] &= ~0x00000080u;
+}
+inline void Message::clear_sint64() {
+  sint64_ = GOOGLE_LONGLONG(0);
+  clear_has_sint64();
+}
+inline ::google::protobuf::int64 Message::sint64() const {
+  return sint64_;
+}
+inline void Message::set_sint64(::google::protobuf::int64 value) {
+  set_has_sint64();
+  sint64_ = value;
+}
+
+// required float f = 9;
+inline bool Message::has_f() const {
+  return (_has_bits_[0] & 0x00000100u) != 0;
+}
+inline void Message::set_has_f() {
+  _has_bits_[0] |= 0x00000100u;
+}
+inline void Message::clear_has_f() {
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline void Message::clear_f() {
+  f_ = 0;
+  clear_has_f();
+}
+inline float Message::f() const {
+  return f_;
+}
+inline void Message::set_f(float value) {
+  set_has_f();
+  f_ = value;
+}
+
+// required double d = 10;
+inline bool Message::has_d() const {
+  return (_has_bits_[0] & 0x00000200u) != 0;
+}
+inline void Message::set_has_d() {
+  _has_bits_[0] |= 0x00000200u;
+}
+inline void Message::clear_has_d() {
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline void Message::clear_d() {
+  d_ = 0;
+  clear_has_d();
+}
+inline double Message::d() const {
+  return d_;
+}
+inline void Message::set_d(double value) {
+  set_has_d();
+  d_ = value;
+}
+
+// required .tests.Enum e = 11;
+inline bool Message::has_e() const {
+  return (_has_bits_[0] & 0x00000400u) != 0;
+}
+inline void Message::set_has_e() {
+  _has_bits_[0] |= 0x00000400u;
+}
+inline void Message::clear_has_e() {
+  _has_bits_[0] &= ~0x00000400u;
+}
+inline void Message::clear_e() {
+  e_ = 1;
+  clear_has_e();
+}
+inline tests::Enum Message::e() const {
+  return static_cast< tests::Enum >(e_);
+}
+inline void Message::set_e(tests::Enum value) {
+  GOOGLE_DCHECK(tests::Enum_IsValid(value));
+  set_has_e();
+  e_ = value;
+}
+
+// required .tests.Nested nested = 12;
+inline bool Message::has_nested() const {
+  return (_has_bits_[0] & 0x00000800u) != 0;
+}
+inline void Message::set_has_nested() {
+  _has_bits_[0] |= 0x00000800u;
+}
+inline void Message::clear_has_nested() {
+  _has_bits_[0] &= ~0x00000800u;
+}
+inline void Message::clear_nested() {
+  if (nested_ != NULL) nested_->::tests::Nested::Clear();
+  clear_has_nested();
+}
+inline const ::tests::Nested& Message::nested() const {
+  return nested_ != NULL ? *nested_ : *default_instance_->nested_;
+}
+inline ::tests::Nested* Message::mutable_nested() {
+  set_has_nested();
+  if (nested_ == NULL) nested_ = new ::tests::Nested;
+  return nested_;
+}
+inline ::tests::Nested* Message::release_nested() {
+  clear_has_nested();
+  ::tests::Nested* temp = nested_;
+  nested_ = NULL;
+  return temp;
+}
+
+// repeated string repeated_string = 13;
+inline int Message::repeated_string_size() const {
+  return repeated_string_.size();
+}
+inline void Message::clear_repeated_string() {
+  repeated_string_.Clear();
+}
+inline const ::std::string& Message::repeated_string(int index) const {
+  return repeated_string_.Get(index);
+}
+inline ::std::string* Message::mutable_repeated_string(int index) {
+  return repeated_string_.Mutable(index);
+}
+inline void Message::set_repeated_string(int index, const ::std::string& value) {
+  repeated_string_.Mutable(index)->assign(value);
+}
+inline void Message::set_repeated_string(int index, const char* value) {
+  repeated_string_.Mutable(index)->assign(value);
+}
+inline void Message::set_repeated_string(int index, const char* value, size_t size) {
+  repeated_string_.Mutable(index)->assign(
+    reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* Message::add_repeated_string() {
+  return repeated_string_.Add();
+}
+inline void Message::add_repeated_string(const ::std::string& value) {
+  repeated_string_.Add()->assign(value);
+}
+inline void Message::add_repeated_string(const char* value) {
+  repeated_string_.Add()->assign(value);
+}
+inline void Message::add_repeated_string(const char* value, size_t size) {
+  repeated_string_.Add()->assign(reinterpret_cast<const char*>(value), size);
+}
+inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+Message::repeated_string() const {
+  return repeated_string_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+Message::mutable_repeated_string() {
+  return &repeated_string_;
+}
+
+// repeated bytes repeated_bytes = 14;
+inline int Message::repeated_bytes_size() const {
+  return repeated_bytes_.size();
+}
+inline void Message::clear_repeated_bytes() {
+  repeated_bytes_.Clear();
+}
+inline const ::std::string& Message::repeated_bytes(int index) const {
+  return repeated_bytes_.Get(index);
+}
+inline ::std::string* Message::mutable_repeated_bytes(int index) {
+  return repeated_bytes_.Mutable(index);
+}
+inline void Message::set_repeated_bytes(int index, const ::std::string& value) {
+  repeated_bytes_.Mutable(index)->assign(value);
+}
+inline void Message::set_repeated_bytes(int index, const char* value) {
+  repeated_bytes_.Mutable(index)->assign(value);
+}
+inline void Message::set_repeated_bytes(int index, const void* value, size_t size) {
+  repeated_bytes_.Mutable(index)->assign(
+    reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* Message::add_repeated_bytes() {
+  return repeated_bytes_.Add();
+}
+inline void Message::add_repeated_bytes(const ::std::string& value) {
+  repeated_bytes_.Add()->assign(value);
+}
+inline void Message::add_repeated_bytes(const char* value) {
+  repeated_bytes_.Add()->assign(value);
+}
+inline void Message::add_repeated_bytes(const void* value, size_t size) {
+  repeated_bytes_.Add()->assign(reinterpret_cast<const char*>(value), size);
+}
+inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+Message::repeated_bytes() const {
+  return repeated_bytes_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+Message::mutable_repeated_bytes() {
+  return &repeated_bytes_;
+}
+
+// repeated int32 repeated_int32 = 15;
+inline int Message::repeated_int32_size() const {
+  return repeated_int32_.size();
+}
+inline void Message::clear_repeated_int32() {
+  repeated_int32_.Clear();
+}
+inline ::google::protobuf::int32 Message::repeated_int32(int index) const {
+  return repeated_int32_.Get(index);
+}
+inline void Message::set_repeated_int32(int index, ::google::protobuf::int32 value) {
+  repeated_int32_.Set(index, value);
+}
+inline void Message::add_repeated_int32(::google::protobuf::int32 value) {
+  repeated_int32_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+Message::repeated_int32() const {
+  return repeated_int32_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+Message::mutable_repeated_int32() {
+  return &repeated_int32_;
+}
+
+// repeated int64 repeated_int64 = 16;
+inline int Message::repeated_int64_size() const {
+  return repeated_int64_.size();
+}
+inline void Message::clear_repeated_int64() {
+  repeated_int64_.Clear();
+}
+inline ::google::protobuf::int64 Message::repeated_int64(int index) const {
+  return repeated_int64_.Get(index);
+}
+inline void Message::set_repeated_int64(int index, ::google::protobuf::int64 value) {
+  repeated_int64_.Set(index, value);
+}
+inline void Message::add_repeated_int64(::google::protobuf::int64 value) {
+  repeated_int64_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+Message::repeated_int64() const {
+  return repeated_int64_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+Message::mutable_repeated_int64() {
+  return &repeated_int64_;
+}
+
+// repeated uint32 repeated_uint32 = 17;
+inline int Message::repeated_uint32_size() const {
+  return repeated_uint32_.size();
+}
+inline void Message::clear_repeated_uint32() {
+  repeated_uint32_.Clear();
+}
+inline ::google::protobuf::uint32 Message::repeated_uint32(int index) const {
+  return repeated_uint32_.Get(index);
+}
+inline void Message::set_repeated_uint32(int index, ::google::protobuf::uint32 value) {
+  repeated_uint32_.Set(index, value);
+}
+inline void Message::add_repeated_uint32(::google::protobuf::uint32 value) {
+  repeated_uint32_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+Message::repeated_uint32() const {
+  return repeated_uint32_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+Message::mutable_repeated_uint32() {
+  return &repeated_uint32_;
+}
+
+// repeated uint64 repeated_uint64 = 18;
+inline int Message::repeated_uint64_size() const {
+  return repeated_uint64_.size();
+}
+inline void Message::clear_repeated_uint64() {
+  repeated_uint64_.Clear();
+}
+inline ::google::protobuf::uint64 Message::repeated_uint64(int index) const {
+  return repeated_uint64_.Get(index);
+}
+inline void Message::set_repeated_uint64(int index, ::google::protobuf::uint64 value) {
+  repeated_uint64_.Set(index, value);
+}
+inline void Message::add_repeated_uint64(::google::protobuf::uint64 value) {
+  repeated_uint64_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
+Message::repeated_uint64() const {
+  return repeated_uint64_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
+Message::mutable_repeated_uint64() {
+  return &repeated_uint64_;
+}
+
+// repeated sint32 repeated_sint32 = 19;
+inline int Message::repeated_sint32_size() const {
+  return repeated_sint32_.size();
+}
+inline void Message::clear_repeated_sint32() {
+  repeated_sint32_.Clear();
+}
+inline ::google::protobuf::int32 Message::repeated_sint32(int index) const {
+  return repeated_sint32_.Get(index);
+}
+inline void Message::set_repeated_sint32(int index, ::google::protobuf::int32 value) {
+  repeated_sint32_.Set(index, value);
+}
+inline void Message::add_repeated_sint32(::google::protobuf::int32 value) {
+  repeated_sint32_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
+Message::repeated_sint32() const {
+  return repeated_sint32_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
+Message::mutable_repeated_sint32() {
+  return &repeated_sint32_;
+}
+
+// repeated sint64 repeated_sint64 = 20;
+inline int Message::repeated_sint64_size() const {
+  return repeated_sint64_.size();
+}
+inline void Message::clear_repeated_sint64() {
+  repeated_sint64_.Clear();
+}
+inline ::google::protobuf::int64 Message::repeated_sint64(int index) const {
+  return repeated_sint64_.Get(index);
+}
+inline void Message::set_repeated_sint64(int index, ::google::protobuf::int64 value) {
+  repeated_sint64_.Set(index, value);
+}
+inline void Message::add_repeated_sint64(::google::protobuf::int64 value) {
+  repeated_sint64_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
+Message::repeated_sint64() const {
+  return repeated_sint64_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
+Message::mutable_repeated_sint64() {
+  return &repeated_sint64_;
+}
+
+// repeated float repeated_float = 21;
+inline int Message::repeated_float_size() const {
+  return repeated_float_.size();
+}
+inline void Message::clear_repeated_float() {
+  repeated_float_.Clear();
+}
+inline float Message::repeated_float(int index) const {
+  return repeated_float_.Get(index);
+}
+inline void Message::set_repeated_float(int index, float value) {
+  repeated_float_.Set(index, value);
+}
+inline void Message::add_repeated_float(float value) {
+  repeated_float_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField< float >&
+Message::repeated_float() const {
+  return repeated_float_;
+}
+inline ::google::protobuf::RepeatedField< float >*
+Message::mutable_repeated_float() {
+  return &repeated_float_;
+}
+
+// repeated double repeated_double = 22;
+inline int Message::repeated_double_size() const {
+  return repeated_double_.size();
+}
+inline void Message::clear_repeated_double() {
+  repeated_double_.Clear();
+}
+inline double Message::repeated_double(int index) const {
+  return repeated_double_.Get(index);
+}
+inline void Message::set_repeated_double(int index, double value) {
+  repeated_double_.Set(index, value);
+}
+inline void Message::add_repeated_double(double value) {
+  repeated_double_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField< double >&
+Message::repeated_double() const {
+  return repeated_double_;
+}
+inline ::google::protobuf::RepeatedField< double >*
+Message::mutable_repeated_double() {
+  return &repeated_double_;
+}
+
+// repeated .tests.Enum repeated_enum = 23;
+inline int Message::repeated_enum_size() const {
+  return repeated_enum_.size();
+}
+inline void Message::clear_repeated_enum() {
+  repeated_enum_.Clear();
+}
+inline tests::Enum Message::repeated_enum(int index) const {
+  return static_cast< tests::Enum >(repeated_enum_.Get(index));
+}
+inline void Message::set_repeated_enum(int index, tests::Enum value) {
+  GOOGLE_DCHECK(tests::Enum_IsValid(value));
+  repeated_enum_.Set(index, value);
+}
+inline void Message::add_repeated_enum(tests::Enum value) {
+  GOOGLE_DCHECK(tests::Enum_IsValid(value));
+  repeated_enum_.Add(value);
+}
+inline const ::google::protobuf::RepeatedField<int>&
+Message::repeated_enum() const {
+  return repeated_enum_;
+}
+inline ::google::protobuf::RepeatedField<int>*
+Message::mutable_repeated_enum() {
+  return &repeated_enum_;
+}
+
+// repeated .tests.Nested repeated_nested = 24;
+inline int Message::repeated_nested_size() const {
+  return repeated_nested_.size();
+}
+inline void Message::clear_repeated_nested() {
+  repeated_nested_.Clear();
+}
+inline const ::tests::Nested& Message::repeated_nested(int index) const {
+  return repeated_nested_.Get(index);
+}
+inline ::tests::Nested* Message::mutable_repeated_nested(int index) {
+  return repeated_nested_.Mutable(index);
+}
+inline ::tests::Nested* Message::add_repeated_nested() {
+  return repeated_nested_.Add();
+}
+inline const ::google::protobuf::RepeatedPtrField< ::tests::Nested >&
+Message::repeated_nested() const {
+  return repeated_nested_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::tests::Nested >*
+Message::mutable_repeated_nested() {
+  return &repeated_nested_;
+}
+
+// repeated string empty = 25;
+inline int Message::empty_size() const {
+  return empty_.size();
+}
+inline void Message::clear_empty() {
+  empty_.Clear();
+}
+inline const ::std::string& Message::empty(int index) const {
+  return empty_.Get(index);
+}
+inline ::std::string* Message::mutable_empty(int index) {
+  return empty_.Mutable(index);
+}
+inline void Message::set_empty(int index, const ::std::string& value) {
+  empty_.Mutable(index)->assign(value);
+}
+inline void Message::set_empty(int index, const char* value) {
+  empty_.Mutable(index)->assign(value);
+}
+inline void Message::set_empty(int index, const char* value, size_t size) {
+  empty_.Mutable(index)->assign(
+    reinterpret_cast<const char*>(value), size);
+}
+inline ::std::string* Message::add_empty() {
+  return empty_.Add();
+}
+inline void Message::add_empty(const ::std::string& value) {
+  empty_.Add()->assign(value);
+}
+inline void Message::add_empty(const char* value) {
+  empty_.Add()->assign(value);
+}
+inline void Message::add_empty(const char* value, size_t size) {
+  empty_.Add()->assign(reinterpret_cast<const char*>(value), size);
+}
+inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
+Message::empty() const {
+  return empty_;
+}
+inline ::google::protobuf::RepeatedPtrField< ::std::string>*
+Message::mutable_empty() {
+  return &empty_;
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace tests
+
+#ifndef SWIG
+namespace google {
+namespace protobuf {
+
+template <>
+inline const EnumDescriptor* GetEnumDescriptor< tests::Enum>() {
+  return tests::Enum_descriptor();
+}
+
+}  // namespace google
+}  // namespace protobuf
+#endif  // SWIG
+
+// @@protoc_insertion_point(global_scope)
+
+#endif  // PROTOBUF_protobuf_5ftests_2eproto__INCLUDED

http://git-wip-us.apache.org/repos/asf/mesos/blob/d33efc97/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.proto
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.proto b/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.proto
new file mode 100644
index 0000000..146cc20
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.proto
@@ -0,0 +1,63 @@
+package tests;
+
+// NOTE: The generated headers for this file have been included
+// in the tests folder to simplify the build process (no need to
+// have protoc available to compile this file). As a result, if
+// there are any changes to this file, the headers must be
+// re-generated and committed alongside changes to this file.
+// There is a TODO in protobuf_tests.cpp that demonstrates how
+// to avoid the need for this file entirely by generating a
+// dynamic message at run-time.
+
+enum Enum {
+  ONE = 1;
+  TWO = 2;
+}
+
+
+message Nested {
+  optional string str = 1;
+}
+
+
+// An elaborate message for testing Proto->JSON conversion.
+message Message {
+  required string str = 1;
+
+  required bytes bytes = 2;
+
+  optional int32 int32 = 3;
+  optional int64 int64 = 4;
+  optional uint32 uint32 = 5;
+  optional uint64 uint64 = 6;
+  optional sint32 sint32 = 7;
+  optional sint64 sint64 = 8;
+
+  required float f = 9;
+  required double d = 10;
+
+  required Enum e = 11;
+
+  required Nested nested = 12;
+
+  repeated string repeated_string = 13;
+
+  repeated bytes repeated_bytes = 14;
+
+  repeated int32 repeated_int32 = 15;
+  repeated int64 repeated_int64 = 16;
+  repeated uint32 repeated_uint32 = 17;
+  repeated uint64 repeated_uint64 = 18;
+  repeated sint32 repeated_sint32 = 19;
+  repeated sint64 repeated_sint64 = 20;
+
+  repeated float repeated_float = 21;
+  repeated double repeated_double = 22;
+
+  repeated Enum repeated_enum = 23;
+
+  repeated Nested repeated_nested = 24;
+
+  repeated string empty = 25;
+}
+


[2/3] git commit: Added a JSON::Protobuf for constructing JSON::Objects from protobufs.

Posted by bm...@apache.org.
Added a JSON::Protobuf for constructing JSON::Objects from protobufs.

Review: https://reviews.apache.org/r/12473


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d33efc97
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d33efc97
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d33efc97

Branch: refs/heads/master
Commit: d33efc9734ae3edf67597feaca8ed9ef13b6ef5f
Parents: fec1a18
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Thu Jul 11 14:17:32 2013 -0700
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Fri Jul 12 13:23:20 2013 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/Makefile.am  |    4 +
 .../3rdparty/stout/include/stout/json.hpp       |    2 +-
 .../3rdparty/stout/include/stout/protobuf.hpp   |  149 +-
 .../3rdparty/stout/tests/protobuf_tests.cpp     |   95 +
 .../3rdparty/stout/tests/protobuf_tests.pb.cc   | 1692 ++++++++++++++++++
 .../3rdparty/stout/tests/protobuf_tests.pb.h    | 1340 ++++++++++++++
 .../3rdparty/stout/tests/protobuf_tests.proto   |   63 +
 7 files changed, 3343 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d33efc97/3rdparty/libprocess/3rdparty/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/Makefile.am b/3rdparty/libprocess/3rdparty/stout/Makefile.am
index 864b30e..2748584 100644
--- a/3rdparty/libprocess/3rdparty/stout/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/Makefile.am
@@ -66,6 +66,10 @@ EXTRA_DIST =					\
   tests/none_tests.cpp				\
   tests/os_tests.cpp				\
   tests/proc_tests.cpp				\
+  tests/protobuf_tests.cpp			\
+  tests/protobuf_tests.pb.cc			\
+  tests/protobuf_tests.pb.h			\
+  tests/protobuf_tests.proto			\
   tests/strings_tests.cpp			\
   tests/thread_tests.cpp			\
   tests/uuid_tests.cpp

http://git-wip-us.apache.org/repos/asf/mesos/blob/d33efc97/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
index e2cd4f2..e2ef0d3 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp
@@ -58,7 +58,7 @@ struct String
 
 struct Number
 {
-  Number() {}
+  Number() : value(0) {}
   Number(double _value) : value(_value) {}
   double value;
 };

http://git-wip-us.apache.org/repos/asf/mesos/blob/d33efc97/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp
index eb79e7b..bd5bc73 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp
@@ -1,6 +1,7 @@
 #ifndef __STOUT_PROTOBUF_HPP__
 #define __STOUT_PROTOBUF_HPP__
 
+#include <assert.h>
 #include <errno.h>
 #include <stdint.h>
 #include <unistd.h>
@@ -9,6 +10,7 @@
 
 #include <glog/logging.h>
 
+#include <google/protobuf/descriptor.h>
 #include <google/protobuf/message.h>
 
 #include <google/protobuf/io/zero_copy_stream_impl.h>
@@ -18,6 +20,7 @@
 #include <boost/lexical_cast.hpp>
 
 #include "error.hpp"
+#include "json.hpp"
 #include "none.hpp"
 #include "os.hpp"
 #include "result.hpp"
@@ -153,7 +156,151 @@ inline Result<T> read(const std::string& path)
   return result;
 }
 
-
 } // namespace protobuf {
 
+namespace JSON {
+
+struct Protobuf
+{
+  Protobuf(const google::protobuf::Message& message)
+  {
+    const google::protobuf::Reflection* reflection = message.GetReflection();
+    std::vector<const google::protobuf::FieldDescriptor*> fields;
+    reflection->ListFields(message, &fields);
+
+    foreach (const google::protobuf::FieldDescriptor* field, fields) {
+      if (field->is_repeated()) {
+        JSON::Array array;
+        for (int i = 0; i < reflection->FieldSize(message, field); ++i) {
+          switch (field->type()) {
+            case google::protobuf::FieldDescriptor::TYPE_DOUBLE:
+              array.values.push_back(JSON::Number(
+                  reflection->GetRepeatedDouble(message, field, i)));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_FLOAT:
+              array.values.push_back(JSON::Number(
+                  reflection->GetRepeatedFloat(message, field, i)));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_INT64:
+            case google::protobuf::FieldDescriptor::TYPE_SINT64:
+            case google::protobuf::FieldDescriptor::TYPE_SFIXED64:
+              array.values.push_back(JSON::Number(
+                  reflection->GetRepeatedInt64(message, field, i)));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_UINT64:
+            case google::protobuf::FieldDescriptor::TYPE_FIXED64:
+              array.values.push_back(JSON::Number(
+                  reflection->GetRepeatedUInt64(message, field, i)));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_INT32:
+            case google::protobuf::FieldDescriptor::TYPE_SINT32:
+            case google::protobuf::FieldDescriptor::TYPE_SFIXED32:
+              array.values.push_back(JSON::Number(
+                  reflection->GetRepeatedInt32(message, field, i)));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_UINT32:
+            case google::protobuf::FieldDescriptor::TYPE_FIXED32:
+              array.values.push_back(JSON::Number(
+                  reflection->GetRepeatedUInt32(message, field, i)));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_BOOL:
+              if (reflection->GetRepeatedBool(message, field, i)) {
+                array.values.push_back(JSON::True());
+              } else {
+                array.values.push_back(JSON::False());
+              }
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_STRING:
+            case google::protobuf::FieldDescriptor::TYPE_BYTES:
+              array.values.push_back(JSON::String(
+                  reflection->GetRepeatedString(message, field, i)));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_MESSAGE:
+              array.values.push_back(Protobuf(
+                  reflection->GetRepeatedMessage(message, field, i)));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_ENUM:
+              array.values.push_back(JSON::String(
+                  reflection->GetRepeatedEnum(message, field, i)->name()));
+              break;
+            case google::protobuf::FieldDescriptor::TYPE_GROUP:
+              // Deprecated!
+            default:
+              std::cerr << "Unhandled protobuf field type: " << field->type()
+                        << std::endl;
+              abort();
+          }
+        }
+        object.values[field->name()] = array;
+      } else {
+        switch (field->type()) {
+          case google::protobuf::FieldDescriptor::TYPE_DOUBLE:
+            object.values[field->name()] =
+                JSON::Number(reflection->GetDouble(message, field));
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_FLOAT:
+            object.values[field->name()] =
+                JSON::Number(reflection->GetFloat(message, field));
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_INT64:
+          case google::protobuf::FieldDescriptor::TYPE_SINT64:
+          case google::protobuf::FieldDescriptor::TYPE_SFIXED64:
+            object.values[field->name()] =
+                JSON::Number(reflection->GetInt64(message, field));
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_UINT64:
+          case google::protobuf::FieldDescriptor::TYPE_FIXED64:
+            object.values[field->name()] =
+                JSON::Number(reflection->GetUInt64(message, field));
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_INT32:
+          case google::protobuf::FieldDescriptor::TYPE_SINT32:
+          case google::protobuf::FieldDescriptor::TYPE_SFIXED32:
+            object.values[field->name()] =
+                JSON::Number(reflection->GetInt32(message, field));
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_UINT32:
+          case google::protobuf::FieldDescriptor::TYPE_FIXED32:
+            object.values[field->name()] =
+                JSON::Number(reflection->GetUInt32(message, field));
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_BOOL:
+            if (reflection->GetBool(message, field)) {
+              object.values[field->name()] = JSON::True();
+            } else {
+              object.values[field->name()] = JSON::False();
+            }
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_STRING:
+          case google::protobuf::FieldDescriptor::TYPE_BYTES:
+            object.values[field->name()] =
+                JSON::String(reflection->GetString(message, field));
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_MESSAGE:
+            object.values[field->name()] =
+                Protobuf(reflection->GetMessage(message, field));
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_ENUM:
+            object.values[field->name()] =
+                JSON::String(reflection->GetEnum(message, field)->name());
+            break;
+          case google::protobuf::FieldDescriptor::TYPE_GROUP:
+            // Deprecated!
+          default:
+            std::cerr << "Unhandled protobuf field type: " << field->type()
+                      << std::endl;
+            abort();
+        }
+      }
+    }
+  }
+
+  operator Object () const { return object; }
+
+private:
+  JSON::Object object;
+};
+
+} // namespace JSON {
+
 #endif // __STOUT_PROTOBUF_HPP__

http://git-wip-us.apache.org/repos/asf/mesos/blob/d33efc97/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.cpp
new file mode 100644
index 0000000..02bbf74
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.cpp
@@ -0,0 +1,95 @@
+#include <gtest/gtest.h>
+
+#include <gmock/gmock.h>
+
+#include <string>
+
+#include <stout/json.hpp>
+#include <stout/protobuf.hpp>
+#include <stout/stringify.hpp>
+#include <stout/strings.hpp>
+
+#include "protobuf_tests.pb.h"
+
+using std::string;
+
+TEST(ProtobufTest, JSON)
+{
+  tests::Message message;
+  message.set_str("string");
+  message.set_bytes("bytes");
+  message.set_int32(-1);
+  message.set_int64(-1);
+  message.set_uint32(1);
+  message.set_uint64(1);
+  message.set_sint32(-1);
+  message.set_sint64(-1);
+  message.set_f(1.0);
+  message.set_d(1.0);
+  message.set_e(tests::ONE);
+  message.mutable_nested()->set_str("nested");
+  message.add_repeated_string("repeated_string");
+  message.add_repeated_bytes("repeated_bytes");
+  message.add_repeated_int32(-2);
+  message.add_repeated_int64(-2);
+  message.add_repeated_uint32(2);
+  message.add_repeated_uint64(2);
+  message.add_repeated_sint32(-2);
+  message.add_repeated_sint64(-2);
+  message.add_repeated_float(1.0);
+  message.add_repeated_double(1.0);
+  message.add_repeated_double(2.0);
+  message.add_repeated_enum(tests::TWO);
+  message.add_repeated_nested()->set_str("repeated_nested");
+
+  // TODO(bmahler): To dynamically generate a protobuf message,
+  // see the commented-out code below.
+//  DescriptorProto proto;
+//
+//  proto.set_name("Message");
+//
+//  FieldDescriptorProto* field = proto.add_field();
+//  field->set_name("str");
+//  field->set_type(FieldDescriptorProto::TYPE_STRING);
+//
+//  const Descriptor* descriptor = proto.descriptor();
+//
+//  DynamicMessageFactory factory;
+//  Message* message = factory.GetPrototype(descriptor);
+//
+//  Reflection* message.getReflection();
+
+  // The keys are in alphabetical order.
+  string expected = strings::remove(
+      "{"
+      "  \"bytes\": \"bytes\","
+      "  \"d\": 1,"
+      "  \"e\": \"ONE\","
+      "  \"f\": 1,"
+      "  \"int32\": -1,"
+      "  \"int64\": -1,"
+      "  \"nested\": { \"str\": \"nested\"},"
+      "  \"repeated_bytes\": [\"repeated_bytes\"],"
+      "  \"repeated_double\": [1, 2],"
+      "  \"repeated_enum\": [\"TWO\"],"
+      "  \"repeated_float\": [1],"
+      "  \"repeated_int32\": [-2],"
+      "  \"repeated_int64\": [-2],"
+      "  \"repeated_nested\": [ { \"str\": \"repeated_nested\" } ],"
+      "  \"repeated_sint32\": [-2],"
+      "  \"repeated_sint64\": [-2],"
+      "  \"repeated_string\": [\"repeated_string\"],"
+      "  \"repeated_uint32\": [2],"
+      "  \"repeated_uint64\": [2],"
+      "  \"sint32\": -1,"
+      "  \"sint64\": -1,"
+      "  \"str\": \"string\","
+      "  \"uint32\": 1,"
+      "  \"uint64\": 1"
+      "}",
+      " ");
+
+  JSON::Object object = JSON::Protobuf(message);
+
+  EXPECT_EQ(expected, stringify(object));
+}

http://git-wip-us.apache.org/repos/asf/mesos/blob/d33efc97/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.pb.cc
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.pb.cc b/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.pb.cc
new file mode 100644
index 0000000..ecf34e1
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/tests/protobuf_tests.pb.cc
@@ -0,0 +1,1692 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+
+#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
+#include "protobuf_tests.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/once.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/wire_format_lite_inl.h>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/reflection_ops.h>
+#include <google/protobuf/wire_format.h>
+// @@protoc_insertion_point(includes)
+
+namespace tests {
+
+namespace {
+
+const ::google::protobuf::Descriptor* Nested_descriptor_ = NULL;
+const ::google::protobuf::internal::GeneratedMessageReflection*
+  Nested_reflection_ = NULL;
+const ::google::protobuf::Descriptor* Message_descriptor_ = NULL;
+const ::google::protobuf::internal::GeneratedMessageReflection*
+  Message_reflection_ = NULL;
+const ::google::protobuf::EnumDescriptor* Enum_descriptor_ = NULL;
+
+}  // namespace
+
+
+void protobuf_AssignDesc_protobuf_5ftests_2eproto() {
+  protobuf_AddDesc_protobuf_5ftests_2eproto();
+  const ::google::protobuf::FileDescriptor* file =
+    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
+      "protobuf_tests.proto");
+  GOOGLE_CHECK(file != NULL);
+  Nested_descriptor_ = file->message_type(0);
+  static const int Nested_offsets_[1] = {
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Nested, str_),
+  };
+  Nested_reflection_ =
+    new ::google::protobuf::internal::GeneratedMessageReflection(
+      Nested_descriptor_,
+      Nested::default_instance_,
+      Nested_offsets_,
+      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Nested, _has_bits_[0]),
+      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Nested, _unknown_fields_),
+      -1,
+      ::google::protobuf::DescriptorPool::generated_pool(),
+      ::google::protobuf::MessageFactory::generated_factory(),
+      sizeof(Nested));
+  Message_descriptor_ = file->message_type(1);
+  static const int Message_offsets_[25] = {
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, str_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, bytes_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, int32_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, int64_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, uint32_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, uint64_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, sint32_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, sint64_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, f_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, d_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, e_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, nested_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_string_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_bytes_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_int32_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_int64_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_uint32_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_uint64_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_sint32_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_sint64_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_float_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_double_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_enum_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, repeated_nested_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, empty_),
+  };
+  Message_reflection_ =
+    new ::google::protobuf::internal::GeneratedMessageReflection(
+      Message_descriptor_,
+      Message::default_instance_,
+      Message_offsets_,
+      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, _has_bits_[0]),
+      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Message, _unknown_fields_),
+      -1,
+      ::google::protobuf::DescriptorPool::generated_pool(),
+      ::google::protobuf::MessageFactory::generated_factory(),
+      sizeof(Message));
+  Enum_descriptor_ = file->enum_type(0);
+}
+
+namespace {
+
+GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
+inline void protobuf_AssignDescriptorsOnce() {
+  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
+                 &protobuf_AssignDesc_protobuf_5ftests_2eproto);
+}
+
+void protobuf_RegisterTypes(const ::std::string&) {
+  protobuf_AssignDescriptorsOnce();
+  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
+    Nested_descriptor_, &Nested::default_instance());
+  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
+    Message_descriptor_, &Message::default_instance());
+}
+
+}  // namespace
+
+void protobuf_ShutdownFile_protobuf_5ftests_2eproto() {
+  delete Nested::default_instance_;
+  delete Nested_reflection_;
+  delete Message::default_instance_;
+  delete Message_reflection_;
+}
+
+void protobuf_AddDesc_protobuf_5ftests_2eproto() {
+  static bool already_here = false;
+  if (already_here) return;
+  already_here = true;
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
+    "\n\024protobuf_tests.proto\022\005tests\"\025\n\006Nested\022"
+    "\013\n\003str\030\001 \001(\t\"\241\004\n\007Message\022\013\n\003str\030\001 \002(\t\022\r\n"
+    "\005bytes\030\002 \002(\014\022\r\n\005int32\030\003 \001(\005\022\r\n\005int64\030\004 \001"
+    "(\003\022\016\n\006uint32\030\005 \001(\r\022\016\n\006uint64\030\006 \001(\004\022\016\n\006si"
+    "nt32\030\007 \001(\021\022\016\n\006sint64\030\010 \001(\022\022\t\n\001f\030\t \002(\002\022\t\n"
+    "\001d\030\n \002(\001\022\026\n\001e\030\013 \002(\0162\013.tests.Enum\022\035\n\006nest"
+    "ed\030\014 \002(\0132\r.tests.Nested\022\027\n\017repeated_stri"
+    "ng\030\r \003(\t\022\026\n\016repeated_bytes\030\016 \003(\014\022\026\n\016repe"
+    "ated_int32\030\017 \003(\005\022\026\n\016repeated_int64\030\020 \003(\003"
+    "\022\027\n\017repeated_uint32\030\021 \003(\r\022\027\n\017repeated_ui"
+    "nt64\030\022 \003(\004\022\027\n\017repeated_sint32\030\023 \003(\021\022\027\n\017r"
+    "epeated_sint64\030\024 \003(\022\022\026\n\016repeated_float\030\025"
+    " \003(\002\022\027\n\017repeated_double\030\026 \003(\001\022\"\n\rrepeate"
+    "d_enum\030\027 \003(\0162\013.tests.Enum\022&\n\017repeated_ne"
+    "sted\030\030 \003(\0132\r.tests.Nested\022\r\n\005empty\030\031 \003(\t"
+    "*\030\n\004Enum\022\007\n\003ONE\020\001\022\007\n\003TWO\020\002", 626);
+  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
+    "protobuf_tests.proto", &protobuf_RegisterTypes);
+  Nested::default_instance_ = new Nested();
+  Message::default_instance_ = new Message();
+  Nested::default_instance_->InitAsDefaultInstance();
+  Message::default_instance_->InitAsDefaultInstance();
+  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_protobuf_5ftests_2eproto);
+}
+
+// Force AddDescriptors() to be called at static initialization time.
+struct StaticDescriptorInitializer_protobuf_5ftests_2eproto {
+  StaticDescriptorInitializer_protobuf_5ftests_2eproto() {
+    protobuf_AddDesc_protobuf_5ftests_2eproto();
+  }
+} static_descriptor_initializer_protobuf_5ftests_2eproto_;
+
+const ::google::protobuf::EnumDescriptor* Enum_descriptor() {
+  protobuf_AssignDescriptorsOnce();
+  return Enum_descriptor_;
+}
+bool Enum_IsValid(int value) {
+  switch(value) {
+    case 1:
+    case 2:
+      return true;
+    default:
+      return false;
+  }
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int Nested::kStrFieldNumber;
+#endif  // !_MSC_VER
+
+Nested::Nested()
+  : ::google::protobuf::Message() {
+  SharedCtor();
+}
+
+void Nested::InitAsDefaultInstance() {
+}
+
+Nested::Nested(const Nested& from)
+  : ::google::protobuf::Message() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void Nested::SharedCtor() {
+  _cached_size_ = 0;
+  str_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+Nested::~Nested() {
+  SharedDtor();
+}
+
+void Nested::SharedDtor() {
+  if (str_ != &::google::protobuf::internal::kEmptyString) {
+    delete str_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+void Nested::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* Nested::descriptor() {
+  protobuf_AssignDescriptorsOnce();
+  return Nested_descriptor_;
+}
+
+const Nested& Nested::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_protobuf_5ftests_2eproto();  return *default_instance_;
+}
+
+Nested* Nested::default_instance_ = NULL;
+
+Nested* Nested::New() const {
+  return new Nested;
+}
+
+void Nested::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (has_str()) {
+      if (str_ != &::google::protobuf::internal::kEmptyString) {
+        str_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->Clear();
+}
+
+bool Nested::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // optional string str = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_str()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+            this->str().data(), this->str().length(),
+            ::google::protobuf::internal::WireFormat::PARSE);
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormat::SkipField(
+              input, tag, mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void Nested::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // optional string str = 1;
+  if (has_str()) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+      this->str().data(), this->str().length(),
+      ::google::protobuf::internal::WireFormat::SERIALIZE);
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      1, this->str(), output);
+  }
+  
+  if (!unknown_fields().empty()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        unknown_fields(), output);
+  }
+}
+
+::google::protobuf::uint8* Nested::SerializeWithCachedSizesToArray(
+    ::google::protobuf::uint8* target) const {
+  // optional string str = 1;
+  if (has_str()) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+      this->str().data(), this->str().length(),
+      ::google::protobuf::internal::WireFormat::SERIALIZE);
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        1, this->str(), target);
+  }
+  
+  if (!unknown_fields().empty()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        unknown_fields(), target);
+  }
+  return target;
+}
+
+int Nested::ByteSize() const {
+  int total_size = 0;
+  
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // optional string str = 1;
+    if (has_str()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::StringSize(
+          this->str());
+    }
+    
+  }
+  if (!unknown_fields().empty()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        unknown_fields());
+  }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void Nested::MergeFrom(const ::google::protobuf::Message& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  const Nested* source =
+    ::google::protobuf::internal::dynamic_cast_if_available<const Nested*>(
+      &from);
+  if (source == NULL) {
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+    MergeFrom(*source);
+  }
+}
+
+void Nested::MergeFrom(const Nested& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_str()) {
+      set_str(from.str());
+    }
+  }
+  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
+}
+
+void Nested::CopyFrom(const ::google::protobuf::Message& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Nested::CopyFrom(const Nested& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Nested::IsInitialized() const {
+  
+  return true;
+}
+
+void Nested::Swap(Nested* other) {
+  if (other != this) {
+    std::swap(str_, other->str_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.Swap(&other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::google::protobuf::Metadata Nested::GetMetadata() const {
+  protobuf_AssignDescriptorsOnce();
+  ::google::protobuf::Metadata metadata;
+  metadata.descriptor = Nested_descriptor_;
+  metadata.reflection = Nested_reflection_;
+  return metadata;
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int Message::kStrFieldNumber;
+const int Message::kBytesFieldNumber;
+const int Message::kInt32FieldNumber;
+const int Message::kInt64FieldNumber;
+const int Message::kUint32FieldNumber;
+const int Message::kUint64FieldNumber;
+const int Message::kSint32FieldNumber;
+const int Message::kSint64FieldNumber;
+const int Message::kFFieldNumber;
+const int Message::kDFieldNumber;
+const int Message::kEFieldNumber;
+const int Message::kNestedFieldNumber;
+const int Message::kRepeatedStringFieldNumber;
+const int Message::kRepeatedBytesFieldNumber;
+const int Message::kRepeatedInt32FieldNumber;
+const int Message::kRepeatedInt64FieldNumber;
+const int Message::kRepeatedUint32FieldNumber;
+const int Message::kRepeatedUint64FieldNumber;
+const int Message::kRepeatedSint32FieldNumber;
+const int Message::kRepeatedSint64FieldNumber;
+const int Message::kRepeatedFloatFieldNumber;
+const int Message::kRepeatedDoubleFieldNumber;
+const int Message::kRepeatedEnumFieldNumber;
+const int Message::kRepeatedNestedFieldNumber;
+const int Message::kEmptyFieldNumber;
+#endif  // !_MSC_VER
+
+Message::Message()
+  : ::google::protobuf::Message() {
+  SharedCtor();
+}
+
+void Message::InitAsDefaultInstance() {
+  nested_ = const_cast< ::tests::Nested*>(&::tests::Nested::default_instance());
+}
+
+Message::Message(const Message& from)
+  : ::google::protobuf::Message() {
+  SharedCtor();
+  MergeFrom(from);
+}
+
+void Message::SharedCtor() {
+  _cached_size_ = 0;
+  str_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  bytes_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
+  int32_ = 0;
+  int64_ = GOOGLE_LONGLONG(0);
+  uint32_ = 0u;
+  uint64_ = GOOGLE_ULONGLONG(0);
+  sint32_ = 0;
+  sint64_ = GOOGLE_LONGLONG(0);
+  f_ = 0;
+  d_ = 0;
+  e_ = 1;
+  nested_ = NULL;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+Message::~Message() {
+  SharedDtor();
+}
+
+void Message::SharedDtor() {
+  if (str_ != &::google::protobuf::internal::kEmptyString) {
+    delete str_;
+  }
+  if (bytes_ != &::google::protobuf::internal::kEmptyString) {
+    delete bytes_;
+  }
+  if (this != default_instance_) {
+    delete nested_;
+  }
+}
+
+void Message::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* Message::descriptor() {
+  protobuf_AssignDescriptorsOnce();
+  return Message_descriptor_;
+}
+
+const Message& Message::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_protobuf_5ftests_2eproto();  return *default_instance_;
+}
+
+Message* Message::default_instance_ = NULL;
+
+Message* Message::New() const {
+  return new Message;
+}
+
+void Message::Clear() {
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (has_str()) {
+      if (str_ != &::google::protobuf::internal::kEmptyString) {
+        str_->clear();
+      }
+    }
+    if (has_bytes()) {
+      if (bytes_ != &::google::protobuf::internal::kEmptyString) {
+        bytes_->clear();
+      }
+    }
+    int32_ = 0;
+    int64_ = GOOGLE_LONGLONG(0);
+    uint32_ = 0u;
+    uint64_ = GOOGLE_ULONGLONG(0);
+    sint32_ = 0;
+    sint64_ = GOOGLE_LONGLONG(0);
+  }
+  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    f_ = 0;
+    d_ = 0;
+    e_ = 1;
+    if (has_nested()) {
+      if (nested_ != NULL) nested_->::tests::Nested::Clear();
+    }
+  }
+  repeated_string_.Clear();
+  repeated_bytes_.Clear();
+  repeated_int32_.Clear();
+  repeated_int64_.Clear();
+  repeated_uint32_.Clear();
+  repeated_uint64_.Clear();
+  repeated_sint32_.Clear();
+  repeated_sint64_.Clear();
+  repeated_float_.Clear();
+  repeated_double_.Clear();
+  repeated_enum_.Clear();
+  repeated_nested_.Clear();
+  empty_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->Clear();
+}
+
+bool Message::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
+  ::google::protobuf::uint32 tag;
+  while ((tag = input->ReadTag()) != 0) {
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required string str = 1;
+      case 1: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->mutable_str()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+            this->str().data(), this->str().length(),
+            ::google::protobuf::internal::WireFormat::PARSE);
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(18)) goto parse_bytes;
+        break;
+      }
+      
+      // required bytes bytes = 2;
+      case 2: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_bytes:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_bytes()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(24)) goto parse_int32;
+        break;
+      }
+      
+      // optional int32 int32 = 3;
+      case 3: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_int32:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, &int32_)));
+          set_has_int32();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(32)) goto parse_int64;
+        break;
+      }
+      
+      // optional int64 int64 = 4;
+      case 4: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_int64:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
+                 input, &int64_)));
+          set_has_int64();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(40)) goto parse_uint32;
+        break;
+      }
+      
+      // optional uint32 uint32 = 5;
+      case 5: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_uint32:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &uint32_)));
+          set_has_uint32();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(48)) goto parse_uint64;
+        break;
+      }
+      
+      // optional uint64 uint64 = 6;
+      case 6: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_uint64:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 input, &uint64_)));
+          set_has_uint64();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(56)) goto parse_sint32;
+        break;
+      }
+      
+      // optional sint32 sint32 = 7;
+      case 7: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_sint32:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
+                 input, &sint32_)));
+          set_has_sint32();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(64)) goto parse_sint64;
+        break;
+      }
+      
+      // optional sint64 sint64 = 8;
+      case 8: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_sint64:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
+                 input, &sint64_)));
+          set_has_sint64();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(77)) goto parse_f;
+        break;
+      }
+      
+      // required float f = 9;
+      case 9: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
+         parse_f:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
+                 input, &f_)));
+          set_has_f();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(81)) goto parse_d;
+        break;
+      }
+      
+      // required double d = 10;
+      case 10: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
+         parse_d:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
+                 input, &d_)));
+          set_has_d();
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(88)) goto parse_e;
+        break;
+      }
+      
+      // required .tests.Enum e = 11;
+      case 11: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_e:
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (tests::Enum_IsValid(value)) {
+            set_e(static_cast< tests::Enum >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(11, value);
+          }
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(98)) goto parse_nested;
+        break;
+      }
+      
+      // required .tests.Nested nested = 12;
+      case 12: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_nested:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_nested()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(106)) goto parse_repeated_string;
+        break;
+      }
+      
+      // repeated string repeated_string = 13;
+      case 13: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_repeated_string:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->add_repeated_string()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+            this->repeated_string(0).data(), this->repeated_string(0).length(),
+            ::google::protobuf::internal::WireFormat::PARSE);
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(106)) goto parse_repeated_string;
+        if (input->ExpectTag(114)) goto parse_repeated_bytes;
+        break;
+      }
+      
+      // repeated bytes repeated_bytes = 14;
+      case 14: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_repeated_bytes:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->add_repeated_bytes()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(114)) goto parse_repeated_bytes;
+        if (input->ExpectTag(120)) goto parse_repeated_int32;
+        break;
+      }
+      
+      // repeated int32 repeated_int32 = 15;
+      case 15: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_repeated_int32:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 1, 120, input, this->mutable_repeated_int32())));
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
+                 input, this->mutable_repeated_int32())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(120)) goto parse_repeated_int32;
+        if (input->ExpectTag(128)) goto parse_repeated_int64;
+        break;
+      }
+      
+      // repeated int64 repeated_int64 = 16;
+      case 16: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_repeated_int64:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
+                 2, 128, input, this->mutable_repeated_int64())));
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
+                 input, this->mutable_repeated_int64())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(128)) goto parse_repeated_int64;
+        if (input->ExpectTag(136)) goto parse_repeated_uint32;
+        break;
+      }
+      
+      // repeated uint32 repeated_uint32 = 17;
+      case 17: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_repeated_uint32:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 2, 136, input, this->mutable_repeated_uint32())));
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_repeated_uint32())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(136)) goto parse_repeated_uint32;
+        if (input->ExpectTag(144)) goto parse_repeated_uint64;
+        break;
+      }
+      
+      // repeated uint64 repeated_uint64 = 18;
+      case 18: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_repeated_uint64:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 2, 144, input, this->mutable_repeated_uint64())));
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 input, this->mutable_repeated_uint64())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(144)) goto parse_repeated_uint64;
+        if (input->ExpectTag(152)) goto parse_repeated_sint32;
+        break;
+      }
+      
+      // repeated sint32 repeated_sint32 = 19;
+      case 19: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_repeated_sint32:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
+                 2, 152, input, this->mutable_repeated_sint32())));
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
+                 input, this->mutable_repeated_sint32())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(152)) goto parse_repeated_sint32;
+        if (input->ExpectTag(160)) goto parse_repeated_sint64;
+        break;
+      }
+      
+      // repeated sint64 repeated_sint64 = 20;
+      case 20: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_repeated_sint64:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
+                 2, 160, input, this->mutable_repeated_sint64())));
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>(
+                 input, this->mutable_repeated_sint64())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(160)) goto parse_repeated_sint64;
+        if (input->ExpectTag(173)) goto parse_repeated_float;
+        break;
+      }
+      
+      // repeated float repeated_float = 21;
+      case 21: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED32) {
+         parse_repeated_float:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
+                 2, 173, input, this->mutable_repeated_float())));
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
+                 input, this->mutable_repeated_float())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(173)) goto parse_repeated_float;
+        if (input->ExpectTag(177)) goto parse_repeated_double;
+        break;
+      }
+      
+      // repeated double repeated_double = 22;
+      case 22: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_FIXED64) {
+         parse_repeated_double:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
+                 2, 177, input, this->mutable_repeated_double())));
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
+                 input, this->mutable_repeated_double())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(177)) goto parse_repeated_double;
+        if (input->ExpectTag(184)) goto parse_repeated_enum;
+        break;
+      }
+      
+      // repeated .tests.Enum repeated_enum = 23;
+      case 23: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
+         parse_repeated_enum:
+          int value;
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
+                 input, &value)));
+          if (tests::Enum_IsValid(value)) {
+            add_repeated_enum(static_cast< tests::Enum >(value));
+          } else {
+            mutable_unknown_fields()->AddVarint(23, value);
+          }
+        } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
+                   == ::google::protobuf::internal::WireFormatLite::
+                      WIRETYPE_LENGTH_DELIMITED) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedEnumNoInline(
+                 input,
+                 &tests::Enum_IsValid,
+                 this->mutable_repeated_enum())));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(184)) goto parse_repeated_enum;
+        if (input->ExpectTag(194)) goto parse_repeated_nested;
+        break;
+      }
+      
+      // repeated .tests.Nested repeated_nested = 24;
+      case 24: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_repeated_nested:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+                input, add_repeated_nested()));
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(194)) goto parse_repeated_nested;
+        if (input->ExpectTag(202)) goto parse_empty;
+        break;
+      }
+      
+      // repeated string empty = 25;
+      case 25: {
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
+         parse_empty:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
+                input, this->add_empty()));
+          ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+            this->empty(0).data(), this->empty(0).length(),
+            ::google::protobuf::internal::WireFormat::PARSE);
+        } else {
+          goto handle_uninterpreted;
+        }
+        if (input->ExpectTag(202)) goto parse_empty;
+        if (input->ExpectAtEnd()) return true;
+        break;
+      }
+      
+      default: {
+      handle_uninterpreted:
+        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
+            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
+          return true;
+        }
+        DO_(::google::protobuf::internal::WireFormat::SkipField(
+              input, tag, mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+  return true;
+#undef DO_
+}
+
+void Message::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // required string str = 1;
+  if (has_str()) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+      this->str().data(), this->str().length(),
+      ::google::protobuf::internal::WireFormat::SERIALIZE);
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      1, this->str(), output);
+  }
+  
+  // required bytes bytes = 2;
+  if (has_bytes()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytes(
+      2, this->bytes(), output);
+  }
+  
+  // optional int32 int32 = 3;
+  if (has_int32()) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->int32(), output);
+  }
+  
+  // optional int64 int64 = 4;
+  if (has_int64()) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt64(4, this->int64(), output);
+  }
+  
+  // optional uint32 uint32 = 5;
+  if (has_uint32()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->uint32(), output);
+  }
+  
+  // optional uint64 uint64 = 6;
+  if (has_uint64()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt64(6, this->uint64(), output);
+  }
+  
+  // optional sint32 sint32 = 7;
+  if (has_sint32()) {
+    ::google::protobuf::internal::WireFormatLite::WriteSInt32(7, this->sint32(), output);
+  }
+  
+  // optional sint64 sint64 = 8;
+  if (has_sint64()) {
+    ::google::protobuf::internal::WireFormatLite::WriteSInt64(8, this->sint64(), output);
+  }
+  
+  // required float f = 9;
+  if (has_f()) {
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(9, this->f(), output);
+  }
+  
+  // required double d = 10;
+  if (has_d()) {
+    ::google::protobuf::internal::WireFormatLite::WriteDouble(10, this->d(), output);
+  }
+  
+  // required .tests.Enum e = 11;
+  if (has_e()) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      11, this->e(), output);
+  }
+  
+  // required .tests.Nested nested = 12;
+  if (has_nested()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      12, this->nested(), output);
+  }
+  
+  // repeated string repeated_string = 13;
+  for (int i = 0; i < this->repeated_string_size(); i++) {
+  ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+    this->repeated_string(i).data(), this->repeated_string(i).length(),
+    ::google::protobuf::internal::WireFormat::SERIALIZE);
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      13, this->repeated_string(i), output);
+  }
+  
+  // repeated bytes repeated_bytes = 14;
+  for (int i = 0; i < this->repeated_bytes_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytes(
+      14, this->repeated_bytes(i), output);
+  }
+  
+  // repeated int32 repeated_int32 = 15;
+  for (int i = 0; i < this->repeated_int32_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt32(
+      15, this->repeated_int32(i), output);
+  }
+  
+  // repeated int64 repeated_int64 = 16;
+  for (int i = 0; i < this->repeated_int64_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteInt64(
+      16, this->repeated_int64(i), output);
+  }
+  
+  // repeated uint32 repeated_uint32 = 17;
+  for (int i = 0; i < this->repeated_uint32_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
+      17, this->repeated_uint32(i), output);
+  }
+  
+  // repeated uint64 repeated_uint64 = 18;
+  for (int i = 0; i < this->repeated_uint64_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt64(
+      18, this->repeated_uint64(i), output);
+  }
+  
+  // repeated sint32 repeated_sint32 = 19;
+  for (int i = 0; i < this->repeated_sint32_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteSInt32(
+      19, this->repeated_sint32(i), output);
+  }
+  
+  // repeated sint64 repeated_sint64 = 20;
+  for (int i = 0; i < this->repeated_sint64_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteSInt64(
+      20, this->repeated_sint64(i), output);
+  }
+  
+  // repeated float repeated_float = 21;
+  for (int i = 0; i < this->repeated_float_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteFloat(
+      21, this->repeated_float(i), output);
+  }
+  
+  // repeated double repeated_double = 22;
+  for (int i = 0; i < this->repeated_double_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteDouble(
+      22, this->repeated_double(i), output);
+  }
+  
+  // repeated .tests.Enum repeated_enum = 23;
+  for (int i = 0; i < this->repeated_enum_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteEnum(
+      23, this->repeated_enum(i), output);
+  }
+  
+  // repeated .tests.Nested repeated_nested = 24;
+  for (int i = 0; i < this->repeated_nested_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      24, this->repeated_nested(i), output);
+  }
+  
+  // repeated string empty = 25;
+  for (int i = 0; i < this->empty_size(); i++) {
+  ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+    this->empty(i).data(), this->empty(i).length(),
+    ::google::protobuf::internal::WireFormat::SERIALIZE);
+    ::google::protobuf::internal::WireFormatLite::WriteString(
+      25, this->empty(i), output);
+  }
+  
+  if (!unknown_fields().empty()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        unknown_fields(), output);
+  }
+}
+
+::google::protobuf::uint8* Message::SerializeWithCachedSizesToArray(
+    ::google::protobuf::uint8* target) const {
+  // required string str = 1;
+  if (has_str()) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+      this->str().data(), this->str().length(),
+      ::google::protobuf::internal::WireFormat::SERIALIZE);
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
+        1, this->str(), target);
+  }
+  
+  // required bytes bytes = 2;
+  if (has_bytes()) {
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
+        2, this->bytes(), target);
+  }
+  
+  // optional int32 int32 = 3;
+  if (has_int32()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->int32(), target);
+  }
+  
+  // optional int64 int64 = 4;
+  if (has_int64()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(4, this->int64(), target);
+  }
+  
+  // optional uint32 uint32 = 5;
+  if (has_uint32()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->uint32(), target);
+  }
+  
+  // optional uint64 uint64 = 6;
+  if (has_uint64()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(6, this->uint64(), target);
+  }
+  
+  // optional sint32 sint32 = 7;
+  if (has_sint32()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteSInt32ToArray(7, this->sint32(), target);
+  }
+  
+  // optional sint64 sint64 = 8;
+  if (has_sint64()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(8, this->sint64(), target);
+  }
+  
+  // required float f = 9;
+  if (has_f()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(9, this->f(), target);
+  }
+  
+  // required double d = 10;
+  if (has_d()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(10, this->d(), target);
+  }
+  
+  // required .tests.Enum e = 11;
+  if (has_e()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      11, this->e(), target);
+  }
+  
+  // required .tests.Nested nested = 12;
+  if (has_nested()) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteMessageNoVirtualToArray(
+        12, this->nested(), target);
+  }
+  
+  // repeated string repeated_string = 13;
+  for (int i = 0; i < this->repeated_string_size(); i++) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+      this->repeated_string(i).data(), this->repeated_string(i).length(),
+      ::google::protobuf::internal::WireFormat::SERIALIZE);
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteStringToArray(13, this->repeated_string(i), target);
+  }
+  
+  // repeated bytes repeated_bytes = 14;
+  for (int i = 0; i < this->repeated_bytes_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteBytesToArray(14, this->repeated_bytes(i), target);
+  }
+  
+  // repeated int32 repeated_int32 = 15;
+  for (int i = 0; i < this->repeated_int32_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteInt32ToArray(15, this->repeated_int32(i), target);
+  }
+  
+  // repeated int64 repeated_int64 = 16;
+  for (int i = 0; i < this->repeated_int64_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteInt64ToArray(16, this->repeated_int64(i), target);
+  }
+  
+  // repeated uint32 repeated_uint32 = 17;
+  for (int i = 0; i < this->repeated_uint32_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteUInt32ToArray(17, this->repeated_uint32(i), target);
+  }
+  
+  // repeated uint64 repeated_uint64 = 18;
+  for (int i = 0; i < this->repeated_uint64_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteUInt64ToArray(18, this->repeated_uint64(i), target);
+  }
+  
+  // repeated sint32 repeated_sint32 = 19;
+  for (int i = 0; i < this->repeated_sint32_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteSInt32ToArray(19, this->repeated_sint32(i), target);
+  }
+  
+  // repeated sint64 repeated_sint64 = 20;
+  for (int i = 0; i < this->repeated_sint64_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteSInt64ToArray(20, this->repeated_sint64(i), target);
+  }
+  
+  // repeated float repeated_float = 21;
+  for (int i = 0; i < this->repeated_float_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteFloatToArray(21, this->repeated_float(i), target);
+  }
+  
+  // repeated double repeated_double = 22;
+  for (int i = 0; i < this->repeated_double_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteDoubleToArray(22, this->repeated_double(i), target);
+  }
+  
+  // repeated .tests.Enum repeated_enum = 23;
+  for (int i = 0; i < this->repeated_enum_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
+      23, this->repeated_enum(i), target);
+  }
+  
+  // repeated .tests.Nested repeated_nested = 24;
+  for (int i = 0; i < this->repeated_nested_size(); i++) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteMessageNoVirtualToArray(
+        24, this->repeated_nested(i), target);
+  }
+  
+  // repeated string empty = 25;
+  for (int i = 0; i < this->empty_size(); i++) {
+    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
+      this->empty(i).data(), this->empty(i).length(),
+      ::google::protobuf::internal::WireFormat::SERIALIZE);
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteStringToArray(25, this->empty(i), target);
+  }
+  
+  if (!unknown_fields().empty()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        unknown_fields(), target);
+  }
+  return target;
+}
+
+int Message::ByteSize() const {
+  int total_size = 0;
+  
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required string str = 1;
+    if (has_str()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::StringSize(
+          this->str());
+    }
+    
+    // required bytes bytes = 2;
+    if (has_bytes()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::BytesSize(
+          this->bytes());
+    }
+    
+    // optional int32 int32 = 3;
+    if (has_int32()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(
+          this->int32());
+    }
+    
+    // optional int64 int64 = 4;
+    if (has_int64()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int64Size(
+          this->int64());
+    }
+    
+    // optional uint32 uint32 = 5;
+    if (has_uint32()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->uint32());
+    }
+    
+    // optional uint64 uint64 = 6;
+    if (has_uint64()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt64Size(
+          this->uint64());
+    }
+    
+    // optional sint32 sint32 = 7;
+    if (has_sint32()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::SInt32Size(
+          this->sint32());
+    }
+    
+    // optional sint64 sint64 = 8;
+    if (has_sint64()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::SInt64Size(
+          this->sint64());
+    }
+    
+  }
+  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    // required float f = 9;
+    if (has_f()) {
+      total_size += 1 + 4;
+    }
+    
+    // required double d = 10;
+    if (has_d()) {
+      total_size += 1 + 8;
+    }
+    
+    // required .tests.Enum e = 11;
+    if (has_e()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::EnumSize(this->e());
+    }
+    
+    // required .tests.Nested nested = 12;
+    if (has_nested()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->nested());
+    }
+    
+  }
+  // repeated string repeated_string = 13;
+  total_size += 1 * this->repeated_string_size();
+  for (int i = 0; i < this->repeated_string_size(); i++) {
+    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
+      this->repeated_string(i));
+  }
+  
+  // repeated bytes repeated_bytes = 14;
+  total_size += 1 * this->repeated_bytes_size();
+  for (int i = 0; i < this->repeated_bytes_size(); i++) {
+    total_size += ::google::protobuf::internal::WireFormatLite::BytesSize(
+      this->repeated_bytes(i));
+  }
+  
+  // repeated int32 repeated_int32 = 15;
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->repeated_int32_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        Int32Size(this->repeated_int32(i));
+    }
+    total_size += 1 * this->repeated_int32_size() + data_size;
+  }
+  
+  // repeated int64 repeated_int64 = 16;
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->repeated_int64_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        Int64Size(this->repeated_int64(i));
+    }
+    total_size += 2 * this->repeated_int64_size() + data_size;
+  }
+  
+  // repeated uint32 repeated_uint32 = 17;
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->repeated_uint32_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->repeated_uint32(i));
+    }
+    total_size += 2 * this->repeated_uint32_size() + data_size;
+  }
+  
+  // repeated uint64 repeated_uint64 = 18;
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->repeated_uint64_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt64Size(this->repeated_uint64(i));
+    }
+    total_size += 2 * this->repeated_uint64_size() + data_size;
+  }
+  
+  // repeated sint32 repeated_sint32 = 19;
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->repeated_sint32_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        SInt32Size(this->repeated_sint32(i));
+    }
+    total_size += 2 * this->repeated_sint32_size() + data_size;
+  }
+  
+  // repeated sint64 repeated_sint64 = 20;
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->repeated_sint64_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        SInt64Size(this->repeated_sint64(i));
+    }
+    total_size += 2 * this->repeated_sint64_size() + data_size;
+  }
+  
+  // repeated float repeated_float = 21;
+  {
+    int data_size = 0;
+    data_size = 4 * this->repeated_float_size();
+    total_size += 2 * this->repeated_float_size() + data_size;
+  }
+  
+  // repeated double repeated_double = 22;
+  {
+    int data_size = 0;
+    data_size = 8 * this->repeated_double_size();
+    total_size += 2 * this->repeated_double_size() + data_size;
+  }
+  
+  // repeated .tests.Enum repeated_enum = 23;
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->repeated_enum_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::EnumSize(
+        this->repeated_enum(i));
+    }
+    total_size += 2 * this->repeated_enum_size() + data_size;
+  }
+  
+  // repeated .tests.Nested repeated_nested = 24;
+  total_size += 2 * this->repeated_nested_size();
+  for (int i = 0; i < this->repeated_nested_size(); i++) {
+    total_size +=
+      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+        this->repeated_nested(i));
+  }
+  
+  // repeated string empty = 25;
+  total_size += 2 * this->empty_size();
+  for (int i = 0; i < this->empty_size(); i++) {
+    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
+      this->empty(i));
+  }
+  
+  if (!unknown_fields().empty()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        unknown_fields());
+  }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void Message::MergeFrom(const ::google::protobuf::Message& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  const Message* source =
+    ::google::protobuf::internal::dynamic_cast_if_available<const Message*>(
+      &from);
+  if (source == NULL) {
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+    MergeFrom(*source);
+  }
+}
+
+void Message::MergeFrom(const Message& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  repeated_string_.MergeFrom(from.repeated_string_);
+  repeated_bytes_.MergeFrom(from.repeated_bytes_);
+  repeated_int32_.MergeFrom(from.repeated_int32_);
+  repeated_int64_.MergeFrom(from.repeated_int64_);
+  repeated_uint32_.MergeFrom(from.repeated_uint32_);
+  repeated_uint64_.MergeFrom(from.repeated_uint64_);
+  repeated_sint32_.MergeFrom(from.repeated_sint32_);
+  repeated_sint64_.MergeFrom(from.repeated_sint64_);
+  repeated_float_.MergeFrom(from.repeated_float_);
+  repeated_double_.MergeFrom(from.repeated_double_);
+  repeated_enum_.MergeFrom(from.repeated_enum_);
+  repeated_nested_.MergeFrom(from.repeated_nested_);
+  empty_.MergeFrom(from.empty_);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_str()) {
+      set_str(from.str());
+    }
+    if (from.has_bytes()) {
+      set_bytes(from.bytes());
+    }
+    if (from.has_int32()) {
+      set_int32(from.int32());
+    }
+    if (from.has_int64()) {
+      set_int64(from.int64());
+    }
+    if (from.has_uint32()) {
+      set_uint32(from.uint32());
+    }
+    if (from.has_uint64()) {
+      set_uint64(from.uint64());
+    }
+    if (from.has_sint32()) {
+      set_sint32(from.sint32());
+    }
+    if (from.has_sint64()) {
+      set_sint64(from.sint64());
+    }
+  }
+  if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    if (from.has_f()) {
+      set_f(from.f());
+    }
+    if (from.has_d()) {
+      set_d(from.d());
+    }
+    if (from.has_e()) {
+      set_e(from.e());
+    }
+    if (from.has_nested()) {
+      mutable_nested()->::tests::Nested::MergeFrom(from.nested());
+    }
+  }
+  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
+}
+
+void Message::CopyFrom(const ::google::protobuf::Message& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void Message::CopyFrom(const Message& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool Message::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000f03) != 0x00000f03) return false;
+  
+  return true;
+}
+
+void Message::Swap(Message* other) {
+  if (other != this) {
+    std::swap(str_, other->str_);
+    std::swap(bytes_, other->bytes_);
+    std::swap(int32_, other->int32_);
+    std::swap(int64_, other->int64_);
+    std::swap(uint32_, other->uint32_);
+    std::swap(uint64_, other->uint64_);
+    std::swap(sint32_, other->sint32_);
+    std::swap(sint64_, other->sint64_);
+    std::swap(f_, other->f_);
+    std::swap(d_, other->d_);
+    std::swap(e_, other->e_);
+    std::swap(nested_, other->nested_);
+    repeated_string_.Swap(&other->repeated_string_);
+    repeated_bytes_.Swap(&other->repeated_bytes_);
+    repeated_int32_.Swap(&other->repeated_int32_);
+    repeated_int64_.Swap(&other->repeated_int64_);
+    repeated_uint32_.Swap(&other->repeated_uint32_);
+    repeated_uint64_.Swap(&other->repeated_uint64_);
+    repeated_sint32_.Swap(&other->repeated_sint32_);
+    repeated_sint64_.Swap(&other->repeated_sint64_);
+    repeated_float_.Swap(&other->repeated_float_);
+    repeated_double_.Swap(&other->repeated_double_);
+    repeated_enum_.Swap(&other->repeated_enum_);
+    repeated_nested_.Swap(&other->repeated_nested_);
+    empty_.Swap(&other->empty_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.Swap(&other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::google::protobuf::Metadata Message::GetMetadata() const {
+  protobuf_AssignDescriptorsOnce();
+  ::google::protobuf::Metadata metadata;
+  metadata.descriptor = Message_descriptor_;
+  metadata.reflection = Message_reflection_;
+  return metadata;
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+}  // namespace tests
+
+// @@protoc_insertion_point(global_scope)


[3/3] git commit: Added protobuf_tests to make check.

Posted by bm...@apache.org.
Added protobuf_tests to make check.

Review: https://reviews.apache.org/r/12474


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d2484213
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d2484213
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d2484213

Branch: refs/heads/master
Commit: d2484213dcd7a780ef17048d2be7a8fe45cb2dd0
Parents: d33efc9
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Thu Jul 11 14:17:57 2013 -0700
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Fri Jul 12 13:23:25 2013 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/Makefile.am | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d2484213/3rdparty/libprocess/3rdparty/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/Makefile.am b/3rdparty/libprocess/3rdparty/Makefile.am
index ade6688..5ade440 100644
--- a/3rdparty/libprocess/3rdparty/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/Makefile.am
@@ -127,6 +127,10 @@ stout_tests_SOURCES =				\
   $(STOUT)/tests/multimap_tests.cpp		\
   $(STOUT)/tests/none_tests.cpp			\
   $(STOUT)/tests/os_tests.cpp			\
+  $(STOUT)/tests/protobuf_tests.cpp		\
+  $(STOUT)/tests/protobuf_tests.pb.cc		\
+  $(STOUT)/tests/protobuf_tests.pb.h		\
+  $(STOUT)/tests/protobuf_tests.proto		\
   $(STOUT)/tests/strings_tests.cpp		\
   $(STOUT)/tests/thread_tests.cpp		\
   $(STOUT)/tests/uuid_tests.cpp