xref: /aosp_15_r20/external/cronet/third_party/protobuf/csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // <auto-generated>
2 //     Generated by the protocol buffer compiler.  DO NOT EDIT!
3 //     source: benchmarks.proto
4 // </auto-generated>
5 #pragma warning disable 1591, 0612, 3021, 8981
6 #region Designer generated code
7 
8 using pb = global::Google.Protobuf;
9 using pbc = global::Google.Protobuf.Collections;
10 using pbr = global::Google.Protobuf.Reflection;
11 using scg = global::System.Collections.Generic;
12 namespace Benchmarks {
13 
14   /// <summary>Holder for reflection information generated from benchmarks.proto</summary>
15   public static partial class BenchmarksReflection {
16 
17     #region Descriptor
18     /// <summary>File descriptor for benchmarks.proto</summary>
19     public static pbr::FileDescriptor Descriptor {
20       get { return descriptor; }
21     }
22     private static pbr::FileDescriptor descriptor;
23 
BenchmarksReflection()24     static BenchmarksReflection() {
25       byte[] descriptorData = global::System.Convert.FromBase64String(
26           string.Concat(
27             "ChBiZW5jaG1hcmtzLnByb3RvEgpiZW5jaG1hcmtzIkcKEEJlbmNobWFya0Rh",
28             "dGFzZXQSDAoEbmFtZRgBIAEoCRIUCgxtZXNzYWdlX25hbWUYAiABKAkSDwoH",
29             "cGF5bG9hZBgDIAMoDEIgCh5jb20uZ29vZ2xlLnByb3RvYnVmLmJlbmNobWFy",
30             "a3NiBnByb3RvMw=="));
31       descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
32           new pbr::FileDescriptor[] { },
33           new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
34             new pbr::GeneratedClrTypeInfo(typeof(global::Benchmarks.BenchmarkDataset), global::Benchmarks.BenchmarkDataset.Parser, new[]{ "Name", "MessageName", "Payload" }, null, null, null, null)
35           }));
36     }
37     #endregion
38 
39   }
40   #region Messages
41   public sealed partial class BenchmarkDataset : pb::IMessage<BenchmarkDataset>
42   #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
43       , pb::IBufferMessage
44   #endif
45   {
46     private static readonly pb::MessageParser<BenchmarkDataset> _parser = new pb::MessageParser<BenchmarkDataset>(() => new BenchmarkDataset());
47     private pb::UnknownFieldSet _unknownFields;
48     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
49     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
50     public static pb::MessageParser<BenchmarkDataset> Parser { get { return _parser; } }
51 
52     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
53     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
54     public static pbr::MessageDescriptor Descriptor {
55       get { return global::Benchmarks.BenchmarksReflection.Descriptor.MessageTypes[0]; }
56     }
57 
58     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
59     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
60     pbr::MessageDescriptor pb::IMessage.Descriptor {
61       get { return Descriptor; }
62     }
63 
64     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
65     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
BenchmarkDataset()66     public BenchmarkDataset() {
67       OnConstruction();
68     }
69 
OnConstruction()70     partial void OnConstruction();
71 
72     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
73     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
BenchmarkDataset(BenchmarkDataset other)74     public BenchmarkDataset(BenchmarkDataset other) : this() {
75       name_ = other.name_;
76       messageName_ = other.messageName_;
77       payload_ = other.payload_.Clone();
78       _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
79     }
80 
81     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
82     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Clone()83     public BenchmarkDataset Clone() {
84       return new BenchmarkDataset(this);
85     }
86 
87     /// <summary>Field number for the "name" field.</summary>
88     public const int NameFieldNumber = 1;
89     private string name_ = "";
90     /// <summary>
91     /// Name of the benchmark dataset.  This should be unique across all datasets.
92     /// Should only contain word characters: [a-zA-Z0-9_]
93     /// </summary>
94     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
95     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
96     public string Name {
97       get { return name_; }
98       set {
99         name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
100       }
101     }
102 
103     /// <summary>Field number for the "message_name" field.</summary>
104     public const int MessageNameFieldNumber = 2;
105     private string messageName_ = "";
106     /// <summary>
107     /// Fully-qualified name of the protobuf message for this dataset.
108     /// It will be one of the messages defined benchmark_messages_proto2.proto
109     /// or benchmark_messages_proto3.proto.
110     ///
111     /// Implementations that do not support reflection can implement this with
112     /// an explicit "if/else" chain that lists every known message defined
113     /// in those files.
114     /// </summary>
115     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
116     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
117     public string MessageName {
118       get { return messageName_; }
119       set {
120         messageName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
121       }
122     }
123 
124     /// <summary>Field number for the "payload" field.</summary>
125     public const int PayloadFieldNumber = 3;
126     private static readonly pb::FieldCodec<pb::ByteString> _repeated_payload_codec
127         = pb::FieldCodec.ForBytes(26);
128     private readonly pbc::RepeatedField<pb::ByteString> payload_ = new pbc::RepeatedField<pb::ByteString>();
129     /// <summary>
130     /// The payload(s) for this dataset.  They should be parsed or serialized
131     /// in sequence, in a loop, ie.
132     ///
133     ///  while (!benchmarkDone) {  // Benchmark runner decides when to exit.
134     ///    for (i = 0; i &lt; benchmark.payload.length; i++) {
135     ///      parse(benchmark.payload[i])
136     ///    }
137     ///  }
138     ///
139     /// This is intended to let datasets include a variety of data to provide
140     /// potentially more realistic results than just parsing the same message
141     /// over and over.  A single message parsed repeatedly could yield unusually
142     /// good branch prediction performance.
143     /// </summary>
144     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
145     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
146     public pbc::RepeatedField<pb::ByteString> Payload {
147       get { return payload_; }
148     }
149 
150     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
151     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(object other)152     public override bool Equals(object other) {
153       return Equals(other as BenchmarkDataset);
154     }
155 
156     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
157     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
Equals(BenchmarkDataset other)158     public bool Equals(BenchmarkDataset other) {
159       if (ReferenceEquals(other, null)) {
160         return false;
161       }
162       if (ReferenceEquals(other, this)) {
163         return true;
164       }
165       if (Name != other.Name) return false;
166       if (MessageName != other.MessageName) return false;
167       if(!payload_.Equals(other.payload_)) return false;
168       return Equals(_unknownFields, other._unknownFields);
169     }
170 
171     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
172     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
GetHashCode()173     public override int GetHashCode() {
174       int hash = 1;
175       if (Name.Length != 0) hash ^= Name.GetHashCode();
176       if (MessageName.Length != 0) hash ^= MessageName.GetHashCode();
177       hash ^= payload_.GetHashCode();
178       if (_unknownFields != null) {
179         hash ^= _unknownFields.GetHashCode();
180       }
181       return hash;
182     }
183 
184     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
185     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
ToString()186     public override string ToString() {
187       return pb::JsonFormatter.ToDiagnosticString(this);
188     }
189 
190     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
191     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
WriteTo(pb::CodedOutputStream output)192     public void WriteTo(pb::CodedOutputStream output) {
193     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
194       output.WriteRawMessage(this);
195     #else
196       if (Name.Length != 0) {
197         output.WriteRawTag(10);
198         output.WriteString(Name);
199       }
200       if (MessageName.Length != 0) {
201         output.WriteRawTag(18);
202         output.WriteString(MessageName);
203       }
204       payload_.WriteTo(output, _repeated_payload_codec);
205       if (_unknownFields != null) {
206         _unknownFields.WriteTo(output);
207       }
208     #endif
209     }
210 
211     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
212     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
213     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalWriteTo(ref pb::WriteContext output)214     void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
215       if (Name.Length != 0) {
216         output.WriteRawTag(10);
217         output.WriteString(Name);
218       }
219       if (MessageName.Length != 0) {
220         output.WriteRawTag(18);
221         output.WriteString(MessageName);
222       }
223       payload_.WriteTo(ref output, _repeated_payload_codec);
224       if (_unknownFields != null) {
225         _unknownFields.WriteTo(ref output);
226       }
227     }
228     #endif
229 
230     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
231     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
CalculateSize()232     public int CalculateSize() {
233       int size = 0;
234       if (Name.Length != 0) {
235         size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
236       }
237       if (MessageName.Length != 0) {
238         size += 1 + pb::CodedOutputStream.ComputeStringSize(MessageName);
239       }
240       size += payload_.CalculateSize(_repeated_payload_codec);
241       if (_unknownFields != null) {
242         size += _unknownFields.CalculateSize();
243       }
244       return size;
245     }
246 
247     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
248     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(BenchmarkDataset other)249     public void MergeFrom(BenchmarkDataset other) {
250       if (other == null) {
251         return;
252       }
253       if (other.Name.Length != 0) {
254         Name = other.Name;
255       }
256       if (other.MessageName.Length != 0) {
257         MessageName = other.MessageName;
258       }
259       payload_.Add(other.payload_);
260       _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
261     }
262 
263     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
264     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
MergeFrom(pb::CodedInputStream input)265     public void MergeFrom(pb::CodedInputStream input) {
266     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
267       input.ReadRawMessage(this);
268     #else
269       uint tag;
270       while ((tag = input.ReadTag()) != 0) {
271         switch(tag) {
272           default:
273             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
274             break;
275           case 10: {
276             Name = input.ReadString();
277             break;
278           }
279           case 18: {
280             MessageName = input.ReadString();
281             break;
282           }
283           case 26: {
284             payload_.AddEntriesFrom(input, _repeated_payload_codec);
285             break;
286           }
287         }
288       }
289     #endif
290     }
291 
292     #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
293     [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
294     [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)295     void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
296       uint tag;
297       while ((tag = input.ReadTag()) != 0) {
298         switch(tag) {
299           default:
300             _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
301             break;
302           case 10: {
303             Name = input.ReadString();
304             break;
305           }
306           case 18: {
307             MessageName = input.ReadString();
308             break;
309           }
310           case 26: {
311             payload_.AddEntriesFrom(ref input, _repeated_payload_codec);
312             break;
313           }
314         }
315       }
316     }
317     #endif
318 
319   }
320 
321   #endregion
322 
323 }
324 
325 #endregion Designer generated code
326