v 0. Pasted by Anonymous as cpp at 2012-06-04 07:42:47 MSK and set expiration to never.

Paste will expire never.

  1. // Generated by the protocol buffer compiler.  DO NOT EDIT!
  2.  
  3. #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
  4. #include "SO.pb.h"
  5.  
  6. #include <algorithm>
  7.  
  8. #include <google/protobuf/stubs/once.h>
  9. #include <google/protobuf/io/coded_stream.h>
  10. #include <google/protobuf/wire_format_lite_inl.h>
  11. #include <google/protobuf/descriptor.h>
  12. #include <google/protobuf/reflection_ops.h>
  13. #include <google/protobuf/wire_format.h>
  14. // @@protoc_insertion_point(includes)
  15.  
  16. namespace SO {
  17.  
  18. namespace {
  19.  
  20. const ::google::protobuf::Descriptor* A_descriptor_ = NULL;
  21. const ::google::protobuf::internal::GeneratedMessageReflection*
  22.   A_reflection_ = NULL;
  23. const ::google::protobuf::Descriptor* B_descriptor_ = NULL;
  24. const ::google::protobuf::internal::GeneratedMessageReflection*
  25.   B_reflection_ = NULL;
  26.  
  27. }  // namespace
  28.  
  29.  
  30. void protobuf_AssignDesc_SO_2eproto() {
  31.   protobuf_AddDesc_SO_2eproto();
  32.   const ::google::protobuf::FileDescriptor* file =
  33.     ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
  34.       "SO.proto");
  35.   GOOGLE_CHECK(file != NULL);
  36.   A_descriptor_ = file->message_type(0);
  37.   static const int A_offsets_[1] = {
  38.     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(A, foo_),
  39.   };
  40.   A_reflection_ =
  41.     new ::google::protobuf::internal::GeneratedMessageReflection(
  42.       A_descriptor_,
  43.       A::default_instance_,
  44.       A_offsets_,
  45.       GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(A, _has_bits_[0]),
  46.       GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(A, _unknown_fields_),
  47.       -1,
  48.       ::google::protobuf::DescriptorPool::generated_pool(),
  49.       ::google::protobuf::MessageFactory::generated_factory(),
  50.       sizeof(A));
  51.   B_descriptor_ = file->message_type(1);
  52.   static const int B_offsets_[1] = {
  53.     GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(B, data_),
  54.   };
  55.   B_reflection_ =
  56.     new ::google::protobuf::internal::GeneratedMessageReflection(
  57.       B_descriptor_,
  58.       B::default_instance_,
  59.       B_offsets_,
  60.       GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(B, _has_bits_[0]),
  61.       GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(B, _unknown_fields_),
  62.       -1,
  63.       ::google::protobuf::DescriptorPool::generated_pool(),
  64.       ::google::protobuf::MessageFactory::generated_factory(),
  65.       sizeof(B));
  66. }
  67.  
  68. namespace {
  69.  
  70. GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
  71. inline void protobuf_AssignDescriptorsOnce() {
  72.   ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
  73.                  &protobuf_AssignDesc_SO_2eproto);
  74. }
  75.  
  76. void protobuf_RegisterTypes(const ::std::string&) {
  77.   protobuf_AssignDescriptorsOnce();
  78.   ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  79.     A_descriptor_, &A::default_instance());
  80.   ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
  81.     B_descriptor_, &B::default_instance());
  82. }
  83.  
  84. }  // namespace
  85.  
  86. void protobuf_ShutdownFile_SO_2eproto() {
  87.   delete A::default_instance_;
  88.   delete A_reflection_;
  89.   delete B::default_instance_;
  90.   delete B_reflection_;
  91. }
  92.  
  93. void protobuf_AddDesc_SO_2eproto() {
  94.   static bool already_here = false;
  95.   if (already_here) return;
  96.   already_here = true;
  97.   GOOGLE_PROTOBUF_VERIFY_VERSION;
  98.  
  99.   ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
  100.     "\n\010SO.proto\022\002SO\"\020\n\001A\022\013\n\003foo\030\001 \002(\005\"\030\n\001B\022\023\n"
  101.     "\004data\030\001 \001(\0132\005.SO.A", 58);
  102.   ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
  103.     "SO.proto", &protobuf_RegisterTypes);
  104.   A::default_instance_ = new A();
  105.   B::default_instance_ = new B();
  106.   A::default_instance_->InitAsDefaultInstance();
  107.   B::default_instance_->InitAsDefaultInstance();
  108.   ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_SO_2eproto);
  109. }
  110.  
  111. // Force AddDescriptors() to be called at static initialization time.
  112. struct StaticDescriptorInitializer_SO_2eproto {
  113.   StaticDescriptorInitializer_SO_2eproto() {
  114.     protobuf_AddDesc_SO_2eproto();
  115.   }
  116. } static_descriptor_initializer_SO_2eproto_;
  117.  
  118.  
  119. // ===================================================================
  120.  
  121. #ifndef _MSC_VER
  122. const int A::kFooFieldNumber;
  123. #endif  // !_MSC_VER
  124.  
  125. A::A()
  126.   : ::google::protobuf::Message() {
  127.   SharedCtor();
  128. }
  129.  
  130. void A::InitAsDefaultInstance() {
  131. }
  132.  
  133. A::A(const A& from)
  134.   : ::google::protobuf::Message() {
  135.   SharedCtor();
  136.   MergeFrom(from);
  137. }
  138.  
  139. void A::SharedCtor() {
  140.   _cached_size_ = 0;
  141.   foo_ = 0;
  142.   ::memset(_has_bits_, 0, sizeof(_has_bits_));
  143. }
  144.  
  145. A::~A() {
  146.   SharedDtor();
  147. }
  148.  
  149. void A::SharedDtor() {
  150.   if (this != default_instance_) {
  151.   }
  152. }
  153.  
  154. void A::SetCachedSize(int size) const {
  155.   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  156.   _cached_size_ = size;
  157.   GOOGLE_SAFE_CONCURRENT_WRITES_END();
  158. }
  159. const ::google::protobuf::Descriptor* A::descriptor() {
  160.   protobuf_AssignDescriptorsOnce();
  161.   return A_descriptor_;
  162. }
  163.  
  164. const A& A::default_instance() {
  165.   if (default_instance_ == NULL) protobuf_AddDesc_SO_2eproto()return *default_instance_;
  166. }
  167.  
  168. A* A::default_instance_ = NULL;
  169.  
  170. A* A::New() const {
  171.   return new A;
  172. }
  173.  
  174. void A::Clear() {
  175.   if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  176.     foo_ = 0;
  177.   }
  178.   ::memset(_has_bits_, 0, sizeof(_has_bits_));
  179.   mutable_unknown_fields()->Clear();
  180. }
  181.  
  182. bool A::MergePartialFromCodedStream(
  183.     ::google::protobuf::io::CodedInputStream* input) {
  184. #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  185.   ::google::protobuf::uint32 tag;
  186.   while ((tag = input->ReadTag()) != 0) {
  187.     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  188.       // required int32 foo = 1;
  189.       case 1: {
  190.         if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  191.             ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
  192.           DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
  193.                    ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
  194.                  input, &foo_)));
  195.           set_has_foo();
  196.         } else {
  197.           goto handle_uninterpreted;
  198.         }
  199.         if (input->ExpectAtEnd()) return true;
  200.         break;
  201.       }
  202.      
  203.       default: {
  204.       handle_uninterpreted:
  205.         if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  206.             ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  207.           return true;
  208.         }
  209.         DO_(::google::protobuf::internal::WireFormat::SkipField(
  210.               input, tag, mutable_unknown_fields()));
  211.         break;
  212.       }
  213.     }
  214.   }
  215.   return true;
  216. #undef DO_
  217. }
  218.  
  219. void A::SerializeWithCachedSizes(
  220.     ::google::protobuf::io::CodedOutputStream* output) const {
  221.   // required int32 foo = 1;
  222.   if (has_foo()) {
  223.     ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->foo(), output);
  224.   }
  225.  
  226.   if (!unknown_fields().empty()) {
  227.     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  228.         unknown_fields(), output);
  229.   }
  230. }
  231.  
  232. ::google::protobuf::uint8* A::SerializeWithCachedSizesToArray(
  233.     ::google::protobuf::uint8* target) const {
  234.   // required int32 foo = 1;
  235.   if (has_foo()) {
  236.     target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->foo(), target);
  237.   }
  238.  
  239.   if (!unknown_fields().empty()) {
  240.     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  241.         unknown_fields(), target);
  242.   }
  243.   return target;
  244. }
  245.  
  246. int A::ByteSize() const {
  247.   int total_size = 0;
  248.  
  249.   if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  250.     // required int32 foo = 1;
  251.     if (has_foo()) {
  252.       total_size += 1 +
  253.         ::google::protobuf::internal::WireFormatLite::Int32Size(
  254.           this->foo());
  255.     }
  256.    
  257.   }
  258.   if (!unknown_fields().empty()) {
  259.     total_size +=
  260.       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  261.         unknown_fields());
  262.   }
  263.   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  264.   _cached_size_ = total_size;
  265.   GOOGLE_SAFE_CONCURRENT_WRITES_END();
  266.   return total_size;
  267. }
  268.  
  269. void A::MergeFrom(const ::google::protobuf::Message& from) {
  270.   GOOGLE_CHECK_NE(&from, this);
  271.   const A* source =
  272.     ::google::protobuf::internal::dynamic_cast_if_available<const A*>(
  273.       &from);
  274.   if (source == NULL) {
  275.     ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  276.   } else {
  277.     MergeFrom(*source);
  278.   }
  279. }
  280.  
  281. void A::MergeFrom(const A& from) {
  282.   GOOGLE_CHECK_NE(&from, this);
  283.   if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  284.     if (from.has_foo()) {
  285.       set_foo(from.foo());
  286.     }
  287.   }
  288.   mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  289. }
  290.  
  291. void A::CopyFrom(const ::google::protobuf::Message& from) {
  292.   if (&from == this) return;
  293.   Clear();
  294.   MergeFrom(from);
  295. }
  296.  
  297. void A::CopyFrom(const A& from) {
  298.   if (&from == this) return;
  299.   Clear();
  300.   MergeFrom(from);
  301. }
  302.  
  303. bool A::IsInitialized() const {
  304.   if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
  305.  
  306.   return true;
  307. }
  308.  
  309. void A::Swap(A* other) {
  310.   if (other != this) {
  311.     std::swap(foo_, other->foo_);
  312.     std::swap(_has_bits_[0], other->_has_bits_[0]);
  313.     _unknown_fields_.Swap(&other->_unknown_fields_);
  314.     std::swap(_cached_size_, other->_cached_size_);
  315.   }
  316. }
  317.  
  318. ::google::protobuf::Metadata A::GetMetadata() const {
  319.   protobuf_AssignDescriptorsOnce();
  320.   ::google::protobuf::Metadata metadata;
  321.   metadata.descriptor = A_descriptor_;
  322.   metadata.reflection = A_reflection_;
  323.   return metadata;
  324. }
  325.  
  326.  
  327. // ===================================================================
  328.  
  329. #ifndef _MSC_VER
  330. const int B::kDataFieldNumber;
  331. #endif  // !_MSC_VER
  332.  
  333. B::B()
  334.   : ::google::protobuf::Message() {
  335.   SharedCtor();
  336. }
  337.  
  338. void B::InitAsDefaultInstance() {
  339.   data_ = const_cast< ::SO::A*>(&::SO::A::default_instance());
  340. }
  341.  
  342. B::B(const B& from)
  343.   : ::google::protobuf::Message() {
  344.   SharedCtor();
  345.   MergeFrom(from);
  346. }
  347.  
  348. void B::SharedCtor() {
  349.   _cached_size_ = 0;
  350.   data_ = NULL;
  351.   ::memset(_has_bits_, 0, sizeof(_has_bits_));
  352. }
  353.  
  354. B::~B() {
  355.   SharedDtor();
  356. }
  357.  
  358. void B::SharedDtor() {
  359.   if (this != default_instance_) {
  360.     delete data_;
  361.   }
  362. }
  363.  
  364. void B::SetCachedSize(int size) const {
  365.   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  366.   _cached_size_ = size;
  367.   GOOGLE_SAFE_CONCURRENT_WRITES_END();
  368. }
  369. const ::google::protobuf::Descriptor* B::descriptor() {
  370.   protobuf_AssignDescriptorsOnce();
  371.   return B_descriptor_;
  372. }
  373.  
  374. const B& B::default_instance() {
  375.   if (default_instance_ == NULL) protobuf_AddDesc_SO_2eproto()return *default_instance_;
  376. }
  377.  
  378. B* B::default_instance_ = NULL;
  379.  
  380. B* B::New() const {
  381.   return new B;
  382. }
  383.  
  384. void B::Clear() {
  385.   if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  386.     if (has_data()) {
  387.       if (data_ != NULL) data_->::SO::A::Clear();
  388.     }
  389.   }
  390.   ::memset(_has_bits_, 0, sizeof(_has_bits_));
  391.   mutable_unknown_fields()->Clear();
  392. }
  393.  
  394. bool B::MergePartialFromCodedStream(
  395.     ::google::protobuf::io::CodedInputStream* input) {
  396. #define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  397.   ::google::protobuf::uint32 tag;
  398.   while ((tag = input->ReadTag()) != 0) {
  399.     switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  400.       // optional .SO.A data = 1;
  401.       case 1: {
  402.         if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  403.             ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
  404.           DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
  405.                input, mutable_data()));
  406.         } else {
  407.           goto handle_uninterpreted;
  408.         }
  409.         if (input->ExpectAtEnd()) return true;
  410.         break;
  411.       }
  412.      
  413.       default: {
  414.       handle_uninterpreted:
  415.         if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
  416.             ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
  417.           return true;
  418.         }
  419.         DO_(::google::protobuf::internal::WireFormat::SkipField(
  420.               input, tag, mutable_unknown_fields()));
  421.         break;
  422.       }
  423.     }
  424.   }
  425.   return true;
  426. #undef DO_
  427. }
  428.  
  429. void B::SerializeWithCachedSizes(
  430.     ::google::protobuf::io::CodedOutputStream* output) const {
  431.   // optional .SO.A data = 1;
  432.   if (has_data()) {
  433.     ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
  434.       1, this->data(), output);
  435.   }
  436.  
  437.   if (!unknown_fields().empty()) {
  438.     ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
  439.         unknown_fields(), output);
  440.   }
  441. }
  442.  
  443. ::google::protobuf::uint8* B::SerializeWithCachedSizesToArray(
  444.     ::google::protobuf::uint8* target) const {
  445.   // optional .SO.A data = 1;
  446.   if (has_data()) {
  447.     target = ::google::protobuf::internal::WireFormatLite::
  448.       WriteMessageNoVirtualToArray(
  449.         1, this->data(), target);
  450.   }
  451.  
  452.   if (!unknown_fields().empty()) {
  453.     target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
  454.         unknown_fields(), target);
  455.   }
  456.   return target;
  457. }
  458.  
  459. int B::ByteSize() const {
  460.   int total_size = 0;
  461.  
  462.   if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  463.     // optional .SO.A data = 1;
  464.     if (has_data()) {
  465.       total_size += 1 +
  466.         ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
  467.           this->data());
  468.     }
  469.    
  470.   }
  471.   if (!unknown_fields().empty()) {
  472.     total_size +=
  473.       ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
  474.         unknown_fields());
  475.   }
  476.   GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  477.   _cached_size_ = total_size;
  478.   GOOGLE_SAFE_CONCURRENT_WRITES_END();
  479.   return total_size;
  480. }
  481.  
  482. void B::MergeFrom(const ::google::protobuf::Message& from) {
  483.   GOOGLE_CHECK_NE(&from, this);
  484.   const B* source =
  485.     ::google::protobuf::internal::dynamic_cast_if_available<const B*>(
  486.       &from);
  487.   if (source == NULL) {
  488.     ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  489.   } else {
  490.     MergeFrom(*source);
  491.   }
  492. }
  493.  
  494. void B::MergeFrom(const B& from) {
  495.   GOOGLE_CHECK_NE(&from, this);
  496.   if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
  497.     if (from.has_data()) {
  498.       mutable_data()->::SO::A::MergeFrom(from.data());
  499.     }
  500.   }
  501.   mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  502. }
  503.  
  504. void B::CopyFrom(const ::google::protobuf::Message& from) {
  505.   if (&from == this) return;
  506.   Clear();
  507.   MergeFrom(from);
  508. }
  509.  
  510. void B::CopyFrom(const B& from) {
  511.   if (&from == this) return;
  512.   Clear();
  513.   MergeFrom(from);
  514. }
  515.  
  516. bool B::IsInitialized() const {
  517.  
  518.   if (has_data()) {
  519.     if (!this->data().IsInitialized()) return false;
  520.   }
  521.   return true;
  522. }
  523.  
  524. void B::Swap(B* other) {
  525.   if (other != this) {
  526.     std::swap(data_, other->data_);
  527.     std::swap(_has_bits_[0], other->_has_bits_[0]);
  528.     _unknown_fields_.Swap(&other->_unknown_fields_);
  529.     std::swap(_cached_size_, other->_cached_size_);
  530.   }
  531. }
  532.  
  533. ::google::protobuf::Metadata B::GetMetadata() const {
  534.   protobuf_AssignDescriptorsOnce();
  535.   ::google::protobuf::Metadata metadata;
  536.   metadata.descriptor = B_descriptor_;
  537.   metadata.reflection = B_reflection_;
  538.   return metadata;
  539. }
  540.  
  541.  
  542. // @@protoc_insertion_point(namespace_scope)
  543.  
  544. }  // namespace SO
  545.  
  546. // @@protoc_insertion_point(global_scope)
  547.