UnitTestOptimizeForProtoFile.cs 10.0 KB

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