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

Side by Side Diff: third_party/grpc/examples/php/route_guide/route_guide.php

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 <?php
2 // DO NOT EDIT! Generated by Protobuf-PHP protoc plugin 1.0
3 // Source: route_guide.proto
4 // Date: 2015-09-24 21:21:51
5
6 namespace routeguide {
7
8 class Point extends \DrSlump\Protobuf\Message {
9
10 /** @var int */
11 public $latitude = 0;
12
13 /** @var int */
14 public $longitude = 0;
15
16
17 /** @var \Closure[] */
18 protected static $__extensions = array();
19
20 public static function descriptor()
21 {
22 $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Poin t');
23
24 // OPTIONAL INT32 latitude = 1
25 $f = new \DrSlump\Protobuf\Field();
26 $f->number = 1;
27 $f->name = "latitude";
28 $f->type = \DrSlump\Protobuf::TYPE_INT32;
29 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
30 $f->default = 0;
31 $descriptor->addField($f);
32
33 // OPTIONAL INT32 longitude = 2
34 $f = new \DrSlump\Protobuf\Field();
35 $f->number = 2;
36 $f->name = "longitude";
37 $f->type = \DrSlump\Protobuf::TYPE_INT32;
38 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
39 $f->default = 0;
40 $descriptor->addField($f);
41
42 foreach (self::$__extensions as $cb) {
43 $descriptor->addField($cb(), true);
44 }
45
46 return $descriptor;
47 }
48
49 /**
50 * Check if <latitude> has a value
51 *
52 * @return boolean
53 */
54 public function hasLatitude(){
55 return $this->_has(1);
56 }
57
58 /**
59 * Clear <latitude> value
60 *
61 * @return \routeguide\Point
62 */
63 public function clearLatitude(){
64 return $this->_clear(1);
65 }
66
67 /**
68 * Get <latitude> value
69 *
70 * @return int
71 */
72 public function getLatitude(){
73 return $this->_get(1);
74 }
75
76 /**
77 * Set <latitude> value
78 *
79 * @param int $value
80 * @return \routeguide\Point
81 */
82 public function setLatitude( $value){
83 return $this->_set(1, $value);
84 }
85
86 /**
87 * Check if <longitude> has a value
88 *
89 * @return boolean
90 */
91 public function hasLongitude(){
92 return $this->_has(2);
93 }
94
95 /**
96 * Clear <longitude> value
97 *
98 * @return \routeguide\Point
99 */
100 public function clearLongitude(){
101 return $this->_clear(2);
102 }
103
104 /**
105 * Get <longitude> value
106 *
107 * @return int
108 */
109 public function getLongitude(){
110 return $this->_get(2);
111 }
112
113 /**
114 * Set <longitude> value
115 *
116 * @param int $value
117 * @return \routeguide\Point
118 */
119 public function setLongitude( $value){
120 return $this->_set(2, $value);
121 }
122 }
123 }
124
125 namespace routeguide {
126
127 class Rectangle extends \DrSlump\Protobuf\Message {
128
129 /** @var \routeguide\Point */
130 public $lo = null;
131
132 /** @var \routeguide\Point */
133 public $hi = null;
134
135
136 /** @var \Closure[] */
137 protected static $__extensions = array();
138
139 public static function descriptor()
140 {
141 $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Rect angle');
142
143 // OPTIONAL MESSAGE lo = 1
144 $f = new \DrSlump\Protobuf\Field();
145 $f->number = 1;
146 $f->name = "lo";
147 $f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
148 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
149 $f->reference = '\routeguide\Point';
150 $descriptor->addField($f);
151
152 // OPTIONAL MESSAGE hi = 2
153 $f = new \DrSlump\Protobuf\Field();
154 $f->number = 2;
155 $f->name = "hi";
156 $f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
157 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
158 $f->reference = '\routeguide\Point';
159 $descriptor->addField($f);
160
161 foreach (self::$__extensions as $cb) {
162 $descriptor->addField($cb(), true);
163 }
164
165 return $descriptor;
166 }
167
168 /**
169 * Check if <lo> has a value
170 *
171 * @return boolean
172 */
173 public function hasLo(){
174 return $this->_has(1);
175 }
176
177 /**
178 * Clear <lo> value
179 *
180 * @return \routeguide\Rectangle
181 */
182 public function clearLo(){
183 return $this->_clear(1);
184 }
185
186 /**
187 * Get <lo> value
188 *
189 * @return \routeguide\Point
190 */
191 public function getLo(){
192 return $this->_get(1);
193 }
194
195 /**
196 * Set <lo> value
197 *
198 * @param \routeguide\Point $value
199 * @return \routeguide\Rectangle
200 */
201 public function setLo(\routeguide\Point $value){
202 return $this->_set(1, $value);
203 }
204
205 /**
206 * Check if <hi> has a value
207 *
208 * @return boolean
209 */
210 public function hasHi(){
211 return $this->_has(2);
212 }
213
214 /**
215 * Clear <hi> value
216 *
217 * @return \routeguide\Rectangle
218 */
219 public function clearHi(){
220 return $this->_clear(2);
221 }
222
223 /**
224 * Get <hi> value
225 *
226 * @return \routeguide\Point
227 */
228 public function getHi(){
229 return $this->_get(2);
230 }
231
232 /**
233 * Set <hi> value
234 *
235 * @param \routeguide\Point $value
236 * @return \routeguide\Rectangle
237 */
238 public function setHi(\routeguide\Point $value){
239 return $this->_set(2, $value);
240 }
241 }
242 }
243
244 namespace routeguide {
245
246 class Feature extends \DrSlump\Protobuf\Message {
247
248 /** @var string */
249 public $name = null;
250
251 /** @var \routeguide\Point */
252 public $location = null;
253
254
255 /** @var \Closure[] */
256 protected static $__extensions = array();
257
258 public static function descriptor()
259 {
260 $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Feat ure');
261
262 // OPTIONAL STRING name = 1
263 $f = new \DrSlump\Protobuf\Field();
264 $f->number = 1;
265 $f->name = "name";
266 $f->type = \DrSlump\Protobuf::TYPE_STRING;
267 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
268 $descriptor->addField($f);
269
270 // OPTIONAL MESSAGE location = 2
271 $f = new \DrSlump\Protobuf\Field();
272 $f->number = 2;
273 $f->name = "location";
274 $f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
275 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
276 $f->reference = '\routeguide\Point';
277 $descriptor->addField($f);
278
279 foreach (self::$__extensions as $cb) {
280 $descriptor->addField($cb(), true);
281 }
282
283 return $descriptor;
284 }
285
286 /**
287 * Check if <name> has a value
288 *
289 * @return boolean
290 */
291 public function hasName(){
292 return $this->_has(1);
293 }
294
295 /**
296 * Clear <name> value
297 *
298 * @return \routeguide\Feature
299 */
300 public function clearName(){
301 return $this->_clear(1);
302 }
303
304 /**
305 * Get <name> value
306 *
307 * @return string
308 */
309 public function getName(){
310 return $this->_get(1);
311 }
312
313 /**
314 * Set <name> value
315 *
316 * @param string $value
317 * @return \routeguide\Feature
318 */
319 public function setName( $value){
320 return $this->_set(1, $value);
321 }
322
323 /**
324 * Check if <location> has a value
325 *
326 * @return boolean
327 */
328 public function hasLocation(){
329 return $this->_has(2);
330 }
331
332 /**
333 * Clear <location> value
334 *
335 * @return \routeguide\Feature
336 */
337 public function clearLocation(){
338 return $this->_clear(2);
339 }
340
341 /**
342 * Get <location> value
343 *
344 * @return \routeguide\Point
345 */
346 public function getLocation(){
347 return $this->_get(2);
348 }
349
350 /**
351 * Set <location> value
352 *
353 * @param \routeguide\Point $value
354 * @return \routeguide\Feature
355 */
356 public function setLocation(\routeguide\Point $value){
357 return $this->_set(2, $value);
358 }
359 }
360 }
361
362 namespace routeguide {
363
364 class RouteNote extends \DrSlump\Protobuf\Message {
365
366 /** @var \routeguide\Point */
367 public $location = null;
368
369 /** @var string */
370 public $message = null;
371
372
373 /** @var \Closure[] */
374 protected static $__extensions = array();
375
376 public static function descriptor()
377 {
378 $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Rout eNote');
379
380 // OPTIONAL MESSAGE location = 1
381 $f = new \DrSlump\Protobuf\Field();
382 $f->number = 1;
383 $f->name = "location";
384 $f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
385 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
386 $f->reference = '\routeguide\Point';
387 $descriptor->addField($f);
388
389 // OPTIONAL STRING message = 2
390 $f = new \DrSlump\Protobuf\Field();
391 $f->number = 2;
392 $f->name = "message";
393 $f->type = \DrSlump\Protobuf::TYPE_STRING;
394 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
395 $descriptor->addField($f);
396
397 foreach (self::$__extensions as $cb) {
398 $descriptor->addField($cb(), true);
399 }
400
401 return $descriptor;
402 }
403
404 /**
405 * Check if <location> has a value
406 *
407 * @return boolean
408 */
409 public function hasLocation(){
410 return $this->_has(1);
411 }
412
413 /**
414 * Clear <location> value
415 *
416 * @return \routeguide\RouteNote
417 */
418 public function clearLocation(){
419 return $this->_clear(1);
420 }
421
422 /**
423 * Get <location> value
424 *
425 * @return \routeguide\Point
426 */
427 public function getLocation(){
428 return $this->_get(1);
429 }
430
431 /**
432 * Set <location> value
433 *
434 * @param \routeguide\Point $value
435 * @return \routeguide\RouteNote
436 */
437 public function setLocation(\routeguide\Point $value){
438 return $this->_set(1, $value);
439 }
440
441 /**
442 * Check if <message> has a value
443 *
444 * @return boolean
445 */
446 public function hasMessage(){
447 return $this->_has(2);
448 }
449
450 /**
451 * Clear <message> value
452 *
453 * @return \routeguide\RouteNote
454 */
455 public function clearMessage(){
456 return $this->_clear(2);
457 }
458
459 /**
460 * Get <message> value
461 *
462 * @return string
463 */
464 public function getMessage(){
465 return $this->_get(2);
466 }
467
468 /**
469 * Set <message> value
470 *
471 * @param string $value
472 * @return \routeguide\RouteNote
473 */
474 public function setMessage( $value){
475 return $this->_set(2, $value);
476 }
477 }
478 }
479
480 namespace routeguide {
481
482 class RouteSummary extends \DrSlump\Protobuf\Message {
483
484 /** @var int */
485 public $point_count = 0;
486
487 /** @var int */
488 public $feature_count = 0;
489
490 /** @var int */
491 public $distance = 0;
492
493 /** @var int */
494 public $elapsed_time = 0;
495
496
497 /** @var \Closure[] */
498 protected static $__extensions = array();
499
500 public static function descriptor()
501 {
502 $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'routeguide.Rout eSummary');
503
504 // OPTIONAL INT32 point_count = 1
505 $f = new \DrSlump\Protobuf\Field();
506 $f->number = 1;
507 $f->name = "point_count";
508 $f->type = \DrSlump\Protobuf::TYPE_INT32;
509 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
510 $f->default = 0;
511 $descriptor->addField($f);
512
513 // OPTIONAL INT32 feature_count = 2
514 $f = new \DrSlump\Protobuf\Field();
515 $f->number = 2;
516 $f->name = "feature_count";
517 $f->type = \DrSlump\Protobuf::TYPE_INT32;
518 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
519 $f->default = 0;
520 $descriptor->addField($f);
521
522 // OPTIONAL INT32 distance = 3
523 $f = new \DrSlump\Protobuf\Field();
524 $f->number = 3;
525 $f->name = "distance";
526 $f->type = \DrSlump\Protobuf::TYPE_INT32;
527 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
528 $f->default = 0;
529 $descriptor->addField($f);
530
531 // OPTIONAL INT32 elapsed_time = 4
532 $f = new \DrSlump\Protobuf\Field();
533 $f->number = 4;
534 $f->name = "elapsed_time";
535 $f->type = \DrSlump\Protobuf::TYPE_INT32;
536 $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
537 $f->default = 0;
538 $descriptor->addField($f);
539
540 foreach (self::$__extensions as $cb) {
541 $descriptor->addField($cb(), true);
542 }
543
544 return $descriptor;
545 }
546
547 /**
548 * Check if <point_count> has a value
549 *
550 * @return boolean
551 */
552 public function hasPointCount(){
553 return $this->_has(1);
554 }
555
556 /**
557 * Clear <point_count> value
558 *
559 * @return \routeguide\RouteSummary
560 */
561 public function clearPointCount(){
562 return $this->_clear(1);
563 }
564
565 /**
566 * Get <point_count> value
567 *
568 * @return int
569 */
570 public function getPointCount(){
571 return $this->_get(1);
572 }
573
574 /**
575 * Set <point_count> value
576 *
577 * @param int $value
578 * @return \routeguide\RouteSummary
579 */
580 public function setPointCount( $value){
581 return $this->_set(1, $value);
582 }
583
584 /**
585 * Check if <feature_count> has a value
586 *
587 * @return boolean
588 */
589 public function hasFeatureCount(){
590 return $this->_has(2);
591 }
592
593 /**
594 * Clear <feature_count> value
595 *
596 * @return \routeguide\RouteSummary
597 */
598 public function clearFeatureCount(){
599 return $this->_clear(2);
600 }
601
602 /**
603 * Get <feature_count> value
604 *
605 * @return int
606 */
607 public function getFeatureCount(){
608 return $this->_get(2);
609 }
610
611 /**
612 * Set <feature_count> value
613 *
614 * @param int $value
615 * @return \routeguide\RouteSummary
616 */
617 public function setFeatureCount( $value){
618 return $this->_set(2, $value);
619 }
620
621 /**
622 * Check if <distance> has a value
623 *
624 * @return boolean
625 */
626 public function hasDistance(){
627 return $this->_has(3);
628 }
629
630 /**
631 * Clear <distance> value
632 *
633 * @return \routeguide\RouteSummary
634 */
635 public function clearDistance(){
636 return $this->_clear(3);
637 }
638
639 /**
640 * Get <distance> value
641 *
642 * @return int
643 */
644 public function getDistance(){
645 return $this->_get(3);
646 }
647
648 /**
649 * Set <distance> value
650 *
651 * @param int $value
652 * @return \routeguide\RouteSummary
653 */
654 public function setDistance( $value){
655 return $this->_set(3, $value);
656 }
657
658 /**
659 * Check if <elapsed_time> has a value
660 *
661 * @return boolean
662 */
663 public function hasElapsedTime(){
664 return $this->_has(4);
665 }
666
667 /**
668 * Clear <elapsed_time> value
669 *
670 * @return \routeguide\RouteSummary
671 */
672 public function clearElapsedTime(){
673 return $this->_clear(4);
674 }
675
676 /**
677 * Get <elapsed_time> value
678 *
679 * @return int
680 */
681 public function getElapsedTime(){
682 return $this->_get(4);
683 }
684
685 /**
686 * Set <elapsed_time> value
687 *
688 * @param int $value
689 * @return \routeguide\RouteSummary
690 */
691 public function setElapsedTime( $value){
692 return $this->_set(4, $value);
693 }
694 }
695 }
696
697 namespace routeguide {
698
699 class RouteGuideClient extends \Grpc\BaseStub {
700
701 public function __construct($hostname, $opts) {
702 parent::__construct($hostname, $opts);
703 }
704 /**
705 * @param routeguide\Point $input
706 */
707 public function GetFeature(\routeguide\Point $argument, $metadata = array(), $options = array()) {
708 return $this->_simpleRequest('/routeguide.RouteGuide/GetFeature', $argumen t, '\routeguide\Feature::deserialize', $metadata, $options);
709 }
710 /**
711 * @param routeguide\Rectangle $input
712 */
713 public function ListFeatures($argument, $metadata = array(), $options = arra y()) {
714 return $this->_serverStreamRequest('/routeguide.RouteGuide/ListFeatures', $argument, '\routeguide\Feature::deserialize', $metadata, $options);
715 }
716 /**
717 * @param routeguide\Point $input
718 */
719 public function RecordRoute($metadata = array()) {
720 return $this->_clientStreamRequest('/routeguide.RouteGuide/RecordRoute', ' \routeguide\RouteSummary::deserialize', $metadata);
721 }
722 /**
723 * @param routeguide\RouteNote $input
724 */
725 public function RouteChat($metadata = array()) {
726 return $this->_bidiRequest('/routeguide.RouteGuide/RouteChat', '\routeguid e\RouteNote::deserialize', $metadata);
727 }
728 }
729 }
OLDNEW
« no previous file with comments | « third_party/grpc/examples/php/route_guide/README.md ('k') | third_party/grpc/examples/php/route_guide/route_guide.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698