UnittestSelfreferentialOptions.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: unittest_selfreferential_options.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace UnitTest.Issues.TestProtos.SelfreferentialOptions {
  12. /// <summary>Holder for reflection information generated from unittest_selfreferential_options.proto</summary>
  13. public static partial class UnittestSelfreferentialOptionsReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for unittest_selfreferential_options.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static UnittestSelfreferentialOptionsReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "CiZ1bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxfb3B0aW9ucy5wcm90bxIpcHJv",
  24. "dG9idWZfdW5pdHRlc3Rfc2VsZnJlZmVyZW50aWFsX29wdGlvbnMaIGdvb2ds",
  25. "ZS9wcm90b2J1Zi9kZXNjcmlwdG9yLnByb3RvIkwKCkZvb09wdGlvbnMSHgoH",
  26. "aW50X29wdBgBIAEoBUINyj4KCAHAPgLKPgIIAxITCgNmb28YAiABKAVCBso+",
  27. "AxDSCSoJCOgHEICAgIACOjkKC2Jhcl9vcHRpb25zEh0uZ29vZ2xlLnByb3Rv",
  28. "YnVmLkZpZWxkT3B0aW9ucxjoByABKAVCBMA+0gk6agoLZm9vX29wdGlvbnMS",
  29. "HS5nb29nbGUucHJvdG9idWYuRmllbGRPcHRpb25zGOkHIAEoCzI1LnByb3Rv",
  30. "YnVmX3VuaXR0ZXN0X3NlbGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlv",
  31. "bnM6SwoLZm9vX2ludF9vcHQSNS5wcm90b2J1Zl91bml0dGVzdF9zZWxmcmVm",
  32. "ZXJlbnRpYWxfb3B0aW9ucy5Gb29PcHRpb25zGOgHIAEoBTqCAQoLZm9vX2Zv",
  33. "b19vcHQSNS5wcm90b2J1Zl91bml0dGVzdF9zZWxmcmVmZXJlbnRpYWxfb3B0",
  34. "aW9ucy5Gb29PcHRpb25zGOkHIAEoCzI1LnByb3RvYnVmX3VuaXR0ZXN0X3Nl",
  35. "bGZyZWZlcmVudGlhbF9vcHRpb25zLkZvb09wdGlvbnNCNKoCMVVuaXRUZXN0",
  36. "Lklzc3Vlcy5UZXN0UHJvdG9zLlNlbGZyZWZlcmVudGlhbE9wdGlvbnM="));
  37. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  38. new pbr::FileDescriptor[] { global::Google.Protobuf.Reflection.DescriptorReflection.Descriptor, },
  39. new pbr::GeneratedClrTypeInfo(null, new pb::Extension[] { UnittestSelfreferentialOptionsExtensions.BarOptions, UnittestSelfreferentialOptionsExtensions.FooOptions, UnittestSelfreferentialOptionsExtensions.FooIntOpt, UnittestSelfreferentialOptionsExtensions.FooFooOpt }, new pbr::GeneratedClrTypeInfo[] {
  40. new pbr::GeneratedClrTypeInfo(typeof(global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions), global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser, new[]{ "IntOpt", "Foo" }, null, null, null, null)
  41. }));
  42. }
  43. #endregion
  44. }
  45. /// <summary>Holder for extension identifiers generated from the top level of unittest_selfreferential_options.proto</summary>
  46. public static partial class UnittestSelfreferentialOptionsExtensions {
  47. /// <summary>
  48. /// Custom field option used on the definition of that field option.
  49. /// </summary>
  50. public static readonly pb::Extension<global::Google.Protobuf.Reflection.FieldOptions, int> BarOptions =
  51. new pb::Extension<global::Google.Protobuf.Reflection.FieldOptions, int>(1000, pb::FieldCodec.ForInt32(8000, 0));
  52. public static readonly pb::Extension<global::Google.Protobuf.Reflection.FieldOptions, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions> FooOptions =
  53. new pb::Extension<global::Google.Protobuf.Reflection.FieldOptions, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions>(1001, pb::FieldCodec.ForMessage(8010, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser));
  54. public static readonly pb::Extension<global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions, int> FooIntOpt =
  55. new pb::Extension<global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions, int>(1000, pb::FieldCodec.ForInt32(8000, 0));
  56. public static readonly pb::Extension<global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions> FooFooOpt =
  57. new pb::Extension<global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions>(1001, pb::FieldCodec.ForMessage(8010, global::UnitTest.Issues.TestProtos.SelfreferentialOptions.FooOptions.Parser));
  58. }
  59. #region Messages
  60. public sealed partial class FooOptions : pb::IExtendableMessage<FooOptions>
  61. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  62. , pb::IBufferMessage
  63. #endif
  64. {
  65. private static readonly pb::MessageParser<FooOptions> _parser = new pb::MessageParser<FooOptions>(() => new FooOptions());
  66. private pb::UnknownFieldSet _unknownFields;
  67. private pb::ExtensionSet<FooOptions> _extensions;
  68. private pb::ExtensionSet<FooOptions> _Extensions { get { return _extensions; } }
  69. private int _hasBits0;
  70. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  71. public static pb::MessageParser<FooOptions> Parser { get { return _parser; } }
  72. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  73. public static pbr::MessageDescriptor Descriptor {
  74. get { return global::UnitTest.Issues.TestProtos.SelfreferentialOptions.UnittestSelfreferentialOptionsReflection.Descriptor.MessageTypes[0]; }
  75. }
  76. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  77. pbr::MessageDescriptor pb::IMessage.Descriptor {
  78. get { return Descriptor; }
  79. }
  80. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  81. public FooOptions() {
  82. OnConstruction();
  83. }
  84. partial void OnConstruction();
  85. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  86. public FooOptions(FooOptions other) : this() {
  87. _hasBits0 = other._hasBits0;
  88. intOpt_ = other.intOpt_;
  89. foo_ = other.foo_;
  90. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  91. _extensions = pb::ExtensionSet.Clone(other._extensions);
  92. }
  93. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  94. public FooOptions Clone() {
  95. return new FooOptions(this);
  96. }
  97. /// <summary>Field number for the "int_opt" field.</summary>
  98. public const int IntOptFieldNumber = 1;
  99. private readonly static int IntOptDefaultValue = 0;
  100. private int intOpt_;
  101. /// <summary>
  102. /// Custom field option used in definition of the extension message.
  103. /// </summary>
  104. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  105. public int IntOpt {
  106. get { if ((_hasBits0 & 1) != 0) { return intOpt_; } else { return IntOptDefaultValue; } }
  107. set {
  108. _hasBits0 |= 1;
  109. intOpt_ = value;
  110. }
  111. }
  112. /// <summary>Gets whether the "int_opt" field is set</summary>
  113. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  114. public bool HasIntOpt {
  115. get { return (_hasBits0 & 1) != 0; }
  116. }
  117. /// <summary>Clears the value of the "int_opt" field</summary>
  118. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  119. public void ClearIntOpt() {
  120. _hasBits0 &= ~1;
  121. }
  122. /// <summary>Field number for the "foo" field.</summary>
  123. public const int FooFieldNumber = 2;
  124. private readonly static int FooDefaultValue = 0;
  125. private int foo_;
  126. /// <summary>
  127. /// Custom field option used in definition of the custom option's message.
  128. /// </summary>
  129. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  130. public int Foo {
  131. get { if ((_hasBits0 & 2) != 0) { return foo_; } else { return FooDefaultValue; } }
  132. set {
  133. _hasBits0 |= 2;
  134. foo_ = value;
  135. }
  136. }
  137. /// <summary>Gets whether the "foo" field is set</summary>
  138. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  139. public bool HasFoo {
  140. get { return (_hasBits0 & 2) != 0; }
  141. }
  142. /// <summary>Clears the value of the "foo" field</summary>
  143. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  144. public void ClearFoo() {
  145. _hasBits0 &= ~2;
  146. }
  147. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  148. public override bool Equals(object other) {
  149. return Equals(other as FooOptions);
  150. }
  151. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  152. public bool Equals(FooOptions other) {
  153. if (ReferenceEquals(other, null)) {
  154. return false;
  155. }
  156. if (ReferenceEquals(other, this)) {
  157. return true;
  158. }
  159. if (IntOpt != other.IntOpt) return false;
  160. if (Foo != other.Foo) return false;
  161. if (!Equals(_extensions, other._extensions)) {
  162. return false;
  163. }
  164. return Equals(_unknownFields, other._unknownFields);
  165. }
  166. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  167. public override int GetHashCode() {
  168. int hash = 1;
  169. if (HasIntOpt) hash ^= IntOpt.GetHashCode();
  170. if (HasFoo) hash ^= Foo.GetHashCode();
  171. if (_extensions != null) {
  172. hash ^= _extensions.GetHashCode();
  173. }
  174. if (_unknownFields != null) {
  175. hash ^= _unknownFields.GetHashCode();
  176. }
  177. return hash;
  178. }
  179. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  180. public override string ToString() {
  181. return pb::JsonFormatter.ToDiagnosticString(this);
  182. }
  183. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  184. public void WriteTo(pb::CodedOutputStream output) {
  185. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  186. output.WriteRawMessage(this);
  187. #else
  188. if (HasIntOpt) {
  189. output.WriteRawTag(8);
  190. output.WriteInt32(IntOpt);
  191. }
  192. if (HasFoo) {
  193. output.WriteRawTag(16);
  194. output.WriteInt32(Foo);
  195. }
  196. if (_extensions != null) {
  197. _extensions.WriteTo(output);
  198. }
  199. if (_unknownFields != null) {
  200. _unknownFields.WriteTo(output);
  201. }
  202. #endif
  203. }
  204. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  205. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  206. void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
  207. if (HasIntOpt) {
  208. output.WriteRawTag(8);
  209. output.WriteInt32(IntOpt);
  210. }
  211. if (HasFoo) {
  212. output.WriteRawTag(16);
  213. output.WriteInt32(Foo);
  214. }
  215. if (_extensions != null) {
  216. _extensions.WriteTo(ref output);
  217. }
  218. if (_unknownFields != null) {
  219. _unknownFields.WriteTo(ref output);
  220. }
  221. }
  222. #endif
  223. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  224. public int CalculateSize() {
  225. int size = 0;
  226. if (HasIntOpt) {
  227. size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntOpt);
  228. }
  229. if (HasFoo) {
  230. size += 1 + pb::CodedOutputStream.ComputeInt32Size(Foo);
  231. }
  232. if (_extensions != null) {
  233. size += _extensions.CalculateSize();
  234. }
  235. if (_unknownFields != null) {
  236. size += _unknownFields.CalculateSize();
  237. }
  238. return size;
  239. }
  240. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  241. public void MergeFrom(FooOptions other) {
  242. if (other == null) {
  243. return;
  244. }
  245. if (other.HasIntOpt) {
  246. IntOpt = other.IntOpt;
  247. }
  248. if (other.HasFoo) {
  249. Foo = other.Foo;
  250. }
  251. pb::ExtensionSet.MergeFrom(ref _extensions, other._extensions);
  252. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  253. }
  254. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  255. public void MergeFrom(pb::CodedInputStream input) {
  256. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  257. input.ReadRawMessage(this);
  258. #else
  259. uint tag;
  260. while ((tag = input.ReadTag()) != 0) {
  261. switch(tag) {
  262. default:
  263. if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, input)) {
  264. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  265. }
  266. break;
  267. case 8: {
  268. IntOpt = input.ReadInt32();
  269. break;
  270. }
  271. case 16: {
  272. Foo = input.ReadInt32();
  273. break;
  274. }
  275. }
  276. }
  277. #endif
  278. }
  279. #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
  280. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  281. void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
  282. uint tag;
  283. while ((tag = input.ReadTag()) != 0) {
  284. switch(tag) {
  285. default:
  286. if (!pb::ExtensionSet.TryMergeFieldFrom(ref _extensions, ref input)) {
  287. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
  288. }
  289. break;
  290. case 8: {
  291. IntOpt = input.ReadInt32();
  292. break;
  293. }
  294. case 16: {
  295. Foo = input.ReadInt32();
  296. break;
  297. }
  298. }
  299. }
  300. }
  301. #endif
  302. public TValue GetExtension<TValue>(pb::Extension<FooOptions, TValue> extension) {
  303. return pb::ExtensionSet.Get(ref _extensions, extension);
  304. }
  305. public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<FooOptions, TValue> extension) {
  306. return pb::ExtensionSet.Get(ref _extensions, extension);
  307. }
  308. public pbc::RepeatedField<TValue> GetOrInitializeExtension<TValue>(pb::RepeatedExtension<FooOptions, TValue> extension) {
  309. return pb::ExtensionSet.GetOrInitialize(ref _extensions, extension);
  310. }
  311. public void SetExtension<TValue>(pb::Extension<FooOptions, TValue> extension, TValue value) {
  312. pb::ExtensionSet.Set(ref _extensions, extension, value);
  313. }
  314. public bool HasExtension<TValue>(pb::Extension<FooOptions, TValue> extension) {
  315. return pb::ExtensionSet.Has(ref _extensions, extension);
  316. }
  317. public void ClearExtension<TValue>(pb::Extension<FooOptions, TValue> extension) {
  318. pb::ExtensionSet.Clear(ref _extensions, extension);
  319. }
  320. public void ClearExtension<TValue>(pb::RepeatedExtension<FooOptions, TValue> extension) {
  321. pb::ExtensionSet.Clear(ref _extensions, extension);
  322. }
  323. }
  324. #endregion
  325. }
  326. #endregion Designer generated code