UnitTestOptimizeForProtoFile.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. using pb = global::Google.ProtocolBuffers;
  3. using pbc = global::Google.ProtocolBuffers.Collections;
  4. using pbd = global::Google.ProtocolBuffers.Descriptors;
  5. using scg = global::System.Collections.Generic;
  6. using self = global::Google.ProtocolBuffers.TestProtos;
  7. namespace Google.ProtocolBuffers.TestProtos {
  8. public static partial class UnitTestOptimizeForProtoFile {
  9. #region Descriptor
  10. public static pbd::FileDescriptor Descriptor {
  11. get { return descriptor; }
  12. }
  13. private static readonly pbd::FileDescriptor descriptor = pbd::FileDescriptor.InternalBuildGeneratedFileFrom (
  14. new byte[] {
  15. 0x0a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e,
  16. 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e,
  17. 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74,
  18. 0x74, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
  19. 0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a,
  20. 0x14, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a,
  21. 0x65, 0x12, 0x09, 0x0a, 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x12, 0x2e, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18,
  22. 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69,
  23. 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
  24. 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x32, 0x40, 0x0a, 0x0e, 0x74, 0x65, 0x73, 0x74, 0x5f,
  25. 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
  26. 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69,
  27. 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x18, 0xd2, 0x09, 0x20, 0x01, 0x28, 0x05, 0x42, 0x45, 0x48,
  28. 0x02, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42,
  29. 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x3e, 0x1c,
  30. 0x55, 0x6e, 0x69, 0x74, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x50,
  31. 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
  32. }, new pbd::FileDescriptor[] {
  33. self::UnitTestProtoFile.Descriptor,
  34. });
  35. #endregion
  36. #region Extensions
  37. /**/
  38. #endregion
  39. #region Static variables
  40. internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor
  41. = Descriptor.MessageTypes[0];
  42. internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable
  43. = new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor,
  44. new string[] { "I", "Msg", },
  45. typeof (self::TestOptimizedForSize),
  46. typeof (self::TestOptimizedForSize.Builder));
  47. #endregion
  48. }
  49. #region Enums
  50. #endregion
  51. #region Messages
  52. public sealed partial class TestOptimizedForSize : pb::ExtendableMessage<TestOptimizedForSize, TestOptimizedForSize.Builder> {
  53. // Use TestOptimizedForSize.CreateBuilder() to construct.
  54. private TestOptimizedForSize() {}
  55. private static readonly TestOptimizedForSize defaultInstance = new TestOptimizedForSize();
  56. public static TestOptimizedForSize DefaultInstance {
  57. get { return defaultInstance; }
  58. }
  59. public override TestOptimizedForSize DefaultInstanceForType {
  60. get { return defaultInstance; }
  61. }
  62. public static pbd::MessageDescriptor Descriptor {
  63. get { return self::UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor; }
  64. }
  65. protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
  66. get { return self::UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable; }
  67. }
  68. #region Nested types
  69. public static class Types {
  70. public static readonly pb::GeneratedExtension<self::TestOptimizedForSize, int> TestExtension =
  71. pb::GeneratedExtension.CreateExtension<self::TestOptimizedForSize, int>(Descriptor.Extensions[0]);
  72. }
  73. #endregion
  74. // optional int32 i = 1;
  75. private bool hasI;
  76. private int i_ = 0;
  77. public bool HasI {
  78. get { return hasI; }
  79. }
  80. public int I {
  81. get { return i_; }
  82. }
  83. // optional .protobuf_unittest.ForeignMessage msg = 19;
  84. private bool hasMsg;
  85. private self::ForeignMessage msg_ = self::ForeignMessage.DefaultInstance;
  86. public bool HasMsg {
  87. get { return hasMsg; }
  88. }
  89. public self::ForeignMessage Msg {
  90. get { return msg_; }
  91. }
  92. public static self::TestOptimizedForSize ParseFrom(pb::ByteString data) {
  93. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  94. }
  95. public static self::TestOptimizedForSize ParseFrom(pb::ByteString data,
  96. pb::ExtensionRegistry extensionRegistry) {
  97. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  98. .BuildParsed();
  99. }
  100. public static self::TestOptimizedForSize ParseFrom(byte[] data) {
  101. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  102. }
  103. public static self::TestOptimizedForSize parseFrom(byte[] data,
  104. pb::ExtensionRegistry extensionRegistry) {
  105. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  106. .BuildParsed();
  107. }
  108. public static self::TestOptimizedForSize ParseFrom(global::System.IO.Stream input) {
  109. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  110. }
  111. public static self::TestOptimizedForSize ParseFrom(
  112. global::System.IO.Stream input,
  113. pb::ExtensionRegistry extensionRegistry) {
  114. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  115. .BuildParsed();
  116. }
  117. public static self::TestOptimizedForSize ParseFrom(pb::CodedInputStream input) {
  118. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  119. }
  120. public static self::TestOptimizedForSize ParseFrom(pb::CodedInputStream input,
  121. pb::ExtensionRegistry extensionRegistry) {
  122. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  123. .BuildParsed();
  124. }
  125. public static Builder CreateBuilder() { return new Builder(); }
  126. public override IBuilder<self::TestOptimizedForSize> CreateBuilderForType() { return new Builder(); }
  127. public static Builder CreateBuilder(self::TestOptimizedForSize prototype) {
  128. return (Builder) new Builder().MergeFrom(prototype);
  129. }
  130. public sealed partial class Builder : pb::GeneratedBuilder<self::TestOptimizedForSize, self::TestOptimizedForSize.Builder>.ExtendableBuilder {
  131. // Construct using self::TestOptimizedForSize.CreateBuilder()
  132. internal Builder() {}
  133. self::TestOptimizedForSize result = new self::TestOptimizedForSize();
  134. protected override self::TestOptimizedForSize MessageBeingBuilt {
  135. get { return result; }
  136. }
  137. public override IBuilder<self::TestOptimizedForSize> Clear() {
  138. result = new self::TestOptimizedForSize();
  139. return this;
  140. }
  141. public override IBuilder<self::TestOptimizedForSize> Clone() {
  142. return new Builder().MergeFrom(result);
  143. }
  144. public override pbd::MessageDescriptor DescriptorForType {
  145. get { return self::TestOptimizedForSize.Descriptor; }
  146. }
  147. public override self::TestOptimizedForSize DefaultInstanceForType {
  148. get { return self::TestOptimizedForSize.DefaultInstance; }
  149. }
  150. public override self::TestOptimizedForSize BuildPartial() {
  151. self::TestOptimizedForSize returnMe = result;
  152. result = null;
  153. return returnMe;
  154. }
  155. // optional int32 i = 1;
  156. public bool HasI {
  157. get { return result.HasI; }
  158. }
  159. public int I {
  160. get { return result.I; }
  161. set { SetI(value); }
  162. }
  163. public Builder SetI(int value) {
  164. result.hasI = true;
  165. result.i_ = value;
  166. return this;
  167. }
  168. public Builder ClearI() {
  169. result.hasI = false;
  170. result.i_ = 0;
  171. return this;
  172. }
  173. // optional .protobuf_unittest.ForeignMessage msg = 19;
  174. public bool HasMsg {
  175. get { return result.HasMsg; }
  176. }
  177. public self::ForeignMessage Msg {
  178. get { return result.Msg; }
  179. set { SetMsg(value); }
  180. }
  181. public Builder SetMsg(self::ForeignMessage value) {
  182. result.hasMsg = true;
  183. result.msg_ = value;
  184. return this;
  185. }
  186. public Builder SetMsg(self::ForeignMessage.Builder builderForValue) {
  187. result.hasMsg = true;
  188. result.msg_ = builderForValue.Build();
  189. return this;
  190. }
  191. public Builder MergeMsg(self::ForeignMessage value) {
  192. if (result.HasMsg &&
  193. result.msg_ != self::ForeignMessage.DefaultInstance) {
  194. result.msg_ =
  195. self::ForeignMessage.CreateBuilder(result.msg_).MergeFrom(value).BuildPartial();
  196. } else {
  197. result.msg_ = value;
  198. }
  199. result.hasMsg = true;
  200. return this;
  201. }
  202. public Builder ClearMsg() {
  203. result.hasMsg = false;
  204. result.msg_ = self::ForeignMessage.DefaultInstance;
  205. return this;
  206. }
  207. }
  208. }
  209. #endregion
  210. #region Services
  211. #endregion
  212. }