UnitTestOptimizeForProtoFile.cs 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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. #endregion
  38. #region Static variables
  39. internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor
  40. = Descriptor.MessageTypes[0];
  41. internal static pb::FieldAccess.FieldAccessorTable internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable
  42. = new pb::FieldAccess.FieldAccessorTable(internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor,
  43. new string[] { "I", "Msg", },
  44. typeof (self::TestOptimizedForSize),
  45. typeof (self::TestOptimizedForSize.Builder));
  46. #endregion
  47. }
  48. #region Enums
  49. #endregion
  50. #region Messages
  51. public sealed partial class TestOptimizedForSize : pb::ExtendableMessage<TestOptimizedForSize, TestOptimizedForSize.Builder> {
  52. private static readonly TestOptimizedForSize defaultInstance = new TestOptimizedForSize();
  53. public static TestOptimizedForSize DefaultInstance {
  54. get { return defaultInstance; }
  55. }
  56. public override TestOptimizedForSize DefaultInstanceForType {
  57. get { return defaultInstance; }
  58. }
  59. public static pbd::MessageDescriptor Descriptor {
  60. get { return self::UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__Descriptor; }
  61. }
  62. protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors {
  63. get { return self::UnitTestOptimizeForProtoFile.internal__static_protobuf_unittest_TestOptimizedForSize__FieldAccessorTable; }
  64. }
  65. #region Nested types
  66. public static class Types {
  67. public static readonly pb::GeneratedExtensionBase<self::TestOptimizedForSize, int> TestExtension =
  68. pb::GeneratedSingleExtension<self::TestOptimizedForSize, int>.CreateInstance(Descriptor.Extensions[0]);
  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 self::ForeignMessage msg_ = self::ForeignMessage.DefaultInstance;
  83. public bool HasMsg {
  84. get { return hasMsg; }
  85. }
  86. public self::ForeignMessage Msg {
  87. get { return msg_; }
  88. }
  89. public static self::TestOptimizedForSize ParseFrom(pb::ByteString data) {
  90. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  91. }
  92. public static self::TestOptimizedForSize ParseFrom(pb::ByteString data,
  93. pb::ExtensionRegistry extensionRegistry) {
  94. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  95. .BuildParsed();
  96. }
  97. public static self::TestOptimizedForSize ParseFrom(byte[] data) {
  98. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  99. }
  100. public static self::TestOptimizedForSize ParseFrom(byte[] data,
  101. pb::ExtensionRegistry extensionRegistry) {
  102. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  103. .BuildParsed();
  104. }
  105. public static self::TestOptimizedForSize ParseFrom(global::System.IO.Stream input) {
  106. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  107. }
  108. public static self::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 self::TestOptimizedForSize ParseFrom(pb::CodedInputStream input) {
  115. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  116. }
  117. public static self::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 IBuilder<self::TestOptimizedForSize> CreateBuilderForType() { return new Builder(); }
  124. public static Builder CreateBuilder(self::TestOptimizedForSize prototype) {
  125. return (Builder) new Builder().MergeFrom(prototype);
  126. }
  127. public sealed partial class Builder : pb::ExtendableBuilder<self::TestOptimizedForSize, self::TestOptimizedForSize.Builder> {
  128. // Construct using self::TestOptimizedForSize.CreateBuilder()
  129. internal Builder() {}
  130. self::TestOptimizedForSize result = new self::TestOptimizedForSize();
  131. protected override self::TestOptimizedForSize MessageBeingBuilt {
  132. get { return result; }
  133. }
  134. public override IBuilder<self::TestOptimizedForSize> Clear() {
  135. result = new self::TestOptimizedForSize();
  136. return this;
  137. }
  138. public override IBuilder<self::TestOptimizedForSize> Clone() {
  139. return new Builder().MergeFrom(result);
  140. }
  141. public override pbd::MessageDescriptor DescriptorForType {
  142. get { return self::TestOptimizedForSize.Descriptor; }
  143. }
  144. public override self::TestOptimizedForSize DefaultInstanceForType {
  145. get { return self::TestOptimizedForSize.DefaultInstance; }
  146. }
  147. public override self::TestOptimizedForSize BuildPartial() {
  148. self::TestOptimizedForSize returnMe = result;
  149. result = null;
  150. return returnMe;
  151. }
  152. // optional int32 i = 1;
  153. public bool HasI {
  154. get { return result.HasI; }
  155. }
  156. public int I {
  157. get { return result.I; }
  158. set { SetI(value); }
  159. }
  160. public Builder SetI(int value) {
  161. result.hasI = true;
  162. result.i_ = value;
  163. return this;
  164. }
  165. public Builder ClearI() {
  166. result.hasI = false;
  167. result.i_ = 0;
  168. return this;
  169. }
  170. // optional .protobuf_unittest.ForeignMessage msg = 19;
  171. public bool HasMsg {
  172. get { return result.HasMsg; }
  173. }
  174. public self::ForeignMessage Msg {
  175. get { return result.Msg; }
  176. set { SetMsg(value); }
  177. }
  178. public Builder SetMsg(self::ForeignMessage value) {
  179. result.hasMsg = true;
  180. result.msg_ = value;
  181. return this;
  182. }
  183. public Builder SetMsg(self::ForeignMessage.Builder builderForValue) {
  184. result.hasMsg = true;
  185. result.msg_ = builderForValue.Build();
  186. return this;
  187. }
  188. public Builder MergeMsg(self::ForeignMessage value) {
  189. if (result.HasMsg &&
  190. result.msg_ != self::ForeignMessage.DefaultInstance) {
  191. result.msg_ =
  192. self::ForeignMessage.CreateBuilder(result.msg_).MergeFrom(value).BuildPartial();
  193. } else {
  194. result.msg_ = value;
  195. }
  196. result.hasMsg = true;
  197. return this;
  198. }
  199. public Builder ClearMsg() {
  200. result.hasMsg = false;
  201. result.msg_ = self::ForeignMessage.DefaultInstance;
  202. return this;
  203. }
  204. }
  205. }
  206. #endregion
  207. #region Services
  208. #endregion
  209. }