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