Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/grpc/examples/csharp/route_guide/RouteGuide/RouteGuide.cs

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: route_guide.proto
3 #pragma warning disable 1591, 0612, 3021
4 #region Designer generated code
5
6 using pb = global::Google.Protobuf;
7 using pbc = global::Google.Protobuf.Collections;
8 using pbr = global::Google.Protobuf.Reflection;
9 using scg = global::System.Collections.Generic;
10 namespace Routeguide {
11
12 /// <summary>Holder for reflection information generated from route_guide.prot o</summary>
13 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
14 public static partial class RouteGuideReflection {
15
16 #region Descriptor
17 /// <summary>File descriptor for route_guide.proto</summary>
18 public static pbr::FileDescriptor Descriptor {
19 get { return descriptor; }
20 }
21 private static pbr::FileDescriptor descriptor;
22
23 static RouteGuideReflection() {
24 byte[] descriptorData = global::System.Convert.FromBase64String(
25 string.Concat(
26 "ChFyb3V0ZV9ndWlkZS5wcm90bxIKcm91dGVndWlkZSIsCgVQb2ludBIQCghs",
27 "YXRpdHVkZRgBIAEoBRIRCglsb25naXR1ZGUYAiABKAUiSQoJUmVjdGFuZ2xl",
28 "Eh0KAmxvGAEgASgLMhEucm91dGVndWlkZS5Qb2ludBIdCgJoaRgCIAEoCzIR",
29 "LnJvdXRlZ3VpZGUuUG9pbnQiPAoHRmVhdHVyZRIMCgRuYW1lGAEgASgJEiMK",
30 "CGxvY2F0aW9uGAIgASgLMhEucm91dGVndWlkZS5Qb2ludCJBCglSb3V0ZU5v",
31 "dGUSIwoIbG9jYXRpb24YASABKAsyES5yb3V0ZWd1aWRlLlBvaW50Eg8KB21l",
32 "c3NhZ2UYAiABKAkiYgoMUm91dGVTdW1tYXJ5EhMKC3BvaW50X2NvdW50GAEg",
33 "ASgFEhUKDWZlYXR1cmVfY291bnQYAiABKAUSEAoIZGlzdGFuY2UYAyABKAUS",
34 "FAoMZWxhcHNlZF90aW1lGAQgASgFMoUCCgpSb3V0ZUd1aWRlEjYKCkdldEZl",
35 "YXR1cmUSES5yb3V0ZWd1aWRlLlBvaW50GhMucm91dGVndWlkZS5GZWF0dXJl",
36 "IgASPgoMTGlzdEZlYXR1cmVzEhUucm91dGVndWlkZS5SZWN0YW5nbGUaEy5y",
37 "b3V0ZWd1aWRlLkZlYXR1cmUiADABEj4KC1JlY29yZFJvdXRlEhEucm91dGVn",
38 "dWlkZS5Qb2ludBoYLnJvdXRlZ3VpZGUuUm91dGVTdW1tYXJ5IgAoARI/CglS",
39 "b3V0ZUNoYXQSFS5yb3V0ZWd1aWRlLlJvdXRlTm90ZRoVLnJvdXRlZ3VpZGUu",
40 "Um91dGVOb3RlIgAoATABQg8KB2V4LmdycGOiAgNSVEdiBnByb3RvMw=="));
41 descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
42 new pbr::FileDescriptor[] { },
43 new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
44 new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Point), global: :Routeguide.Point.Parser, new[]{ "Latitude", "Longitude" }, null, null, null),
45 new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Rectangle), glo bal::Routeguide.Rectangle.Parser, new[]{ "Lo", "Hi" }, null, null, null),
46 new pbr::GeneratedCodeInfo(typeof(global::Routeguide.Feature), globa l::Routeguide.Feature.Parser, new[]{ "Name", "Location" }, null, null, null),
47 new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteNote), glo bal::Routeguide.RouteNote.Parser, new[]{ "Location", "Message" }, null, null, nu ll),
48 new pbr::GeneratedCodeInfo(typeof(global::Routeguide.RouteSummary), global::Routeguide.RouteSummary.Parser, new[]{ "PointCount", "FeatureCount", "Di stance", "ElapsedTime" }, null, null, null)
49 }));
50 }
51 #endregion
52
53 }
54 #region Messages
55 /// <summary>
56 /// Points are represented as latitude-longitude pairs in the E7 representati on
57 /// (degrees multiplied by 10**7 and rounded to the nearest integer).
58 /// Latitudes should be in the range +/- 90 degrees and longitude should be i n
59 /// the range +/- 180 degrees (inclusive).
60 /// </summary>
61 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
62 public sealed partial class Point : pb::IMessage<Point> {
63 private static readonly pb::MessageParser<Point> _parser = new pb::MessagePa rser<Point>(() => new Point());
64 public static pb::MessageParser<Point> Parser { get { return _parser; } }
65
66 public static pbr::MessageDescriptor Descriptor {
67 get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTyp es[0]; }
68 }
69
70 pbr::MessageDescriptor pb::IMessage.Descriptor {
71 get { return Descriptor; }
72 }
73
74 public Point() {
75 OnConstruction();
76 }
77
78 partial void OnConstruction();
79
80 public Point(Point other) : this() {
81 latitude_ = other.latitude_;
82 longitude_ = other.longitude_;
83 }
84
85 public Point Clone() {
86 return new Point(this);
87 }
88
89 /// <summary>Field number for the "latitude" field.</summary>
90 public const int LatitudeFieldNumber = 1;
91 private int latitude_;
92 public int Latitude {
93 get { return latitude_; }
94 set {
95 latitude_ = value;
96 }
97 }
98
99 /// <summary>Field number for the "longitude" field.</summary>
100 public const int LongitudeFieldNumber = 2;
101 private int longitude_;
102 public int Longitude {
103 get { return longitude_; }
104 set {
105 longitude_ = value;
106 }
107 }
108
109 public override bool Equals(object other) {
110 return Equals(other as Point);
111 }
112
113 public bool Equals(Point other) {
114 if (ReferenceEquals(other, null)) {
115 return false;
116 }
117 if (ReferenceEquals(other, this)) {
118 return true;
119 }
120 if (Latitude != other.Latitude) return false;
121 if (Longitude != other.Longitude) return false;
122 return true;
123 }
124
125 public override int GetHashCode() {
126 int hash = 1;
127 if (Latitude != 0) hash ^= Latitude.GetHashCode();
128 if (Longitude != 0) hash ^= Longitude.GetHashCode();
129 return hash;
130 }
131
132 public override string ToString() {
133 return pb::JsonFormatter.ToDiagnosticString(this);
134 }
135
136 public void WriteTo(pb::CodedOutputStream output) {
137 if (Latitude != 0) {
138 output.WriteRawTag(8);
139 output.WriteInt32(Latitude);
140 }
141 if (Longitude != 0) {
142 output.WriteRawTag(16);
143 output.WriteInt32(Longitude);
144 }
145 }
146
147 public int CalculateSize() {
148 int size = 0;
149 if (Latitude != 0) {
150 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Latitude);
151 }
152 if (Longitude != 0) {
153 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Longitude);
154 }
155 return size;
156 }
157
158 public void MergeFrom(Point other) {
159 if (other == null) {
160 return;
161 }
162 if (other.Latitude != 0) {
163 Latitude = other.Latitude;
164 }
165 if (other.Longitude != 0) {
166 Longitude = other.Longitude;
167 }
168 }
169
170 public void MergeFrom(pb::CodedInputStream input) {
171 uint tag;
172 while ((tag = input.ReadTag()) != 0) {
173 switch(tag) {
174 default:
175 input.SkipLastField();
176 break;
177 case 8: {
178 Latitude = input.ReadInt32();
179 break;
180 }
181 case 16: {
182 Longitude = input.ReadInt32();
183 break;
184 }
185 }
186 }
187 }
188
189 }
190
191 /// <summary>
192 /// A latitude-longitude rectangle, represented as two diagonally opposite
193 /// points "lo" and "hi".
194 /// </summary>
195 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
196 public sealed partial class Rectangle : pb::IMessage<Rectangle> {
197 private static readonly pb::MessageParser<Rectangle> _parser = new pb::Messa geParser<Rectangle>(() => new Rectangle());
198 public static pb::MessageParser<Rectangle> Parser { get { return _parser; } }
199
200 public static pbr::MessageDescriptor Descriptor {
201 get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTyp es[1]; }
202 }
203
204 pbr::MessageDescriptor pb::IMessage.Descriptor {
205 get { return Descriptor; }
206 }
207
208 public Rectangle() {
209 OnConstruction();
210 }
211
212 partial void OnConstruction();
213
214 public Rectangle(Rectangle other) : this() {
215 Lo = other.lo_ != null ? other.Lo.Clone() : null;
216 Hi = other.hi_ != null ? other.Hi.Clone() : null;
217 }
218
219 public Rectangle Clone() {
220 return new Rectangle(this);
221 }
222
223 /// <summary>Field number for the "lo" field.</summary>
224 public const int LoFieldNumber = 1;
225 private global::Routeguide.Point lo_;
226 /// <summary>
227 /// One corner of the rectangle.
228 /// </summary>
229 public global::Routeguide.Point Lo {
230 get { return lo_; }
231 set {
232 lo_ = value;
233 }
234 }
235
236 /// <summary>Field number for the "hi" field.</summary>
237 public const int HiFieldNumber = 2;
238 private global::Routeguide.Point hi_;
239 /// <summary>
240 /// The other corner of the rectangle.
241 /// </summary>
242 public global::Routeguide.Point Hi {
243 get { return hi_; }
244 set {
245 hi_ = value;
246 }
247 }
248
249 public override bool Equals(object other) {
250 return Equals(other as Rectangle);
251 }
252
253 public bool Equals(Rectangle other) {
254 if (ReferenceEquals(other, null)) {
255 return false;
256 }
257 if (ReferenceEquals(other, this)) {
258 return true;
259 }
260 if (!object.Equals(Lo, other.Lo)) return false;
261 if (!object.Equals(Hi, other.Hi)) return false;
262 return true;
263 }
264
265 public override int GetHashCode() {
266 int hash = 1;
267 if (lo_ != null) hash ^= Lo.GetHashCode();
268 if (hi_ != null) hash ^= Hi.GetHashCode();
269 return hash;
270 }
271
272 public override string ToString() {
273 return pb::JsonFormatter.ToDiagnosticString(this);
274 }
275
276 public void WriteTo(pb::CodedOutputStream output) {
277 if (lo_ != null) {
278 output.WriteRawTag(10);
279 output.WriteMessage(Lo);
280 }
281 if (hi_ != null) {
282 output.WriteRawTag(18);
283 output.WriteMessage(Hi);
284 }
285 }
286
287 public int CalculateSize() {
288 int size = 0;
289 if (lo_ != null) {
290 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Lo);
291 }
292 if (hi_ != null) {
293 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Hi);
294 }
295 return size;
296 }
297
298 public void MergeFrom(Rectangle other) {
299 if (other == null) {
300 return;
301 }
302 if (other.lo_ != null) {
303 if (lo_ == null) {
304 lo_ = new global::Routeguide.Point();
305 }
306 Lo.MergeFrom(other.Lo);
307 }
308 if (other.hi_ != null) {
309 if (hi_ == null) {
310 hi_ = new global::Routeguide.Point();
311 }
312 Hi.MergeFrom(other.Hi);
313 }
314 }
315
316 public void MergeFrom(pb::CodedInputStream input) {
317 uint tag;
318 while ((tag = input.ReadTag()) != 0) {
319 switch(tag) {
320 default:
321 input.SkipLastField();
322 break;
323 case 10: {
324 if (lo_ == null) {
325 lo_ = new global::Routeguide.Point();
326 }
327 input.ReadMessage(lo_);
328 break;
329 }
330 case 18: {
331 if (hi_ == null) {
332 hi_ = new global::Routeguide.Point();
333 }
334 input.ReadMessage(hi_);
335 break;
336 }
337 }
338 }
339 }
340
341 }
342
343 /// <summary>
344 /// A feature names something at a given point.
345 ///
346 /// If a feature could not be named, the name is empty.
347 /// </summary>
348 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
349 public sealed partial class Feature : pb::IMessage<Feature> {
350 private static readonly pb::MessageParser<Feature> _parser = new pb::Message Parser<Feature>(() => new Feature());
351 public static pb::MessageParser<Feature> Parser { get { return _parser; } }
352
353 public static pbr::MessageDescriptor Descriptor {
354 get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTyp es[2]; }
355 }
356
357 pbr::MessageDescriptor pb::IMessage.Descriptor {
358 get { return Descriptor; }
359 }
360
361 public Feature() {
362 OnConstruction();
363 }
364
365 partial void OnConstruction();
366
367 public Feature(Feature other) : this() {
368 name_ = other.name_;
369 Location = other.location_ != null ? other.Location.Clone() : null;
370 }
371
372 public Feature Clone() {
373 return new Feature(this);
374 }
375
376 /// <summary>Field number for the "name" field.</summary>
377 public const int NameFieldNumber = 1;
378 private string name_ = "";
379 /// <summary>
380 /// The name of the feature.
381 /// </summary>
382 public string Name {
383 get { return name_; }
384 set {
385 name_ = pb::Preconditions.CheckNotNull(value, "value");
386 }
387 }
388
389 /// <summary>Field number for the "location" field.</summary>
390 public const int LocationFieldNumber = 2;
391 private global::Routeguide.Point location_;
392 /// <summary>
393 /// The point where the feature is detected.
394 /// </summary>
395 public global::Routeguide.Point Location {
396 get { return location_; }
397 set {
398 location_ = value;
399 }
400 }
401
402 public override bool Equals(object other) {
403 return Equals(other as Feature);
404 }
405
406 public bool Equals(Feature other) {
407 if (ReferenceEquals(other, null)) {
408 return false;
409 }
410 if (ReferenceEquals(other, this)) {
411 return true;
412 }
413 if (Name != other.Name) return false;
414 if (!object.Equals(Location, other.Location)) return false;
415 return true;
416 }
417
418 public override int GetHashCode() {
419 int hash = 1;
420 if (Name.Length != 0) hash ^= Name.GetHashCode();
421 if (location_ != null) hash ^= Location.GetHashCode();
422 return hash;
423 }
424
425 public override string ToString() {
426 return pb::JsonFormatter.ToDiagnosticString(this);
427 }
428
429 public void WriteTo(pb::CodedOutputStream output) {
430 if (Name.Length != 0) {
431 output.WriteRawTag(10);
432 output.WriteString(Name);
433 }
434 if (location_ != null) {
435 output.WriteRawTag(18);
436 output.WriteMessage(Location);
437 }
438 }
439
440 public int CalculateSize() {
441 int size = 0;
442 if (Name.Length != 0) {
443 size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
444 }
445 if (location_ != null) {
446 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Location);
447 }
448 return size;
449 }
450
451 public void MergeFrom(Feature other) {
452 if (other == null) {
453 return;
454 }
455 if (other.Name.Length != 0) {
456 Name = other.Name;
457 }
458 if (other.location_ != null) {
459 if (location_ == null) {
460 location_ = new global::Routeguide.Point();
461 }
462 Location.MergeFrom(other.Location);
463 }
464 }
465
466 public void MergeFrom(pb::CodedInputStream input) {
467 uint tag;
468 while ((tag = input.ReadTag()) != 0) {
469 switch(tag) {
470 default:
471 input.SkipLastField();
472 break;
473 case 10: {
474 Name = input.ReadString();
475 break;
476 }
477 case 18: {
478 if (location_ == null) {
479 location_ = new global::Routeguide.Point();
480 }
481 input.ReadMessage(location_);
482 break;
483 }
484 }
485 }
486 }
487
488 }
489
490 /// <summary>
491 /// A RouteNote is a message sent while at a given point.
492 /// </summary>
493 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
494 public sealed partial class RouteNote : pb::IMessage<RouteNote> {
495 private static readonly pb::MessageParser<RouteNote> _parser = new pb::Messa geParser<RouteNote>(() => new RouteNote());
496 public static pb::MessageParser<RouteNote> Parser { get { return _parser; } }
497
498 public static pbr::MessageDescriptor Descriptor {
499 get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTyp es[3]; }
500 }
501
502 pbr::MessageDescriptor pb::IMessage.Descriptor {
503 get { return Descriptor; }
504 }
505
506 public RouteNote() {
507 OnConstruction();
508 }
509
510 partial void OnConstruction();
511
512 public RouteNote(RouteNote other) : this() {
513 Location = other.location_ != null ? other.Location.Clone() : null;
514 message_ = other.message_;
515 }
516
517 public RouteNote Clone() {
518 return new RouteNote(this);
519 }
520
521 /// <summary>Field number for the "location" field.</summary>
522 public const int LocationFieldNumber = 1;
523 private global::Routeguide.Point location_;
524 /// <summary>
525 /// The location from which the message is sent.
526 /// </summary>
527 public global::Routeguide.Point Location {
528 get { return location_; }
529 set {
530 location_ = value;
531 }
532 }
533
534 /// <summary>Field number for the "message" field.</summary>
535 public const int MessageFieldNumber = 2;
536 private string message_ = "";
537 /// <summary>
538 /// The message to be sent.
539 /// </summary>
540 public string Message {
541 get { return message_; }
542 set {
543 message_ = pb::Preconditions.CheckNotNull(value, "value");
544 }
545 }
546
547 public override bool Equals(object other) {
548 return Equals(other as RouteNote);
549 }
550
551 public bool Equals(RouteNote other) {
552 if (ReferenceEquals(other, null)) {
553 return false;
554 }
555 if (ReferenceEquals(other, this)) {
556 return true;
557 }
558 if (!object.Equals(Location, other.Location)) return false;
559 if (Message != other.Message) return false;
560 return true;
561 }
562
563 public override int GetHashCode() {
564 int hash = 1;
565 if (location_ != null) hash ^= Location.GetHashCode();
566 if (Message.Length != 0) hash ^= Message.GetHashCode();
567 return hash;
568 }
569
570 public override string ToString() {
571 return pb::JsonFormatter.ToDiagnosticString(this);
572 }
573
574 public void WriteTo(pb::CodedOutputStream output) {
575 if (location_ != null) {
576 output.WriteRawTag(10);
577 output.WriteMessage(Location);
578 }
579 if (Message.Length != 0) {
580 output.WriteRawTag(18);
581 output.WriteString(Message);
582 }
583 }
584
585 public int CalculateSize() {
586 int size = 0;
587 if (location_ != null) {
588 size += 1 + pb::CodedOutputStream.ComputeMessageSize(Location);
589 }
590 if (Message.Length != 0) {
591 size += 1 + pb::CodedOutputStream.ComputeStringSize(Message);
592 }
593 return size;
594 }
595
596 public void MergeFrom(RouteNote other) {
597 if (other == null) {
598 return;
599 }
600 if (other.location_ != null) {
601 if (location_ == null) {
602 location_ = new global::Routeguide.Point();
603 }
604 Location.MergeFrom(other.Location);
605 }
606 if (other.Message.Length != 0) {
607 Message = other.Message;
608 }
609 }
610
611 public void MergeFrom(pb::CodedInputStream input) {
612 uint tag;
613 while ((tag = input.ReadTag()) != 0) {
614 switch(tag) {
615 default:
616 input.SkipLastField();
617 break;
618 case 10: {
619 if (location_ == null) {
620 location_ = new global::Routeguide.Point();
621 }
622 input.ReadMessage(location_);
623 break;
624 }
625 case 18: {
626 Message = input.ReadString();
627 break;
628 }
629 }
630 }
631 }
632
633 }
634
635 /// <summary>
636 /// A RouteSummary is received in response to a RecordRoute rpc.
637 ///
638 /// It contains the number of individual points received, the number of
639 /// detected features, and the total distance covered as the cumulative sum o f
640 /// the distance between each point.
641 /// </summary>
642 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
643 public sealed partial class RouteSummary : pb::IMessage<RouteSummary> {
644 private static readonly pb::MessageParser<RouteSummary> _parser = new pb::Me ssageParser<RouteSummary>(() => new RouteSummary());
645 public static pb::MessageParser<RouteSummary> Parser { get { return _parser; } }
646
647 public static pbr::MessageDescriptor Descriptor {
648 get { return global::Routeguide.RouteGuideReflection.Descriptor.MessageTyp es[4]; }
649 }
650
651 pbr::MessageDescriptor pb::IMessage.Descriptor {
652 get { return Descriptor; }
653 }
654
655 public RouteSummary() {
656 OnConstruction();
657 }
658
659 partial void OnConstruction();
660
661 public RouteSummary(RouteSummary other) : this() {
662 pointCount_ = other.pointCount_;
663 featureCount_ = other.featureCount_;
664 distance_ = other.distance_;
665 elapsedTime_ = other.elapsedTime_;
666 }
667
668 public RouteSummary Clone() {
669 return new RouteSummary(this);
670 }
671
672 /// <summary>Field number for the "point_count" field.</summary>
673 public const int PointCountFieldNumber = 1;
674 private int pointCount_;
675 /// <summary>
676 /// The number of points received.
677 /// </summary>
678 public int PointCount {
679 get { return pointCount_; }
680 set {
681 pointCount_ = value;
682 }
683 }
684
685 /// <summary>Field number for the "feature_count" field.</summary>
686 public const int FeatureCountFieldNumber = 2;
687 private int featureCount_;
688 /// <summary>
689 /// The number of known features passed while traversing the route.
690 /// </summary>
691 public int FeatureCount {
692 get { return featureCount_; }
693 set {
694 featureCount_ = value;
695 }
696 }
697
698 /// <summary>Field number for the "distance" field.</summary>
699 public const int DistanceFieldNumber = 3;
700 private int distance_;
701 /// <summary>
702 /// The distance covered in metres.
703 /// </summary>
704 public int Distance {
705 get { return distance_; }
706 set {
707 distance_ = value;
708 }
709 }
710
711 /// <summary>Field number for the "elapsed_time" field.</summary>
712 public const int ElapsedTimeFieldNumber = 4;
713 private int elapsedTime_;
714 /// <summary>
715 /// The duration of the traversal in seconds.
716 /// </summary>
717 public int ElapsedTime {
718 get { return elapsedTime_; }
719 set {
720 elapsedTime_ = value;
721 }
722 }
723
724 public override bool Equals(object other) {
725 return Equals(other as RouteSummary);
726 }
727
728 public bool Equals(RouteSummary other) {
729 if (ReferenceEquals(other, null)) {
730 return false;
731 }
732 if (ReferenceEquals(other, this)) {
733 return true;
734 }
735 if (PointCount != other.PointCount) return false;
736 if (FeatureCount != other.FeatureCount) return false;
737 if (Distance != other.Distance) return false;
738 if (ElapsedTime != other.ElapsedTime) return false;
739 return true;
740 }
741
742 public override int GetHashCode() {
743 int hash = 1;
744 if (PointCount != 0) hash ^= PointCount.GetHashCode();
745 if (FeatureCount != 0) hash ^= FeatureCount.GetHashCode();
746 if (Distance != 0) hash ^= Distance.GetHashCode();
747 if (ElapsedTime != 0) hash ^= ElapsedTime.GetHashCode();
748 return hash;
749 }
750
751 public override string ToString() {
752 return pb::JsonFormatter.ToDiagnosticString(this);
753 }
754
755 public void WriteTo(pb::CodedOutputStream output) {
756 if (PointCount != 0) {
757 output.WriteRawTag(8);
758 output.WriteInt32(PointCount);
759 }
760 if (FeatureCount != 0) {
761 output.WriteRawTag(16);
762 output.WriteInt32(FeatureCount);
763 }
764 if (Distance != 0) {
765 output.WriteRawTag(24);
766 output.WriteInt32(Distance);
767 }
768 if (ElapsedTime != 0) {
769 output.WriteRawTag(32);
770 output.WriteInt32(ElapsedTime);
771 }
772 }
773
774 public int CalculateSize() {
775 int size = 0;
776 if (PointCount != 0) {
777 size += 1 + pb::CodedOutputStream.ComputeInt32Size(PointCount);
778 }
779 if (FeatureCount != 0) {
780 size += 1 + pb::CodedOutputStream.ComputeInt32Size(FeatureCount);
781 }
782 if (Distance != 0) {
783 size += 1 + pb::CodedOutputStream.ComputeInt32Size(Distance);
784 }
785 if (ElapsedTime != 0) {
786 size += 1 + pb::CodedOutputStream.ComputeInt32Size(ElapsedTime);
787 }
788 return size;
789 }
790
791 public void MergeFrom(RouteSummary other) {
792 if (other == null) {
793 return;
794 }
795 if (other.PointCount != 0) {
796 PointCount = other.PointCount;
797 }
798 if (other.FeatureCount != 0) {
799 FeatureCount = other.FeatureCount;
800 }
801 if (other.Distance != 0) {
802 Distance = other.Distance;
803 }
804 if (other.ElapsedTime != 0) {
805 ElapsedTime = other.ElapsedTime;
806 }
807 }
808
809 public void MergeFrom(pb::CodedInputStream input) {
810 uint tag;
811 while ((tag = input.ReadTag()) != 0) {
812 switch(tag) {
813 default:
814 input.SkipLastField();
815 break;
816 case 8: {
817 PointCount = input.ReadInt32();
818 break;
819 }
820 case 16: {
821 FeatureCount = input.ReadInt32();
822 break;
823 }
824 case 24: {
825 Distance = input.ReadInt32();
826 break;
827 }
828 case 32: {
829 ElapsedTime = input.ReadInt32();
830 break;
831 }
832 }
833 }
834 }
835
836 }
837
838 #endregion
839
840 }
841
842 #endregion Designer generated code
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698