1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | var jspb = require('google-protobuf');
|
11 | var goog = jspb;
|
12 | var global = Function('return this')();
|
13 |
|
14 | goog.exportSymbol('proto.protocol.Endpoint', null, global);
|
15 | goog.exportSymbol('proto.protocol.FindNeighbours', null, global);
|
16 | goog.exportSymbol('proto.protocol.Neighbours', null, global);
|
17 | goog.exportSymbol('proto.protocol.PingMessage', null, global);
|
18 | goog.exportSymbol('proto.protocol.PongMessage', null, global);
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | proto.protocol.Endpoint = function(opt_data) {
|
31 | jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
32 | };
|
33 | goog.inherits(proto.protocol.Endpoint, jspb.Message);
|
34 | if (goog.DEBUG && !COMPILED) {
|
35 | proto.protocol.Endpoint.displayName = 'proto.protocol.Endpoint';
|
36 | }
|
37 |
|
38 |
|
39 | if (jspb.Message.GENERATE_TO_OBJECT) {
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | proto.protocol.Endpoint.prototype.toObject = function(opt_includeInstance) {
|
51 | return proto.protocol.Endpoint.toObject(opt_includeInstance, this);
|
52 | };
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | proto.protocol.Endpoint.toObject = function(includeInstance, msg) {
|
65 | var f, obj = {
|
66 | address: msg.getAddress_asB64(),
|
67 | port: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
68 | nodeid: msg.getNodeid_asB64()
|
69 | };
|
70 |
|
71 | if (includeInstance) {
|
72 | obj.$jspbMessageInstance = msg;
|
73 | }
|
74 | return obj;
|
75 | };
|
76 | }
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | proto.protocol.Endpoint.deserializeBinary = function(bytes) {
|
85 | var reader = new jspb.BinaryReader(bytes);
|
86 | var msg = new proto.protocol.Endpoint;
|
87 | return proto.protocol.Endpoint.deserializeBinaryFromReader(msg, reader);
|
88 | };
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 | proto.protocol.Endpoint.deserializeBinaryFromReader = function(msg, reader) {
|
99 | while (reader.nextField()) {
|
100 | if (reader.isEndGroup()) {
|
101 | break;
|
102 | }
|
103 | var field = reader.getFieldNumber();
|
104 | switch (field) {
|
105 | case 1:
|
106 | var value = (reader.readBytes());
|
107 | msg.setAddress(value);
|
108 | break;
|
109 | case 2:
|
110 | var value = (reader.readInt32());
|
111 | msg.setPort(value);
|
112 | break;
|
113 | case 3:
|
114 | var value = (reader.readBytes());
|
115 | msg.setNodeid(value);
|
116 | break;
|
117 | default:
|
118 | reader.skipField();
|
119 | break;
|
120 | }
|
121 | }
|
122 | return msg;
|
123 | };
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 | proto.protocol.Endpoint.prototype.serializeBinary = function() {
|
131 | var writer = new jspb.BinaryWriter();
|
132 | proto.protocol.Endpoint.serializeBinaryToWriter(this, writer);
|
133 | return writer.getResultBuffer();
|
134 | };
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | proto.protocol.Endpoint.serializeBinaryToWriter = function(message, writer) {
|
145 | var f = undefined;
|
146 | f = message.getAddress_asU8();
|
147 | if (f.length > 0) {
|
148 | writer.writeBytes(
|
149 | 1,
|
150 | f
|
151 | );
|
152 | }
|
153 | f = message.getPort();
|
154 | if (f !== 0) {
|
155 | writer.writeInt32(
|
156 | 2,
|
157 | f
|
158 | );
|
159 | }
|
160 | f = message.getNodeid_asU8();
|
161 | if (f.length > 0) {
|
162 | writer.writeBytes(
|
163 | 3,
|
164 | f
|
165 | );
|
166 | }
|
167 | };
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 | proto.protocol.Endpoint.prototype.getAddress = function() {
|
175 | return (jspb.Message.getFieldWithDefault(this, 1, ""));
|
176 | };
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 | proto.protocol.Endpoint.prototype.getAddress_asB64 = function() {
|
185 | return (jspb.Message.bytesAsB64(
|
186 | this.getAddress()));
|
187 | };
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 | proto.protocol.Endpoint.prototype.getAddress_asU8 = function() {
|
198 | return (jspb.Message.bytesAsU8(
|
199 | this.getAddress()));
|
200 | };
|
201 |
|
202 |
|
203 |
|
204 | proto.protocol.Endpoint.prototype.setAddress = function(value) {
|
205 | jspb.Message.setProto3BytesField(this, 1, value);
|
206 | };
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 | proto.protocol.Endpoint.prototype.getPort = function() {
|
214 | return (jspb.Message.getFieldWithDefault(this, 2, 0));
|
215 | };
|
216 |
|
217 |
|
218 |
|
219 | proto.protocol.Endpoint.prototype.setPort = function(value) {
|
220 | jspb.Message.setProto3IntField(this, 2, value);
|
221 | };
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 | proto.protocol.Endpoint.prototype.getNodeid = function() {
|
229 | return (jspb.Message.getFieldWithDefault(this, 3, ""));
|
230 | };
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 | proto.protocol.Endpoint.prototype.getNodeid_asB64 = function() {
|
239 | return (jspb.Message.bytesAsB64(
|
240 | this.getNodeid()));
|
241 | };
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 | proto.protocol.Endpoint.prototype.getNodeid_asU8 = function() {
|
252 | return (jspb.Message.bytesAsU8(
|
253 | this.getNodeid()));
|
254 | };
|
255 |
|
256 |
|
257 |
|
258 | proto.protocol.Endpoint.prototype.setNodeid = function(value) {
|
259 | jspb.Message.setProto3BytesField(this, 3, value);
|
260 | };
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 | proto.protocol.PingMessage = function(opt_data) {
|
275 | jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
276 | };
|
277 | goog.inherits(proto.protocol.PingMessage, jspb.Message);
|
278 | if (goog.DEBUG && !COMPILED) {
|
279 | proto.protocol.PingMessage.displayName = 'proto.protocol.PingMessage';
|
280 | }
|
281 |
|
282 |
|
283 | if (jspb.Message.GENERATE_TO_OBJECT) {
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 | proto.protocol.PingMessage.prototype.toObject = function(opt_includeInstance) {
|
295 | return proto.protocol.PingMessage.toObject(opt_includeInstance, this);
|
296 | };
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 | proto.protocol.PingMessage.toObject = function(includeInstance, msg) {
|
309 | var f, obj = {
|
310 | from: (f = msg.getFrom()) && proto.protocol.Endpoint.toObject(includeInstance, f),
|
311 | to: (f = msg.getTo()) && proto.protocol.Endpoint.toObject(includeInstance, f),
|
312 | version: jspb.Message.getFieldWithDefault(msg, 3, 0),
|
313 | timestamp: jspb.Message.getFieldWithDefault(msg, 4, 0)
|
314 | };
|
315 |
|
316 | if (includeInstance) {
|
317 | obj.$jspbMessageInstance = msg;
|
318 | }
|
319 | return obj;
|
320 | };
|
321 | }
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 | proto.protocol.PingMessage.deserializeBinary = function(bytes) {
|
330 | var reader = new jspb.BinaryReader(bytes);
|
331 | var msg = new proto.protocol.PingMessage;
|
332 | return proto.protocol.PingMessage.deserializeBinaryFromReader(msg, reader);
|
333 | };
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 | proto.protocol.PingMessage.deserializeBinaryFromReader = function(msg, reader) {
|
344 | while (reader.nextField()) {
|
345 | if (reader.isEndGroup()) {
|
346 | break;
|
347 | }
|
348 | var field = reader.getFieldNumber();
|
349 | switch (field) {
|
350 | case 1:
|
351 | var value = new proto.protocol.Endpoint;
|
352 | reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader);
|
353 | msg.setFrom(value);
|
354 | break;
|
355 | case 2:
|
356 | var value = new proto.protocol.Endpoint;
|
357 | reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader);
|
358 | msg.setTo(value);
|
359 | break;
|
360 | case 3:
|
361 | var value = (reader.readInt32());
|
362 | msg.setVersion(value);
|
363 | break;
|
364 | case 4:
|
365 | var value = (reader.readInt64());
|
366 | msg.setTimestamp(value);
|
367 | break;
|
368 | default:
|
369 | reader.skipField();
|
370 | break;
|
371 | }
|
372 | }
|
373 | return msg;
|
374 | };
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 | proto.protocol.PingMessage.prototype.serializeBinary = function() {
|
382 | var writer = new jspb.BinaryWriter();
|
383 | proto.protocol.PingMessage.serializeBinaryToWriter(this, writer);
|
384 | return writer.getResultBuffer();
|
385 | };
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | proto.protocol.PingMessage.serializeBinaryToWriter = function(message, writer) {
|
396 | var f = undefined;
|
397 | f = message.getFrom();
|
398 | if (f != null) {
|
399 | writer.writeMessage(
|
400 | 1,
|
401 | f,
|
402 | proto.protocol.Endpoint.serializeBinaryToWriter
|
403 | );
|
404 | }
|
405 | f = message.getTo();
|
406 | if (f != null) {
|
407 | writer.writeMessage(
|
408 | 2,
|
409 | f,
|
410 | proto.protocol.Endpoint.serializeBinaryToWriter
|
411 | );
|
412 | }
|
413 | f = message.getVersion();
|
414 | if (f !== 0) {
|
415 | writer.writeInt32(
|
416 | 3,
|
417 | f
|
418 | );
|
419 | }
|
420 | f = message.getTimestamp();
|
421 | if (f !== 0) {
|
422 | writer.writeInt64(
|
423 | 4,
|
424 | f
|
425 | );
|
426 | }
|
427 | };
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 | proto.protocol.PingMessage.prototype.getFrom = function() {
|
435 | return (
|
436 | jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 1));
|
437 | };
|
438 |
|
439 |
|
440 |
|
441 | proto.protocol.PingMessage.prototype.setFrom = function(value) {
|
442 | jspb.Message.setWrapperField(this, 1, value);
|
443 | };
|
444 |
|
445 |
|
446 | proto.protocol.PingMessage.prototype.clearFrom = function() {
|
447 | this.setFrom(undefined);
|
448 | };
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 | proto.protocol.PingMessage.prototype.hasFrom = function() {
|
456 | return jspb.Message.getField(this, 1) != null;
|
457 | };
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 | proto.protocol.PingMessage.prototype.getTo = function() {
|
465 | return (
|
466 | jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 2));
|
467 | };
|
468 |
|
469 |
|
470 |
|
471 | proto.protocol.PingMessage.prototype.setTo = function(value) {
|
472 | jspb.Message.setWrapperField(this, 2, value);
|
473 | };
|
474 |
|
475 |
|
476 | proto.protocol.PingMessage.prototype.clearTo = function() {
|
477 | this.setTo(undefined);
|
478 | };
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 | proto.protocol.PingMessage.prototype.hasTo = function() {
|
486 | return jspb.Message.getField(this, 2) != null;
|
487 | };
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 | proto.protocol.PingMessage.prototype.getVersion = function() {
|
495 | return (jspb.Message.getFieldWithDefault(this, 3, 0));
|
496 | };
|
497 |
|
498 |
|
499 |
|
500 | proto.protocol.PingMessage.prototype.setVersion = function(value) {
|
501 | jspb.Message.setProto3IntField(this, 3, value);
|
502 | };
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 | proto.protocol.PingMessage.prototype.getTimestamp = function() {
|
510 | return (jspb.Message.getFieldWithDefault(this, 4, 0));
|
511 | };
|
512 |
|
513 |
|
514 |
|
515 | proto.protocol.PingMessage.prototype.setTimestamp = function(value) {
|
516 | jspb.Message.setProto3IntField(this, 4, value);
|
517 | };
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 | proto.protocol.PongMessage = function(opt_data) {
|
532 | jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
533 | };
|
534 | goog.inherits(proto.protocol.PongMessage, jspb.Message);
|
535 | if (goog.DEBUG && !COMPILED) {
|
536 | proto.protocol.PongMessage.displayName = 'proto.protocol.PongMessage';
|
537 | }
|
538 |
|
539 |
|
540 | if (jspb.Message.GENERATE_TO_OBJECT) {
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 | proto.protocol.PongMessage.prototype.toObject = function(opt_includeInstance) {
|
552 | return proto.protocol.PongMessage.toObject(opt_includeInstance, this);
|
553 | };
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 |
|
565 | proto.protocol.PongMessage.toObject = function(includeInstance, msg) {
|
566 | var f, obj = {
|
567 | from: (f = msg.getFrom()) && proto.protocol.Endpoint.toObject(includeInstance, f),
|
568 | echo: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
569 | timestamp: jspb.Message.getFieldWithDefault(msg, 3, 0)
|
570 | };
|
571 |
|
572 | if (includeInstance) {
|
573 | obj.$jspbMessageInstance = msg;
|
574 | }
|
575 | return obj;
|
576 | };
|
577 | }
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 | proto.protocol.PongMessage.deserializeBinary = function(bytes) {
|
586 | var reader = new jspb.BinaryReader(bytes);
|
587 | var msg = new proto.protocol.PongMessage;
|
588 | return proto.protocol.PongMessage.deserializeBinaryFromReader(msg, reader);
|
589 | };
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 | proto.protocol.PongMessage.deserializeBinaryFromReader = function(msg, reader) {
|
600 | while (reader.nextField()) {
|
601 | if (reader.isEndGroup()) {
|
602 | break;
|
603 | }
|
604 | var field = reader.getFieldNumber();
|
605 | switch (field) {
|
606 | case 1:
|
607 | var value = new proto.protocol.Endpoint;
|
608 | reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader);
|
609 | msg.setFrom(value);
|
610 | break;
|
611 | case 2:
|
612 | var value = (reader.readInt32());
|
613 | msg.setEcho(value);
|
614 | break;
|
615 | case 3:
|
616 | var value = (reader.readInt64());
|
617 | msg.setTimestamp(value);
|
618 | break;
|
619 | default:
|
620 | reader.skipField();
|
621 | break;
|
622 | }
|
623 | }
|
624 | return msg;
|
625 | };
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 | proto.protocol.PongMessage.prototype.serializeBinary = function() {
|
633 | var writer = new jspb.BinaryWriter();
|
634 | proto.protocol.PongMessage.serializeBinaryToWriter(this, writer);
|
635 | return writer.getResultBuffer();
|
636 | };
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 | proto.protocol.PongMessage.serializeBinaryToWriter = function(message, writer) {
|
647 | var f = undefined;
|
648 | f = message.getFrom();
|
649 | if (f != null) {
|
650 | writer.writeMessage(
|
651 | 1,
|
652 | f,
|
653 | proto.protocol.Endpoint.serializeBinaryToWriter
|
654 | );
|
655 | }
|
656 | f = message.getEcho();
|
657 | if (f !== 0) {
|
658 | writer.writeInt32(
|
659 | 2,
|
660 | f
|
661 | );
|
662 | }
|
663 | f = message.getTimestamp();
|
664 | if (f !== 0) {
|
665 | writer.writeInt64(
|
666 | 3,
|
667 | f
|
668 | );
|
669 | }
|
670 | };
|
671 |
|
672 |
|
673 |
|
674 |
|
675 |
|
676 |
|
677 | proto.protocol.PongMessage.prototype.getFrom = function() {
|
678 | return (
|
679 | jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 1));
|
680 | };
|
681 |
|
682 |
|
683 |
|
684 | proto.protocol.PongMessage.prototype.setFrom = function(value) {
|
685 | jspb.Message.setWrapperField(this, 1, value);
|
686 | };
|
687 |
|
688 |
|
689 | proto.protocol.PongMessage.prototype.clearFrom = function() {
|
690 | this.setFrom(undefined);
|
691 | };
|
692 |
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 | proto.protocol.PongMessage.prototype.hasFrom = function() {
|
699 | return jspb.Message.getField(this, 1) != null;
|
700 | };
|
701 |
|
702 |
|
703 |
|
704 |
|
705 |
|
706 |
|
707 | proto.protocol.PongMessage.prototype.getEcho = function() {
|
708 | return (jspb.Message.getFieldWithDefault(this, 2, 0));
|
709 | };
|
710 |
|
711 |
|
712 |
|
713 | proto.protocol.PongMessage.prototype.setEcho = function(value) {
|
714 | jspb.Message.setProto3IntField(this, 2, value);
|
715 | };
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 |
|
722 | proto.protocol.PongMessage.prototype.getTimestamp = function() {
|
723 | return (jspb.Message.getFieldWithDefault(this, 3, 0));
|
724 | };
|
725 |
|
726 |
|
727 |
|
728 | proto.protocol.PongMessage.prototype.setTimestamp = function(value) {
|
729 | jspb.Message.setProto3IntField(this, 3, value);
|
730 | };
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 | proto.protocol.FindNeighbours = function(opt_data) {
|
745 | jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
746 | };
|
747 | goog.inherits(proto.protocol.FindNeighbours, jspb.Message);
|
748 | if (goog.DEBUG && !COMPILED) {
|
749 | proto.protocol.FindNeighbours.displayName = 'proto.protocol.FindNeighbours';
|
750 | }
|
751 |
|
752 |
|
753 | if (jspb.Message.GENERATE_TO_OBJECT) {
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 | proto.protocol.FindNeighbours.prototype.toObject = function(opt_includeInstance) {
|
765 | return proto.protocol.FindNeighbours.toObject(opt_includeInstance, this);
|
766 | };
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 | proto.protocol.FindNeighbours.toObject = function(includeInstance, msg) {
|
779 | var f, obj = {
|
780 | from: (f = msg.getFrom()) && proto.protocol.Endpoint.toObject(includeInstance, f),
|
781 | targetid: msg.getTargetid_asB64(),
|
782 | timestamp: jspb.Message.getFieldWithDefault(msg, 3, 0)
|
783 | };
|
784 |
|
785 | if (includeInstance) {
|
786 | obj.$jspbMessageInstance = msg;
|
787 | }
|
788 | return obj;
|
789 | };
|
790 | }
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 | proto.protocol.FindNeighbours.deserializeBinary = function(bytes) {
|
799 | var reader = new jspb.BinaryReader(bytes);
|
800 | var msg = new proto.protocol.FindNeighbours;
|
801 | return proto.protocol.FindNeighbours.deserializeBinaryFromReader(msg, reader);
|
802 | };
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 | proto.protocol.FindNeighbours.deserializeBinaryFromReader = function(msg, reader) {
|
813 | while (reader.nextField()) {
|
814 | if (reader.isEndGroup()) {
|
815 | break;
|
816 | }
|
817 | var field = reader.getFieldNumber();
|
818 | switch (field) {
|
819 | case 1:
|
820 | var value = new proto.protocol.Endpoint;
|
821 | reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader);
|
822 | msg.setFrom(value);
|
823 | break;
|
824 | case 2:
|
825 | var value = (reader.readBytes());
|
826 | msg.setTargetid(value);
|
827 | break;
|
828 | case 3:
|
829 | var value = (reader.readInt64());
|
830 | msg.setTimestamp(value);
|
831 | break;
|
832 | default:
|
833 | reader.skipField();
|
834 | break;
|
835 | }
|
836 | }
|
837 | return msg;
|
838 | };
|
839 |
|
840 |
|
841 |
|
842 |
|
843 |
|
844 |
|
845 | proto.protocol.FindNeighbours.prototype.serializeBinary = function() {
|
846 | var writer = new jspb.BinaryWriter();
|
847 | proto.protocol.FindNeighbours.serializeBinaryToWriter(this, writer);
|
848 | return writer.getResultBuffer();
|
849 | };
|
850 |
|
851 |
|
852 |
|
853 |
|
854 |
|
855 |
|
856 |
|
857 |
|
858 |
|
859 | proto.protocol.FindNeighbours.serializeBinaryToWriter = function(message, writer) {
|
860 | var f = undefined;
|
861 | f = message.getFrom();
|
862 | if (f != null) {
|
863 | writer.writeMessage(
|
864 | 1,
|
865 | f,
|
866 | proto.protocol.Endpoint.serializeBinaryToWriter
|
867 | );
|
868 | }
|
869 | f = message.getTargetid_asU8();
|
870 | if (f.length > 0) {
|
871 | writer.writeBytes(
|
872 | 2,
|
873 | f
|
874 | );
|
875 | }
|
876 | f = message.getTimestamp();
|
877 | if (f !== 0) {
|
878 | writer.writeInt64(
|
879 | 3,
|
880 | f
|
881 | );
|
882 | }
|
883 | };
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 | proto.protocol.FindNeighbours.prototype.getFrom = function() {
|
891 | return (
|
892 | jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 1));
|
893 | };
|
894 |
|
895 |
|
896 |
|
897 | proto.protocol.FindNeighbours.prototype.setFrom = function(value) {
|
898 | jspb.Message.setWrapperField(this, 1, value);
|
899 | };
|
900 |
|
901 |
|
902 | proto.protocol.FindNeighbours.prototype.clearFrom = function() {
|
903 | this.setFrom(undefined);
|
904 | };
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 | proto.protocol.FindNeighbours.prototype.hasFrom = function() {
|
912 | return jspb.Message.getField(this, 1) != null;
|
913 | };
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 | proto.protocol.FindNeighbours.prototype.getTargetid = function() {
|
921 | return (jspb.Message.getFieldWithDefault(this, 2, ""));
|
922 | };
|
923 |
|
924 |
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 | proto.protocol.FindNeighbours.prototype.getTargetid_asB64 = function() {
|
931 | return (jspb.Message.bytesAsB64(
|
932 | this.getTargetid()));
|
933 | };
|
934 |
|
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 |
|
942 |
|
943 | proto.protocol.FindNeighbours.prototype.getTargetid_asU8 = function() {
|
944 | return (jspb.Message.bytesAsU8(
|
945 | this.getTargetid()));
|
946 | };
|
947 |
|
948 |
|
949 |
|
950 | proto.protocol.FindNeighbours.prototype.setTargetid = function(value) {
|
951 | jspb.Message.setProto3BytesField(this, 2, value);
|
952 | };
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 | proto.protocol.FindNeighbours.prototype.getTimestamp = function() {
|
960 | return (jspb.Message.getFieldWithDefault(this, 3, 0));
|
961 | };
|
962 |
|
963 |
|
964 |
|
965 | proto.protocol.FindNeighbours.prototype.setTimestamp = function(value) {
|
966 | jspb.Message.setProto3IntField(this, 3, value);
|
967 | };
|
968 |
|
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 |
|
976 |
|
977 |
|
978 |
|
979 |
|
980 |
|
981 | proto.protocol.Neighbours = function(opt_data) {
|
982 | jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.Neighbours.repeatedFields_, null);
|
983 | };
|
984 | goog.inherits(proto.protocol.Neighbours, jspb.Message);
|
985 | if (goog.DEBUG && !COMPILED) {
|
986 | proto.protocol.Neighbours.displayName = 'proto.protocol.Neighbours';
|
987 | }
|
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 | proto.protocol.Neighbours.repeatedFields_ = [2];
|
994 |
|
995 |
|
996 |
|
997 | if (jspb.Message.GENERATE_TO_OBJECT) {
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 | proto.protocol.Neighbours.prototype.toObject = function(opt_includeInstance) {
|
1009 | return proto.protocol.Neighbours.toObject(opt_includeInstance, this);
|
1010 | };
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 | proto.protocol.Neighbours.toObject = function(includeInstance, msg) {
|
1023 | var f, obj = {
|
1024 | from: (f = msg.getFrom()) && proto.protocol.Endpoint.toObject(includeInstance, f),
|
1025 | neighboursList: jspb.Message.toObjectList(msg.getNeighboursList(),
|
1026 | proto.protocol.Endpoint.toObject, includeInstance),
|
1027 | timestamp: jspb.Message.getFieldWithDefault(msg, 3, 0)
|
1028 | };
|
1029 |
|
1030 | if (includeInstance) {
|
1031 | obj.$jspbMessageInstance = msg;
|
1032 | }
|
1033 | return obj;
|
1034 | };
|
1035 | }
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 | proto.protocol.Neighbours.deserializeBinary = function(bytes) {
|
1044 | var reader = new jspb.BinaryReader(bytes);
|
1045 | var msg = new proto.protocol.Neighbours;
|
1046 | return proto.protocol.Neighbours.deserializeBinaryFromReader(msg, reader);
|
1047 | };
|
1048 |
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 | proto.protocol.Neighbours.deserializeBinaryFromReader = function(msg, reader) {
|
1058 | while (reader.nextField()) {
|
1059 | if (reader.isEndGroup()) {
|
1060 | break;
|
1061 | }
|
1062 | var field = reader.getFieldNumber();
|
1063 | switch (field) {
|
1064 | case 1:
|
1065 | var value = new proto.protocol.Endpoint;
|
1066 | reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader);
|
1067 | msg.setFrom(value);
|
1068 | break;
|
1069 | case 2:
|
1070 | var value = new proto.protocol.Endpoint;
|
1071 | reader.readMessage(value,proto.protocol.Endpoint.deserializeBinaryFromReader);
|
1072 | msg.addNeighbours(value);
|
1073 | break;
|
1074 | case 3:
|
1075 | var value = (reader.readInt64());
|
1076 | msg.setTimestamp(value);
|
1077 | break;
|
1078 | default:
|
1079 | reader.skipField();
|
1080 | break;
|
1081 | }
|
1082 | }
|
1083 | return msg;
|
1084 | };
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 |
|
1091 | proto.protocol.Neighbours.prototype.serializeBinary = function() {
|
1092 | var writer = new jspb.BinaryWriter();
|
1093 | proto.protocol.Neighbours.serializeBinaryToWriter(this, writer);
|
1094 | return writer.getResultBuffer();
|
1095 | };
|
1096 |
|
1097 |
|
1098 |
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 |
|
1105 | proto.protocol.Neighbours.serializeBinaryToWriter = function(message, writer) {
|
1106 | var f = undefined;
|
1107 | f = message.getFrom();
|
1108 | if (f != null) {
|
1109 | writer.writeMessage(
|
1110 | 1,
|
1111 | f,
|
1112 | proto.protocol.Endpoint.serializeBinaryToWriter
|
1113 | );
|
1114 | }
|
1115 | f = message.getNeighboursList();
|
1116 | if (f.length > 0) {
|
1117 | writer.writeRepeatedMessage(
|
1118 | 2,
|
1119 | f,
|
1120 | proto.protocol.Endpoint.serializeBinaryToWriter
|
1121 | );
|
1122 | }
|
1123 | f = message.getTimestamp();
|
1124 | if (f !== 0) {
|
1125 | writer.writeInt64(
|
1126 | 3,
|
1127 | f
|
1128 | );
|
1129 | }
|
1130 | };
|
1131 |
|
1132 |
|
1133 |
|
1134 |
|
1135 |
|
1136 |
|
1137 | proto.protocol.Neighbours.prototype.getFrom = function() {
|
1138 | return (
|
1139 | jspb.Message.getWrapperField(this, proto.protocol.Endpoint, 1));
|
1140 | };
|
1141 |
|
1142 |
|
1143 |
|
1144 | proto.protocol.Neighbours.prototype.setFrom = function(value) {
|
1145 | jspb.Message.setWrapperField(this, 1, value);
|
1146 | };
|
1147 |
|
1148 |
|
1149 | proto.protocol.Neighbours.prototype.clearFrom = function() {
|
1150 | this.setFrom(undefined);
|
1151 | };
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 | proto.protocol.Neighbours.prototype.hasFrom = function() {
|
1159 | return jspb.Message.getField(this, 1) != null;
|
1160 | };
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 | proto.protocol.Neighbours.prototype.getNeighboursList = function() {
|
1168 | return (
|
1169 | jspb.Message.getRepeatedWrapperField(this, proto.protocol.Endpoint, 2));
|
1170 | };
|
1171 |
|
1172 |
|
1173 |
|
1174 | proto.protocol.Neighbours.prototype.setNeighboursList = function(value) {
|
1175 | jspb.Message.setRepeatedWrapperField(this, 2, value);
|
1176 | };
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 | proto.protocol.Neighbours.prototype.addNeighbours = function(opt_value, opt_index) {
|
1185 | return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.protocol.Endpoint, opt_index);
|
1186 | };
|
1187 |
|
1188 |
|
1189 | proto.protocol.Neighbours.prototype.clearNeighboursList = function() {
|
1190 | this.setNeighboursList([]);
|
1191 | };
|
1192 |
|
1193 |
|
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 | proto.protocol.Neighbours.prototype.getTimestamp = function() {
|
1199 | return (jspb.Message.getFieldWithDefault(this, 3, 0));
|
1200 | };
|
1201 |
|
1202 |
|
1203 |
|
1204 | proto.protocol.Neighbours.prototype.setTimestamp = function(value) {
|
1205 | jspb.Message.setProto3IntField(this, 3, value);
|
1206 | };
|
1207 |
|
1208 |
|
1209 | goog.object.extend(exports, proto.protocol);
|