UnitTestEmbedOptimizeForProtoFile.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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 UnitTestEmbedOptimizeForProtoFile {
  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, 0x31, 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, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a,
  16. 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
  17. 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
  18. 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x70, 0x74,
  19. 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x01, 0x0a, 0x19,
  20. 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f,
  21. 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x6d, 0x65,
  22. 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
  23. 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69,
  24. 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x41, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x65,
  25. 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27,
  26. 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x54,
  27. 0x65, 0x73, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42,
  28. 0x4a, 0x48, 0x01, 0xc2, 0x3e, 0x21, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
  29. 0x6c, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca,
  30. 0x3e, 0x21, 0x55, 0x6e, 0x69, 0x74, 0x54, 0x65, 0x73, 0x74, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6d,
  31. 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65,
  32. }, new pbd::FileDescriptor[] {
  33. global::Google.ProtocolBuffers.TestProtos.UnitTestOptimizeForProtoFile.Descriptor,
  34. });
  35. #endregion
  36. #region Extensions
  37. #endregion
  38. #region Static variables
  39. internal static readonly pbd::MessageDescriptor internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor
  40. = Descriptor.MessageTypes[0];
  41. internal static pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder> internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable
  42. = new pb::FieldAccess.FieldAccessorTable<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Builder>(internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor,
  43. new string[] { "OptionalMessage", "RepeatedMessage", });
  44. #endregion
  45. }
  46. #region Enums
  47. #endregion
  48. #region Messages
  49. public sealed partial class TestEmbedOptimizedForSize : pb::GeneratedMessage<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> {
  50. private static readonly TestEmbedOptimizedForSize defaultInstance = new Builder().BuildPartial();
  51. public static TestEmbedOptimizedForSize DefaultInstance {
  52. get { return defaultInstance; }
  53. }
  54. public override TestEmbedOptimizedForSize DefaultInstanceForType {
  55. get { return defaultInstance; }
  56. }
  57. protected override TestEmbedOptimizedForSize ThisMessage {
  58. get { return this; }
  59. }
  60. public static pbd::MessageDescriptor Descriptor {
  61. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__Descriptor; }
  62. }
  63. protected override pb::FieldAccess.FieldAccessorTable<TestEmbedOptimizedForSize, TestEmbedOptimizedForSize.Builder> InternalFieldAccessors {
  64. get { return global::Google.ProtocolBuffers.TestProtos.UnitTestEmbedOptimizeForProtoFile.internal__static_protobuf_unittest_TestEmbedOptimizedForSize__FieldAccessorTable; }
  65. }
  66. // optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
  67. private bool hasOptionalMessage;
  68. private global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance;
  69. public bool HasOptionalMessage {
  70. get { return hasOptionalMessage; }
  71. }
  72. public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage {
  73. get { return optionalMessage_; }
  74. }
  75. // repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
  76. private pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> repeatedMessage_ = new pbc::PopsicleList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize>();
  77. public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList {
  78. get { return repeatedMessage_; }
  79. }
  80. public int RepeatedMessageCount
  81. { get { return repeatedMessage_.Count; }
  82. }
  83. public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) {
  84. return repeatedMessage_ [index];
  85. }
  86. public override bool IsInitialized {
  87. get {
  88. if (HasOptionalMessage) {
  89. if (!OptionalMessage.IsInitialized) return false;
  90. }
  91. foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) {
  92. if (!element.IsInitialized) return false;
  93. }
  94. return true;
  95. }
  96. }
  97. public override void WriteTo(pb::CodedOutputStream output) {
  98. if (HasOptionalMessage) {
  99. output.WriteMessage(1, OptionalMessage);
  100. }
  101. foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) {
  102. output.WriteMessage(2, element);
  103. }
  104. UnknownFields.WriteTo(output);
  105. }
  106. private int memoizedSerializedSize = -1;
  107. public override int SerializedSize {
  108. get {
  109. int size = memoizedSerializedSize;
  110. if (size != -1) return size;
  111. size = 0;
  112. if (HasOptionalMessage) {
  113. size += pb::CodedOutputStream.ComputeMessageSize(1, OptionalMessage);
  114. }
  115. foreach (global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize element in RepeatedMessageList) {
  116. size += pb::CodedOutputStream.ComputeMessageSize(2, element);
  117. }
  118. size += UnknownFields.SerializedSize;
  119. memoizedSerializedSize = size;
  120. return size;
  121. }
  122. }
  123. public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(pb::ByteString data) {
  124. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  125. }
  126. public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(pb::ByteString data,
  127. pb::ExtensionRegistry extensionRegistry) {
  128. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  129. .BuildParsed();
  130. }
  131. public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(byte[] data) {
  132. return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
  133. }
  134. public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(byte[] data,
  135. pb::ExtensionRegistry extensionRegistry) {
  136. return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry))
  137. .BuildParsed();
  138. }
  139. public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(global::System.IO.Stream input) {
  140. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  141. }
  142. public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(
  143. global::System.IO.Stream input,
  144. pb::ExtensionRegistry extensionRegistry) {
  145. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  146. .BuildParsed();
  147. }
  148. public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input) {
  149. return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
  150. }
  151. public static global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize ParseFrom(pb::CodedInputStream input,
  152. pb::ExtensionRegistry extensionRegistry) {
  153. return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry))
  154. .BuildParsed();
  155. }
  156. public static Builder CreateBuilder() { return new Builder(); }
  157. public override Builder CreateBuilderForType() { return new Builder(); }
  158. public static Builder CreateBuilder(global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize prototype) {
  159. return (Builder) new Builder().MergeFrom(prototype);
  160. }
  161. public sealed partial class Builder : pb::GeneratedBuilder<global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize, Builder> {
  162. protected override Builder ThisBuilder {
  163. get { return this; }
  164. }
  165. // Construct using global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.CreateBuilder()
  166. public Builder() {}
  167. global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize result = new global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize();
  168. protected override global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize MessageBeingBuilt {
  169. get { return result; }
  170. }
  171. public override Builder Clear() {
  172. result = new global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize();
  173. return this;
  174. }
  175. public override Builder Clone() {
  176. return new Builder().MergeFrom(result);
  177. }
  178. public override pbd::MessageDescriptor DescriptorForType {
  179. get { return global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.Descriptor; }
  180. }
  181. public override global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize DefaultInstanceForType {
  182. get { return global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.DefaultInstance; }
  183. }
  184. public override global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize BuildPartial() {
  185. result.repeatedMessage_.MakeReadOnly();
  186. global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize returnMe = result;
  187. result = null;
  188. return returnMe;
  189. }
  190. public override Builder MergeFrom(pb::IMessage other) {
  191. if (other is global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize) {
  192. return MergeFrom((global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize) other);
  193. } else {
  194. base.MergeFrom(other);
  195. return this;
  196. }
  197. }
  198. public override Builder MergeFrom(global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize other) {
  199. if (other == global::Google.ProtocolBuffers.TestProtos.TestEmbedOptimizedForSize.DefaultInstance) return this;
  200. if (other.HasOptionalMessage) {
  201. MergeOptionalMessage(other.OptionalMessage);
  202. }
  203. if (other.repeatedMessage_.Count != 0) {
  204. base.AddRange(other.repeatedMessage_, result.repeatedMessage_);
  205. }
  206. this.MergeUnknownFields(other.UnknownFields);
  207. return this;
  208. }
  209. public override Builder MergeFrom(pb::CodedInputStream input) {
  210. return MergeFrom(input, pb::ExtensionRegistry.Empty);
  211. }
  212. public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
  213. pb::UnknownFieldSet.Builder unknownFields =
  214. pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
  215. while (true) {
  216. uint tag = input.ReadTag();
  217. switch (tag) {
  218. case 0:
  219. this.UnknownFields = unknownFields.Build();
  220. return this;
  221. default: {
  222. if (!ParseUnknownField(input, unknownFields,
  223. extensionRegistry, tag)) {
  224. this.UnknownFields = unknownFields.Build();
  225. return this;
  226. }
  227. break;
  228. }
  229. case 10: {
  230. global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder();
  231. if (HasOptionalMessage) {
  232. subBuilder.MergeFrom(OptionalMessage);
  233. }
  234. input.ReadMessage(subBuilder, extensionRegistry);
  235. OptionalMessage = subBuilder.BuildPartial();
  236. break;
  237. }
  238. case 18: {
  239. global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder subBuilder = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder();
  240. input.ReadMessage(subBuilder, extensionRegistry);
  241. AddRepeatedMessage(subBuilder.BuildPartial());
  242. break;
  243. }
  244. }
  245. }
  246. }
  247. // optional .protobuf_unittest.TestOptimizedForSize optional_message = 1;
  248. public bool HasOptionalMessage {
  249. get { return result.HasOptionalMessage; }
  250. }
  251. public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize OptionalMessage {
  252. get { return result.OptionalMessage; }
  253. set { SetOptionalMessage(value); }
  254. }
  255. public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) {
  256. result.hasOptionalMessage = true;
  257. result.optionalMessage_ = value;
  258. return this;
  259. }
  260. public Builder SetOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) {
  261. result.hasOptionalMessage = true;
  262. result.optionalMessage_ = builderForValue.Build();
  263. return this;
  264. }
  265. public Builder MergeOptionalMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) {
  266. if (result.HasOptionalMessage &&
  267. result.optionalMessage_ != global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance) {
  268. result.optionalMessage_ =
  269. global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.CreateBuilder(result.optionalMessage_).MergeFrom(value).BuildPartial();
  270. } else {
  271. result.optionalMessage_ = value;
  272. }
  273. result.hasOptionalMessage = true;
  274. return this;
  275. }
  276. public Builder ClearOptionalMessage() {
  277. result.hasOptionalMessage = false;
  278. result.optionalMessage_ = global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.DefaultInstance;
  279. return this;
  280. }
  281. // repeated .protobuf_unittest.TestOptimizedForSize repeated_message = 2;
  282. public scg::IList<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> RepeatedMessageList {
  283. get { return result.repeatedMessage_; }
  284. }
  285. public int RepeatedMessageCount {
  286. get { return result.RepeatedMessageCount; }
  287. }
  288. public global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize GetRepeatedMessage(int index) {
  289. return result.GetRepeatedMessage(index);
  290. }
  291. public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) {
  292. result.repeatedMessage_[index] = value;
  293. return this;
  294. }
  295. public Builder SetRepeatedMessage(int index, global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) {
  296. result.repeatedMessage_[index] = builderForValue.Build();
  297. return this;
  298. }
  299. public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize value) {
  300. result.repeatedMessage_.Add(value);
  301. return this;
  302. }
  303. public Builder AddRepeatedMessage(global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize.Builder builderForValue) {
  304. result.repeatedMessage_.Add(builderForValue.Build());
  305. return this;
  306. }
  307. public Builder AddRangeRepeatedMessage(scg::IEnumerable<global::Google.ProtocolBuffers.TestProtos.TestOptimizedForSize> values) {
  308. base.AddRange(values, result.repeatedMessage_);
  309. return this;
  310. }
  311. public Builder ClearRepeatedMessage() {
  312. result.repeatedMessage_.Clear();
  313. return this;
  314. }
  315. }
  316. }
  317. #endregion
  318. #region Services
  319. #endregion
  320. }