Election.cpp
Go to the documentation of this file.
1// **********************************************************************
2//
3// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
4//
5// This copy of Ice is licensed to you under the terms described in the
6// ICE_LICENSE file included in this distribution.
7//
8// **********************************************************************
9//
10// Ice version 3.7.0
11//
12// <auto-generated>
13//
14// Generated from file `Election.ice'
15//
16// Warning: do not edit this file.
17//
18// </auto-generated>
19//
20
21#include <Ice/InputStream.h>
22#include <Ice/LocalException.h>
23#include <Ice/OutgoingAsync.h>
24#include <Ice/OutputStream.h>
25#include <Ice/ValueFactory.h>
26#include <IceStorm/Election.h>
27#include <IceUtil/PopDisableWarnings.h>
28#include <IceUtil/PushDisableWarnings.h>
29
30#if defined(_MSC_VER)
31#pragma warning(disable : 4458) // declaration of ... hides class member
32#elif defined(__clang__)
33#pragma clang diagnostic ignored "-Wshadow"
34#elif defined(__GNUC__)
35#pragma GCC diagnostic ignored "-Wshadow"
36#endif
37
38#ifndef ICE_IGNORE_VERSION
39#if ICE_INT_VERSION / 100 != 307
40#error Ice version mismatch!
41#endif
42#if ICE_INT_VERSION % 100 > 50
43#error Beta header file detected
44#endif
45#if ICE_INT_VERSION % 100 < 0
46#error Ice patch level mismatch!
47#endif
48#endif
49
50#ifdef ICE_CPP11_MAPPING // C++11 mapping
51
52namespace
53{
54
55 const ::IceInternal::DefaultUserExceptionFactoryInit<
57 iceC_IceStormElection_ObserverInconsistencyException_init(
58 "::IceStormElection::ObserverInconsistencyException");
59
60 const ::std::string iceC_IceStormElection_ReplicaObserver_ids[2] = {
61 "::Ice::Object",
62 "::IceStormElection::ReplicaObserver"};
63 const ::std::string iceC_IceStormElection_ReplicaObserver_ops[] = {"addSubscriber",
64 "createTopic",
65 "destroyTopic",
66 "ice_id",
67 "ice_ids",
68 "ice_isA",
69 "ice_ping",
70 "init",
71 "removeSubscriber"};
72 const ::std::string iceC_IceStormElection_ReplicaObserver_init_name = "init";
73 const ::std::string iceC_IceStormElection_ReplicaObserver_createTopic_name = "createTopic";
74 const ::std::string iceC_IceStormElection_ReplicaObserver_destroyTopic_name = "destroyTopic";
75 const ::std::string iceC_IceStormElection_ReplicaObserver_addSubscriber_name = "addSubscriber";
76 const ::std::string iceC_IceStormElection_ReplicaObserver_removeSubscriber_name =
77 "removeSubscriber";
78
79 const ::std::string iceC_IceStormElection_TopicManagerSync_ids[2] = {
80 "::Ice::Object",
81 "::IceStormElection::TopicManagerSync"};
82 const ::std::string iceC_IceStormElection_TopicManagerSync_ops[] = {"getContent",
83 "ice_id",
84 "ice_ids",
85 "ice_isA",
86 "ice_ping"};
87 const ::std::string iceC_IceStormElection_TopicManagerSync_getContent_name = "getContent";
88
89 const ::std::string iceC_IceStormElection_Node_ids[2] = {"::Ice::Object",
90 "::IceStormElection::Node"};
91 const ::std::string iceC_IceStormElection_Node_ops[] = {"accept",
92 "areYouCoordinator",
93 "areYouThere",
94 "ice_id",
95 "ice_ids",
96 "ice_isA",
97 "ice_ping",
98 "invitation",
99 "nodes",
100 "query",
101 "ready",
102 "sync"};
103 const ::std::string iceC_IceStormElection_Node_invitation_name = "invitation";
104 const ::std::string iceC_IceStormElection_Node_ready_name = "ready";
105 const ::std::string iceC_IceStormElection_Node_accept_name = "accept";
106 const ::std::string iceC_IceStormElection_Node_areYouCoordinator_name = "areYouCoordinator";
107 const ::std::string iceC_IceStormElection_Node_areYouThere_name = "areYouThere";
108 const ::std::string iceC_IceStormElection_Node_sync_name = "sync";
109 const ::std::string iceC_IceStormElection_Node_nodes_name = "nodes";
110 const ::std::string iceC_IceStormElection_Node_query_name = "query";
111
112} // namespace
113
115{
116}
117
118const ::std::string&
119IceStormElection::ObserverInconsistencyException::ice_staticId()
120{
121 static const ::std::string typeId = "::IceStormElection::ObserverInconsistencyException";
122 return typeId;
123}
124
125bool
126IceStormElection::ReplicaObserver::ice_isA(::std::string s, const ::Ice::Current&) const
127{
128 return ::std::binary_search(iceC_IceStormElection_ReplicaObserver_ids,
129 iceC_IceStormElection_ReplicaObserver_ids + 2,
130 s);
131}
132
133::std::vector<::std::string>
134IceStormElection::ReplicaObserver::ice_ids(const ::Ice::Current&) const
135{
136 return ::std::vector<::std::string>(&iceC_IceStormElection_ReplicaObserver_ids[0],
137 &iceC_IceStormElection_ReplicaObserver_ids[2]);
138}
139
140::std::string
141IceStormElection::ReplicaObserver::ice_id(const ::Ice::Current&) const
142{
143 return ice_staticId();
144}
145
146const ::std::string&
148{
149 static const ::std::string typeId = "::IceStormElection::ReplicaObserver";
150 return typeId;
151}
152
153bool
154IceStormElection::ReplicaObserver::_iceD_init(::IceInternal::Incoming& inS,
155 const ::Ice::Current& current)
156{
157 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
158 auto istr = inS.startReadParams();
159 ::IceStormElection::LogUpdate iceP_llu;
161 istr->readAll(iceP_llu, iceP_content);
162 inS.endReadParams();
163 this->init(::std::move(iceP_llu), ::std::move(iceP_content), current);
164 inS.writeEmptyParams();
165 return true;
166}
167
168bool
170 const ::Ice::Current& current)
171{
172 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
173 auto istr = inS.startReadParams();
174 ::IceStormElection::LogUpdate iceP_llu;
175 ::std::string iceP_name;
176 istr->readAll(iceP_llu, iceP_name);
177 inS.endReadParams();
178 this->createTopic(::std::move(iceP_llu), ::std::move(iceP_name), current);
179 inS.writeEmptyParams();
180 return true;
181}
182
183bool
185 const ::Ice::Current& current)
186{
187 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
188 auto istr = inS.startReadParams();
189 ::IceStormElection::LogUpdate iceP_llu;
190 ::std::string iceP_name;
191 istr->readAll(iceP_llu, iceP_name);
192 inS.endReadParams();
193 this->destroyTopic(::std::move(iceP_llu), ::std::move(iceP_name), current);
194 inS.writeEmptyParams();
195 return true;
196}
197
198bool
200 const ::Ice::Current& current)
201{
202 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
203 auto istr = inS.startReadParams();
204 ::IceStormElection::LogUpdate iceP_llu;
205 ::std::string iceP_topic;
206 ::IceStorm::SubscriberRecord iceP_record;
207 istr->readAll(iceP_llu, iceP_topic, iceP_record);
208 inS.endReadParams();
209 this->addSubscriber(
210 ::std::move(iceP_llu), ::std::move(iceP_topic), ::std::move(iceP_record), current);
211 inS.writeEmptyParams();
212 return true;
213}
214
215bool
217 const ::Ice::Current& current)
218{
219 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
220 auto istr = inS.startReadParams();
221 ::IceStormElection::LogUpdate iceP_llu;
222 ::std::string iceP_topic;
223 ::Ice::IdentitySeq iceP_subscribers;
224 istr->readAll(iceP_llu, iceP_topic, iceP_subscribers);
225 inS.endReadParams();
226 this->removeSubscriber(
227 ::std::move(iceP_llu), ::std::move(iceP_topic), ::std::move(iceP_subscribers), current);
228 inS.writeEmptyParams();
229 return true;
230}
231
232bool
233IceStormElection::ReplicaObserver::_iceDispatch(::IceInternal::Incoming& in,
234 const ::Ice::Current& current)
235{
236 ::std::pair<const ::std::string*, const ::std::string*> r =
237 ::std::equal_range(iceC_IceStormElection_ReplicaObserver_ops,
238 iceC_IceStormElection_ReplicaObserver_ops + 9,
239 current.operation);
240 if (r.first == r.second)
241 {
242 throw ::Ice::OperationNotExistException(
243 __FILE__, __LINE__, current.id, current.facet, current.operation);
244 }
245
246 switch (r.first - iceC_IceStormElection_ReplicaObserver_ops)
247 {
248 case 0:
249 {
250 return _iceD_addSubscriber(in, current);
251 }
252 case 1:
253 {
254 return _iceD_createTopic(in, current);
255 }
256 case 2:
257 {
258 return _iceD_destroyTopic(in, current);
259 }
260 case 3:
261 {
262 return _iceD_ice_id(in, current);
263 }
264 case 4:
265 {
266 return _iceD_ice_ids(in, current);
267 }
268 case 5:
269 {
270 return _iceD_ice_isA(in, current);
271 }
272 case 6:
273 {
274 return _iceD_ice_ping(in, current);
275 }
276 case 7:
277 {
278 return _iceD_init(in, current);
279 }
280 case 8:
281 {
282 return _iceD_removeSubscriber(in, current);
283 }
284 default:
285 {
286 assert(false);
287 throw ::Ice::OperationNotExistException(
288 __FILE__, __LINE__, current.id, current.facet, current.operation);
289 }
290 }
291}
292
293bool
294IceStormElection::TopicManagerSync::ice_isA(::std::string s, const ::Ice::Current&) const
295{
296 return ::std::binary_search(iceC_IceStormElection_TopicManagerSync_ids,
297 iceC_IceStormElection_TopicManagerSync_ids + 2,
298 s);
299}
300
301::std::vector<::std::string>
302IceStormElection::TopicManagerSync::ice_ids(const ::Ice::Current&) const
303{
304 return ::std::vector<::std::string>(&iceC_IceStormElection_TopicManagerSync_ids[0],
305 &iceC_IceStormElection_TopicManagerSync_ids[2]);
306}
307
308::std::string
309IceStormElection::TopicManagerSync::ice_id(const ::Ice::Current&) const
310{
311 return ice_staticId();
312}
313
314const ::std::string&
316{
317 static const ::std::string typeId = "::IceStormElection::TopicManagerSync";
318 return typeId;
319}
320
321bool
323 const ::Ice::Current& current)
324{
325 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
326 inS.readEmptyParams();
327 ::IceStormElection::LogUpdate iceP_llu;
329 this->getContent(iceP_llu, iceP_content, current);
330 auto ostr = inS.startWriteParams();
331 ostr->writeAll(iceP_llu, iceP_content);
332 inS.endWriteParams();
333 return true;
334}
335
336bool
337IceStormElection::TopicManagerSync::_iceDispatch(::IceInternal::Incoming& in,
338 const ::Ice::Current& current)
339{
340 ::std::pair<const ::std::string*, const ::std::string*> r =
341 ::std::equal_range(iceC_IceStormElection_TopicManagerSync_ops,
342 iceC_IceStormElection_TopicManagerSync_ops + 5,
343 current.operation);
344 if (r.first == r.second)
345 {
346 throw ::Ice::OperationNotExistException(
347 __FILE__, __LINE__, current.id, current.facet, current.operation);
348 }
349
350 switch (r.first - iceC_IceStormElection_TopicManagerSync_ops)
351 {
352 case 0:
353 {
354 return _iceD_getContent(in, current);
355 }
356 case 1:
357 {
358 return _iceD_ice_id(in, current);
359 }
360 case 2:
361 {
362 return _iceD_ice_ids(in, current);
363 }
364 case 3:
365 {
366 return _iceD_ice_isA(in, current);
367 }
368 case 4:
369 {
370 return _iceD_ice_ping(in, current);
371 }
372 default:
373 {
374 assert(false);
375 throw ::Ice::OperationNotExistException(
376 __FILE__, __LINE__, current.id, current.facet, current.operation);
377 }
378 }
379}
380
381bool
382IceStormElection::Node::ice_isA(::std::string s, const ::Ice::Current&) const
383{
384 return ::std::binary_search(
385 iceC_IceStormElection_Node_ids, iceC_IceStormElection_Node_ids + 2, s);
386}
387
388::std::vector<::std::string>
389IceStormElection::Node::ice_ids(const ::Ice::Current&) const
390{
391 return ::std::vector<::std::string>(&iceC_IceStormElection_Node_ids[0],
392 &iceC_IceStormElection_Node_ids[2]);
393}
394
395::std::string
396IceStormElection::Node::ice_id(const ::Ice::Current&) const
397{
398 return ice_staticId();
399}
400
401const ::std::string&
403{
404 static const ::std::string typeId = "::IceStormElection::Node";
405 return typeId;
406}
407
408bool
409IceStormElection::Node::_iceD_invitation(::IceInternal::Incoming& inS,
410 const ::Ice::Current& current)
411{
412 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
413 auto istr = inS.startReadParams();
414 int iceP_j;
415 ::std::string iceP_gn;
416 istr->readAll(iceP_j, iceP_gn);
417 inS.endReadParams();
418 this->invitation(iceP_j, ::std::move(iceP_gn), current);
419 inS.writeEmptyParams();
420 return true;
421}
422
423bool
424IceStormElection::Node::_iceD_ready(::IceInternal::Incoming& inS, const ::Ice::Current& current)
425{
426 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
427 auto istr = inS.startReadParams();
428 int iceP_j;
429 ::std::string iceP_gn;
430 ::std::shared_ptr<::Ice::ObjectPrx> iceP_coordinator;
431 int iceP_max;
432 long long int iceP_generation;
433 istr->readAll(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation);
434 inS.endReadParams();
435 this->ready(iceP_j,
436 ::std::move(iceP_gn),
437 ::std::move(iceP_coordinator),
438 iceP_max,
439 iceP_generation,
440 current);
441 inS.writeEmptyParams();
442 return true;
443}
444
445bool
446IceStormElection::Node::_iceD_accept(::IceInternal::Incoming& inS, const ::Ice::Current& current)
447{
448 _iceCheckMode(::Ice::OperationMode::Normal, current.mode);
449 auto istr = inS.startReadParams();
450 int iceP_j;
451 ::std::string iceP_gn;
452 ::Ice::IntSeq iceP_forwardedInvites;
453 ::std::shared_ptr<::Ice::ObjectPrx> iceP_observer;
454 ::IceStormElection::LogUpdate iceP_llu;
455 int iceP_max;
456 istr->readAll(iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max);
457 inS.endReadParams();
458 this->accept(iceP_j,
459 ::std::move(iceP_gn),
460 ::std::move(iceP_forwardedInvites),
461 ::std::move(iceP_observer),
462 ::std::move(iceP_llu),
463 iceP_max,
464 current);
465 inS.writeEmptyParams();
466 return true;
467}
468
469bool
470IceStormElection::Node::_iceD_areYouCoordinator(::IceInternal::Incoming& inS,
471 const ::Ice::Current& current) const
472{
473 _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
474 inS.readEmptyParams();
475 bool ret = this->areYouCoordinator(current);
476 auto ostr = inS.startWriteParams();
477 ostr->writeAll(ret);
478 inS.endWriteParams();
479 return true;
480}
481
482bool
483IceStormElection::Node::_iceD_areYouThere(::IceInternal::Incoming& inS,
484 const ::Ice::Current& current) const
485{
486 _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
487 auto istr = inS.startReadParams();
488 ::std::string iceP_gn;
489 int iceP_j;
490 istr->readAll(iceP_gn, iceP_j);
491 inS.endReadParams();
492 bool ret = this->areYouThere(::std::move(iceP_gn), iceP_j, current);
493 auto ostr = inS.startWriteParams();
494 ostr->writeAll(ret);
495 inS.endWriteParams();
496 return true;
497}
498
499bool
500IceStormElection::Node::_iceD_sync(::IceInternal::Incoming& inS,
501 const ::Ice::Current& current) const
502{
503 _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
504 inS.readEmptyParams();
505 ::std::shared_ptr<::Ice::ObjectPrx> ret = this->sync(current);
506 auto ostr = inS.startWriteParams();
507 ostr->writeAll(ret);
508 inS.endWriteParams();
509 return true;
510}
511
512bool
513IceStormElection::Node::_iceD_nodes(::IceInternal::Incoming& inS,
514 const ::Ice::Current& current) const
515{
516 _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
517 inS.readEmptyParams();
518 ::IceStormElection::NodeInfoSeq ret = this->nodes(current);
519 auto ostr = inS.startWriteParams();
520 ostr->writeAll(ret);
521 inS.endWriteParams();
522 return true;
523}
524
525bool
526IceStormElection::Node::_iceD_query(::IceInternal::Incoming& inS,
527 const ::Ice::Current& current) const
528{
529 _iceCheckMode(::Ice::OperationMode::Idempotent, current.mode);
530 inS.readEmptyParams();
531 ::IceStormElection::QueryInfo ret = this->query(current);
532 auto ostr = inS.startWriteParams();
533 ostr->writeAll(ret);
534 inS.endWriteParams();
535 return true;
536}
537
538bool
539IceStormElection::Node::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
540{
541 ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(
542 iceC_IceStormElection_Node_ops, iceC_IceStormElection_Node_ops + 12, current.operation);
543 if (r.first == r.second)
544 {
545 throw ::Ice::OperationNotExistException(
546 __FILE__, __LINE__, current.id, current.facet, current.operation);
547 }
548
549 switch (r.first - iceC_IceStormElection_Node_ops)
550 {
551 case 0:
552 {
553 return _iceD_accept(in, current);
554 }
555 case 1:
556 {
557 return _iceD_areYouCoordinator(in, current);
558 }
559 case 2:
560 {
561 return _iceD_areYouThere(in, current);
562 }
563 case 3:
564 {
565 return _iceD_ice_id(in, current);
566 }
567 case 4:
568 {
569 return _iceD_ice_ids(in, current);
570 }
571 case 5:
572 {
573 return _iceD_ice_isA(in, current);
574 }
575 case 6:
576 {
577 return _iceD_ice_ping(in, current);
578 }
579 case 7:
580 {
581 return _iceD_invitation(in, current);
582 }
583 case 8:
584 {
585 return _iceD_nodes(in, current);
586 }
587 case 9:
588 {
589 return _iceD_query(in, current);
590 }
591 case 10:
592 {
593 return _iceD_ready(in, current);
594 }
595 case 11:
596 {
597 return _iceD_sync(in, current);
598 }
599 default:
600 {
601 assert(false);
602 throw ::Ice::OperationNotExistException(
603 __FILE__, __LINE__, current.id, current.facet, current.operation);
604 }
605 }
606}
607
608void
609IceStormElection::ReplicaObserverPrx::_iceI_init(
610 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync,
611 const ::IceStormElection::LogUpdate& iceP_llu,
612 const ::IceStormElection::TopicContentSeq& iceP_content,
613 const ::Ice::Context& context)
614{
615 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_init_name);
616 outAsync->invoke(
617 iceC_IceStormElection_ReplicaObserver_init_name,
618 ::Ice::OperationMode::Normal,
619 ::Ice::FormatType::DefaultFormat,
620 context,
621 [&](::Ice::OutputStream* ostr) { ostr->writeAll(iceP_llu, iceP_content); },
622 [](const ::Ice::UserException& ex)
623 {
624 try
625 {
626 ex.ice_throw();
627 }
628 catch (const ::IceStormElection::ObserverInconsistencyException&)
629 {
630 throw;
631 }
632 catch (const ::Ice::UserException&)
633 {
634 }
635 });
636}
637
638void
639IceStormElection::ReplicaObserverPrx::_iceI_createTopic(
640 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync,
641 const ::IceStormElection::LogUpdate& iceP_llu,
642 const ::std::string& iceP_name,
643 const ::Ice::Context& context)
644{
645 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_createTopic_name);
646 outAsync->invoke(
647 iceC_IceStormElection_ReplicaObserver_createTopic_name,
648 ::Ice::OperationMode::Normal,
649 ::Ice::FormatType::DefaultFormat,
650 context,
651 [&](::Ice::OutputStream* ostr) { ostr->writeAll(iceP_llu, iceP_name); },
652 [](const ::Ice::UserException& ex)
653 {
654 try
655 {
656 ex.ice_throw();
657 }
658 catch (const ::IceStormElection::ObserverInconsistencyException&)
659 {
660 throw;
661 }
662 catch (const ::Ice::UserException&)
663 {
664 }
665 });
666}
667
668void
669IceStormElection::ReplicaObserverPrx::_iceI_destroyTopic(
670 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync,
671 const ::IceStormElection::LogUpdate& iceP_llu,
672 const ::std::string& iceP_name,
673 const ::Ice::Context& context)
674{
675 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
676 outAsync->invoke(
677 iceC_IceStormElection_ReplicaObserver_destroyTopic_name,
678 ::Ice::OperationMode::Normal,
679 ::Ice::FormatType::DefaultFormat,
680 context,
681 [&](::Ice::OutputStream* ostr) { ostr->writeAll(iceP_llu, iceP_name); },
682 [](const ::Ice::UserException& ex)
683 {
684 try
685 {
686 ex.ice_throw();
687 }
688 catch (const ::IceStormElection::ObserverInconsistencyException&)
689 {
690 throw;
691 }
692 catch (const ::Ice::UserException&)
693 {
694 }
695 });
696}
697
698void
699IceStormElection::ReplicaObserverPrx::_iceI_addSubscriber(
700 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync,
701 const ::IceStormElection::LogUpdate& iceP_llu,
702 const ::std::string& iceP_topic,
703 const ::IceStorm::SubscriberRecord& iceP_record,
704 const ::Ice::Context& context)
705{
706 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
707 outAsync->invoke(
708 iceC_IceStormElection_ReplicaObserver_addSubscriber_name,
709 ::Ice::OperationMode::Normal,
710 ::Ice::FormatType::DefaultFormat,
711 context,
712 [&](::Ice::OutputStream* ostr) { ostr->writeAll(iceP_llu, iceP_topic, iceP_record); },
713 [](const ::Ice::UserException& ex)
714 {
715 try
716 {
717 ex.ice_throw();
718 }
719 catch (const ::IceStormElection::ObserverInconsistencyException&)
720 {
721 throw;
722 }
723 catch (const ::Ice::UserException&)
724 {
725 }
726 });
727}
728
729void
730IceStormElection::ReplicaObserverPrx::_iceI_removeSubscriber(
731 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync,
732 const ::IceStormElection::LogUpdate& iceP_llu,
733 const ::std::string& iceP_topic,
734 const ::Ice::IdentitySeq& iceP_subscribers,
735 const ::Ice::Context& context)
736{
737 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
738 outAsync->invoke(
739 iceC_IceStormElection_ReplicaObserver_removeSubscriber_name,
740 ::Ice::OperationMode::Normal,
741 ::Ice::FormatType::DefaultFormat,
742 context,
743 [&](::Ice::OutputStream* ostr) { ostr->writeAll(iceP_llu, iceP_topic, iceP_subscribers); },
744 [](const ::Ice::UserException& ex)
745 {
746 try
747 {
748 ex.ice_throw();
749 }
750 catch (const ::IceStormElection::ObserverInconsistencyException&)
751 {
752 throw;
753 }
754 catch (const ::Ice::UserException&)
755 {
756 }
757 });
758}
759
760::std::shared_ptr<::Ice::ObjectPrx>
761IceStormElection::ReplicaObserverPrx::_newInstance() const
762{
763 return ::IceInternal::createProxy<ReplicaObserverPrx>();
764}
765
766const ::std::string&
767IceStormElection::ReplicaObserverPrx::ice_staticId()
768{
770}
771
772void
773IceStormElection::TopicManagerSyncPrx::_iceI_getContent(
774 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<
775 ::IceStormElection::TopicManagerSync::GetContentResult>>& outAsync,
776 const ::Ice::Context& context)
777{
778 _checkTwowayOnly(iceC_IceStormElection_TopicManagerSync_getContent_name);
779 outAsync->invoke(iceC_IceStormElection_TopicManagerSync_getContent_name,
780 ::Ice::OperationMode::Normal,
781 ::Ice::FormatType::DefaultFormat,
782 context,
783 nullptr,
784 nullptr,
785 [](::Ice::InputStream* istr)
786 {
787 ::IceStormElection::TopicManagerSync::GetContentResult v;
788 istr->readAll(v.llu, v.content);
789 return v;
790 });
791}
792
793::std::shared_ptr<::Ice::ObjectPrx>
794IceStormElection::TopicManagerSyncPrx::_newInstance() const
795{
796 return ::IceInternal::createProxy<TopicManagerSyncPrx>();
797}
798
799const ::std::string&
800IceStormElection::TopicManagerSyncPrx::ice_staticId()
801{
803}
804
805void
806IceStormElection::NodePrx::_iceI_invitation(
807 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync,
808 int iceP_j,
809 const ::std::string& iceP_gn,
810 const ::Ice::Context& context)
811{
812 outAsync->invoke(
813 iceC_IceStormElection_Node_invitation_name,
814 ::Ice::OperationMode::Normal,
815 ::Ice::FormatType::DefaultFormat,
816 context,
817 [&](::Ice::OutputStream* ostr) { ostr->writeAll(iceP_j, iceP_gn); },
818 nullptr);
819}
820
821void
822IceStormElection::NodePrx::_iceI_ready(
823 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync,
824 int iceP_j,
825 const ::std::string& iceP_gn,
826 const ::std::shared_ptr<::Ice::ObjectPrx>& iceP_coordinator,
827 int iceP_max,
828 long long int iceP_generation,
829 const ::Ice::Context& context)
830{
831 outAsync->invoke(
832 iceC_IceStormElection_Node_ready_name,
833 ::Ice::OperationMode::Normal,
834 ::Ice::FormatType::DefaultFormat,
835 context,
836 [&](::Ice::OutputStream* ostr)
837 { ostr->writeAll(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation); },
838 nullptr);
839}
840
841void
842IceStormElection::NodePrx::_iceI_accept(
843 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<void>>& outAsync,
844 int iceP_j,
845 const ::std::string& iceP_gn,
846 const ::Ice::IntSeq& iceP_forwardedInvites,
847 const ::std::shared_ptr<::Ice::ObjectPrx>& iceP_observer,
848 const ::IceStormElection::LogUpdate& iceP_llu,
849 int iceP_max,
850 const ::Ice::Context& context)
851{
852 outAsync->invoke(
853 iceC_IceStormElection_Node_accept_name,
854 ::Ice::OperationMode::Normal,
855 ::Ice::FormatType::DefaultFormat,
856 context,
857 [&](::Ice::OutputStream* ostr) {
858 ostr->writeAll(
859 iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max);
860 },
861 nullptr);
862}
863
864void
865IceStormElection::NodePrx::_iceI_areYouCoordinator(
866 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<bool>>& outAsync,
867 const ::Ice::Context& context)
868{
869 _checkTwowayOnly(iceC_IceStormElection_Node_areYouCoordinator_name);
870 outAsync->invoke(iceC_IceStormElection_Node_areYouCoordinator_name,
871 ::Ice::OperationMode::Idempotent,
872 ::Ice::FormatType::DefaultFormat,
873 context,
874 nullptr,
875 nullptr);
876}
877
878void
879IceStormElection::NodePrx::_iceI_areYouThere(
880 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<bool>>& outAsync,
881 const ::std::string& iceP_gn,
882 int iceP_j,
883 const ::Ice::Context& context)
884{
885 _checkTwowayOnly(iceC_IceStormElection_Node_areYouThere_name);
886 outAsync->invoke(
887 iceC_IceStormElection_Node_areYouThere_name,
888 ::Ice::OperationMode::Idempotent,
889 ::Ice::FormatType::DefaultFormat,
890 context,
891 [&](::Ice::OutputStream* ostr) { ostr->writeAll(iceP_gn, iceP_j); },
892 nullptr);
893}
894
895void
896IceStormElection::NodePrx::_iceI_sync(
897 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::std::shared_ptr<::Ice::ObjectPrx>>>&
898 outAsync,
899 const ::Ice::Context& context)
900{
901 _checkTwowayOnly(iceC_IceStormElection_Node_sync_name);
902 outAsync->invoke(iceC_IceStormElection_Node_sync_name,
903 ::Ice::OperationMode::Idempotent,
904 ::Ice::FormatType::DefaultFormat,
905 context,
906 nullptr,
907 nullptr);
908}
909
910void
911IceStormElection::NodePrx::_iceI_nodes(
912 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::IceStormElection::NodeInfoSeq>>&
913 outAsync,
914 const ::Ice::Context& context)
915{
916 _checkTwowayOnly(iceC_IceStormElection_Node_nodes_name);
917 outAsync->invoke(iceC_IceStormElection_Node_nodes_name,
918 ::Ice::OperationMode::Idempotent,
919 ::Ice::FormatType::DefaultFormat,
920 context,
921 nullptr,
922 nullptr);
923}
924
925void
926IceStormElection::NodePrx::_iceI_query(
927 const ::std::shared_ptr<::IceInternal::OutgoingAsyncT<::IceStormElection::QueryInfo>>& outAsync,
928 const ::Ice::Context& context)
929{
930 _checkTwowayOnly(iceC_IceStormElection_Node_query_name);
931 outAsync->invoke(iceC_IceStormElection_Node_query_name,
932 ::Ice::OperationMode::Idempotent,
933 ::Ice::FormatType::DefaultFormat,
934 context,
935 nullptr,
936 nullptr);
937}
938
939::std::shared_ptr<::Ice::ObjectPrx>
940IceStormElection::NodePrx::_newInstance() const
941{
942 return ::IceInternal::createProxy<NodePrx>();
943}
944
945const ::std::string&
946IceStormElection::NodePrx::ice_staticId()
947{
949}
950
951namespace Ice
952{
953}
954
955#else // C++98 mapping
956
957namespace
958{
959
960 const ::std::string iceC_IceStormElection_ReplicaObserver_init_name = "init";
961
962 const ::std::string iceC_IceStormElection_ReplicaObserver_createTopic_name = "createTopic";
963
964 const ::std::string iceC_IceStormElection_ReplicaObserver_destroyTopic_name = "destroyTopic";
965
966 const ::std::string iceC_IceStormElection_ReplicaObserver_addSubscriber_name = "addSubscriber";
967
968 const ::std::string iceC_IceStormElection_ReplicaObserver_removeSubscriber_name =
969 "removeSubscriber";
970
971 const ::std::string iceC_IceStormElection_TopicManagerSync_getContent_name = "getContent";
972
973 const ::std::string iceC_IceStormElection_Node_invitation_name = "invitation";
974
975 const ::std::string iceC_IceStormElection_Node_ready_name = "ready";
976
977 const ::std::string iceC_IceStormElection_Node_accept_name = "accept";
978
979 const ::std::string iceC_IceStormElection_Node_areYouCoordinator_name = "areYouCoordinator";
980
981 const ::std::string iceC_IceStormElection_Node_areYouThere_name = "areYouThere";
982
983 const ::std::string iceC_IceStormElection_Node_sync_name = "sync";
984
985 const ::std::string iceC_IceStormElection_Node_nodes_name = "nodes";
986
987 const ::std::string iceC_IceStormElection_Node_query_name = "query";
988
989} // namespace
990
991namespace
992{
993
994 const ::IceInternal::DefaultUserExceptionFactoryInit<
995 ::IceStormElection::ObserverInconsistencyException>
996 iceC_IceStormElection_ObserverInconsistencyException_init(
997 "::IceStormElection::ObserverInconsistencyException");
998
999}
1000
1002 const ::std::string& iceP_reason) :
1003 ::Ice::UserException(), reason(iceP_reason)
1004{
1005}
1006
1010
1011::std::string
1013{
1014 return "::IceStormElection::ObserverInconsistencyException";
1015}
1016
1022
1023void
1028
1029void
1031{
1032 ostr->startSlice("::IceStormElection::ObserverInconsistencyException", -1, true);
1034 ::Ice::OutputStream>::write(ostr, *this);
1035 ostr->endSlice();
1036}
1037
1038void
1040{
1041 istr->startSlice();
1042 Ice::StreamReader<::IceStormElection::ObserverInconsistencyException, ::Ice::InputStream>::read(
1043 istr, *this);
1044 istr->endSlice();
1045}
1046
1049{
1050 return p;
1051}
1052
1053void ::IceProxy::IceStormElection::_readProxy(
1054 ::Ice::InputStream* istr,
1056{
1057 ::Ice::ObjectPrx proxy;
1058 istr->read(proxy);
1059 if (!proxy)
1060 {
1061 v = 0;
1062 }
1063 else
1064 {
1065 v = new ::IceProxy::IceStormElection::ReplicaObserver;
1066 v->_copyFrom(proxy);
1067 }
1068}
1069
1070::Ice::AsyncResultPtr
1071IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_init(
1072 const ::IceStormElection::LogUpdate& iceP_llu,
1073 const ::IceStormElection::TopicContentSeq& iceP_content,
1074 const ::Ice::Context& context,
1075 const ::IceInternal::CallbackBasePtr& del,
1076 const ::Ice::LocalObjectPtr& cookie,
1077 bool sync)
1078{
1079 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_init_name, sync);
1080 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1081 this, iceC_IceStormElection_ReplicaObserver_init_name, del, cookie, sync);
1082 try
1083 {
1084 result->prepare(iceC_IceStormElection_ReplicaObserver_init_name, ::Ice::Normal, context);
1085 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1086 ostr->write(iceP_llu);
1087 ostr->write(iceP_content);
1088 result->endWriteParams();
1089 result->invoke(iceC_IceStormElection_ReplicaObserver_init_name);
1090 }
1091 catch (const ::Ice::Exception& ex)
1092 {
1093 result->abort(ex);
1094 }
1095 return result;
1096}
1097
1098void
1100{
1101 ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_ReplicaObserver_init_name);
1102 if (!result->_waitForResponse())
1103 {
1104 try
1105 {
1106 result->_throwUserException();
1107 }
1108 catch (const ::IceStormElection::ObserverInconsistencyException&)
1109 {
1110 throw;
1111 }
1112 catch (const ::Ice::UserException& ex)
1113 {
1114 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1115 }
1116 }
1117 result->_readEmptyParams();
1118}
1119
1120::Ice::AsyncResultPtr
1121IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_createTopic(
1122 const ::IceStormElection::LogUpdate& iceP_llu,
1123 const ::std::string& iceP_name,
1124 const ::Ice::Context& context,
1125 const ::IceInternal::CallbackBasePtr& del,
1126 const ::Ice::LocalObjectPtr& cookie,
1127 bool sync)
1128{
1129 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_createTopic_name, sync);
1130 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1131 this, iceC_IceStormElection_ReplicaObserver_createTopic_name, del, cookie, sync);
1132 try
1133 {
1134 result->prepare(
1135 iceC_IceStormElection_ReplicaObserver_createTopic_name, ::Ice::Normal, context);
1136 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1137 ostr->write(iceP_llu);
1138 ostr->write(iceP_name);
1139 result->endWriteParams();
1140 result->invoke(iceC_IceStormElection_ReplicaObserver_createTopic_name);
1141 }
1142 catch (const ::Ice::Exception& ex)
1143 {
1144 result->abort(ex);
1145 }
1146 return result;
1147}
1148
1149void
1151{
1152 ::Ice::AsyncResult::_check(
1153 result, this, iceC_IceStormElection_ReplicaObserver_createTopic_name);
1154 if (!result->_waitForResponse())
1155 {
1156 try
1157 {
1158 result->_throwUserException();
1159 }
1160 catch (const ::IceStormElection::ObserverInconsistencyException&)
1161 {
1162 throw;
1163 }
1164 catch (const ::Ice::UserException& ex)
1165 {
1166 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1167 }
1168 }
1169 result->_readEmptyParams();
1170}
1171
1172::Ice::AsyncResultPtr
1173IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_destroyTopic(
1174 const ::IceStormElection::LogUpdate& iceP_llu,
1175 const ::std::string& iceP_name,
1176 const ::Ice::Context& context,
1177 const ::IceInternal::CallbackBasePtr& del,
1178 const ::Ice::LocalObjectPtr& cookie,
1179 bool sync)
1180{
1181 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_destroyTopic_name, sync);
1182 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1183 this, iceC_IceStormElection_ReplicaObserver_destroyTopic_name, del, cookie, sync);
1184 try
1185 {
1186 result->prepare(
1187 iceC_IceStormElection_ReplicaObserver_destroyTopic_name, ::Ice::Normal, context);
1188 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1189 ostr->write(iceP_llu);
1190 ostr->write(iceP_name);
1191 result->endWriteParams();
1192 result->invoke(iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
1193 }
1194 catch (const ::Ice::Exception& ex)
1195 {
1196 result->abort(ex);
1197 }
1198 return result;
1199}
1200
1201void
1203{
1204 ::Ice::AsyncResult::_check(
1205 result, this, iceC_IceStormElection_ReplicaObserver_destroyTopic_name);
1206 if (!result->_waitForResponse())
1207 {
1208 try
1209 {
1210 result->_throwUserException();
1211 }
1212 catch (const ::IceStormElection::ObserverInconsistencyException&)
1213 {
1214 throw;
1215 }
1216 catch (const ::Ice::UserException& ex)
1217 {
1218 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1219 }
1220 }
1221 result->_readEmptyParams();
1222}
1223
1224::Ice::AsyncResultPtr
1225IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_addSubscriber(
1226 const ::IceStormElection::LogUpdate& iceP_llu,
1227 const ::std::string& iceP_topic,
1228 const ::IceStorm::SubscriberRecord& iceP_record,
1229 const ::Ice::Context& context,
1230 const ::IceInternal::CallbackBasePtr& del,
1231 const ::Ice::LocalObjectPtr& cookie,
1232 bool sync)
1233{
1234 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_addSubscriber_name, sync);
1235 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1236 this, iceC_IceStormElection_ReplicaObserver_addSubscriber_name, del, cookie, sync);
1237 try
1238 {
1239 result->prepare(
1240 iceC_IceStormElection_ReplicaObserver_addSubscriber_name, ::Ice::Normal, context);
1241 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1242 ostr->write(iceP_llu);
1243 ostr->write(iceP_topic);
1244 ostr->write(iceP_record);
1245 result->endWriteParams();
1246 result->invoke(iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
1247 }
1248 catch (const ::Ice::Exception& ex)
1249 {
1250 result->abort(ex);
1251 }
1252 return result;
1253}
1254
1255void
1257{
1258 ::Ice::AsyncResult::_check(
1259 result, this, iceC_IceStormElection_ReplicaObserver_addSubscriber_name);
1260 if (!result->_waitForResponse())
1261 {
1262 try
1263 {
1264 result->_throwUserException();
1265 }
1266 catch (const ::IceStormElection::ObserverInconsistencyException&)
1267 {
1268 throw;
1269 }
1270 catch (const ::Ice::UserException& ex)
1271 {
1272 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1273 }
1274 }
1275 result->_readEmptyParams();
1276}
1277
1278::Ice::AsyncResultPtr
1279IceProxy::IceStormElection::ReplicaObserver::_iceI_begin_removeSubscriber(
1280 const ::IceStormElection::LogUpdate& iceP_llu,
1281 const ::std::string& iceP_topic,
1282 const ::Ice::IdentitySeq& iceP_subscribers,
1283 const ::Ice::Context& context,
1284 const ::IceInternal::CallbackBasePtr& del,
1285 const ::Ice::LocalObjectPtr& cookie,
1286 bool sync)
1287{
1288 _checkTwowayOnly(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, sync);
1289 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1290 this, iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, del, cookie, sync);
1291 try
1292 {
1293 result->prepare(
1294 iceC_IceStormElection_ReplicaObserver_removeSubscriber_name, ::Ice::Normal, context);
1295 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1296 ostr->write(iceP_llu);
1297 ostr->write(iceP_topic);
1298 ostr->write(iceP_subscribers);
1299 result->endWriteParams();
1300 result->invoke(iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
1301 }
1302 catch (const ::Ice::Exception& ex)
1303 {
1304 result->abort(ex);
1305 }
1306 return result;
1307}
1308
1309void
1311 const ::Ice::AsyncResultPtr& result)
1312{
1313 ::Ice::AsyncResult::_check(
1314 result, this, iceC_IceStormElection_ReplicaObserver_removeSubscriber_name);
1315 if (!result->_waitForResponse())
1316 {
1317 try
1318 {
1319 result->_throwUserException();
1320 }
1321 catch (const ::IceStormElection::ObserverInconsistencyException&)
1322 {
1323 throw;
1324 }
1325 catch (const ::Ice::UserException& ex)
1326 {
1327 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1328 }
1329 }
1330 result->_readEmptyParams();
1331}
1332
1333::IceProxy::Ice::Object*
1338
1339const ::std::string&
1341{
1342 return ::IceStormElection::ReplicaObserver::ice_staticId();
1343}
1344
1347{
1348 return p;
1349}
1350
1351void ::IceProxy::IceStormElection::_readProxy(
1352 ::Ice::InputStream* istr,
1354{
1355 ::Ice::ObjectPrx proxy;
1356 istr->read(proxy);
1357 if (!proxy)
1358 {
1359 v = 0;
1360 }
1361 else
1362 {
1363 v = new ::IceProxy::IceStormElection::TopicManagerSync;
1364 v->_copyFrom(proxy);
1365 }
1366}
1367
1368::Ice::AsyncResultPtr
1369IceProxy::IceStormElection::TopicManagerSync::_iceI_begin_getContent(
1370 const ::Ice::Context& context,
1371 const ::IceInternal::CallbackBasePtr& del,
1372 const ::Ice::LocalObjectPtr& cookie,
1373 bool sync)
1374{
1375 _checkTwowayOnly(iceC_IceStormElection_TopicManagerSync_getContent_name, sync);
1376 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1377 this, iceC_IceStormElection_TopicManagerSync_getContent_name, del, cookie, sync);
1378 try
1379 {
1380 result->prepare(
1381 iceC_IceStormElection_TopicManagerSync_getContent_name, ::Ice::Normal, context);
1382 result->writeEmptyParams();
1383 result->invoke(iceC_IceStormElection_TopicManagerSync_getContent_name);
1384 }
1385 catch (const ::Ice::Exception& ex)
1386 {
1387 result->abort(ex);
1388 }
1389 return result;
1390}
1391
1392void
1396 const ::Ice::AsyncResultPtr& result)
1397{
1398 ::Ice::AsyncResult::_check(
1399 result, this, iceC_IceStormElection_TopicManagerSync_getContent_name);
1400 if (!result->_waitForResponse())
1401 {
1402 try
1403 {
1404 result->_throwUserException();
1405 }
1406 catch (const ::Ice::UserException& ex)
1407 {
1408 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1409 }
1410 }
1411 ::Ice::InputStream* istr = result->_startReadParams();
1412 istr->read(iceP_llu);
1413 istr->read(iceP_content);
1414 result->_endReadParams();
1415}
1416
1417::IceProxy::Ice::Object*
1422
1423const ::std::string&
1425{
1426 return ::IceStormElection::TopicManagerSync::ice_staticId();
1427}
1428
1430{
1431 return p;
1432}
1433
1434void ::IceProxy::IceStormElection::_readProxy(
1435 ::Ice::InputStream* istr,
1437{
1438 ::Ice::ObjectPrx proxy;
1439 istr->read(proxy);
1440 if (!proxy)
1441 {
1442 v = 0;
1443 }
1444 else
1445 {
1446 v = new ::IceProxy::IceStormElection::Node;
1447 v->_copyFrom(proxy);
1448 }
1449}
1450
1451::Ice::AsyncResultPtr
1452IceProxy::IceStormElection::Node::_iceI_begin_invitation(::Ice::Int iceP_j,
1453 const ::std::string& iceP_gn,
1454 const ::Ice::Context& context,
1455 const ::IceInternal::CallbackBasePtr& del,
1456 const ::Ice::LocalObjectPtr& cookie,
1457 bool sync)
1458{
1459 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1460 this, iceC_IceStormElection_Node_invitation_name, del, cookie, sync);
1461 try
1462 {
1463 result->prepare(iceC_IceStormElection_Node_invitation_name, ::Ice::Normal, context);
1464 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1465 ostr->write(iceP_j);
1466 ostr->write(iceP_gn);
1467 result->endWriteParams();
1468 result->invoke(iceC_IceStormElection_Node_invitation_name);
1469 }
1470 catch (const ::Ice::Exception& ex)
1471 {
1472 result->abort(ex);
1473 }
1474 return result;
1475}
1476
1477void
1478IceProxy::IceStormElection::Node::end_invitation(const ::Ice::AsyncResultPtr& result)
1479{
1480 _end(result, iceC_IceStormElection_Node_invitation_name);
1481}
1482
1483::Ice::AsyncResultPtr
1484IceProxy::IceStormElection::Node::_iceI_begin_ready(::Ice::Int iceP_j,
1485 const ::std::string& iceP_gn,
1486 const ::Ice::ObjectPrx& iceP_coordinator,
1487 ::Ice::Int iceP_max,
1488 ::Ice::Long iceP_generation,
1489 const ::Ice::Context& context,
1490 const ::IceInternal::CallbackBasePtr& del,
1491 const ::Ice::LocalObjectPtr& cookie,
1492 bool sync)
1493{
1494 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1495 this, iceC_IceStormElection_Node_ready_name, del, cookie, sync);
1496 try
1497 {
1498 result->prepare(iceC_IceStormElection_Node_ready_name, ::Ice::Normal, context);
1499 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1500 ostr->write(iceP_j);
1501 ostr->write(iceP_gn);
1502 ostr->write(iceP_coordinator);
1503 ostr->write(iceP_max);
1504 ostr->write(iceP_generation);
1505 result->endWriteParams();
1506 result->invoke(iceC_IceStormElection_Node_ready_name);
1507 }
1508 catch (const ::Ice::Exception& ex)
1509 {
1510 result->abort(ex);
1511 }
1512 return result;
1513}
1514
1515void
1516IceProxy::IceStormElection::Node::end_ready(const ::Ice::AsyncResultPtr& result)
1517{
1518 _end(result, iceC_IceStormElection_Node_ready_name);
1519}
1520
1521::Ice::AsyncResultPtr
1522IceProxy::IceStormElection::Node::_iceI_begin_accept(::Ice::Int iceP_j,
1523 const ::std::string& iceP_gn,
1524 const ::Ice::IntSeq& iceP_forwardedInvites,
1525 const ::Ice::ObjectPrx& iceP_observer,
1526 const ::IceStormElection::LogUpdate& iceP_llu,
1527 ::Ice::Int iceP_max,
1528 const ::Ice::Context& context,
1529 const ::IceInternal::CallbackBasePtr& del,
1530 const ::Ice::LocalObjectPtr& cookie,
1531 bool sync)
1532{
1533 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1534 this, iceC_IceStormElection_Node_accept_name, del, cookie, sync);
1535 try
1536 {
1537 result->prepare(iceC_IceStormElection_Node_accept_name, ::Ice::Normal, context);
1538 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1539 ostr->write(iceP_j);
1540 ostr->write(iceP_gn);
1541 ostr->write(iceP_forwardedInvites);
1542 ostr->write(iceP_observer);
1543 ostr->write(iceP_llu);
1544 ostr->write(iceP_max);
1545 result->endWriteParams();
1546 result->invoke(iceC_IceStormElection_Node_accept_name);
1547 }
1548 catch (const ::Ice::Exception& ex)
1549 {
1550 result->abort(ex);
1551 }
1552 return result;
1553}
1554
1555void
1556IceProxy::IceStormElection::Node::end_accept(const ::Ice::AsyncResultPtr& result)
1557{
1558 _end(result, iceC_IceStormElection_Node_accept_name);
1559}
1560
1561::Ice::AsyncResultPtr
1562IceProxy::IceStormElection::Node::_iceI_begin_areYouCoordinator(
1563 const ::Ice::Context& context,
1564 const ::IceInternal::CallbackBasePtr& del,
1565 const ::Ice::LocalObjectPtr& cookie,
1566 bool sync)
1567{
1568 _checkTwowayOnly(iceC_IceStormElection_Node_areYouCoordinator_name, sync);
1569 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1570 this, iceC_IceStormElection_Node_areYouCoordinator_name, del, cookie, sync);
1571 try
1572 {
1573 result->prepare(
1574 iceC_IceStormElection_Node_areYouCoordinator_name, ::Ice::Idempotent, context);
1575 result->writeEmptyParams();
1576 result->invoke(iceC_IceStormElection_Node_areYouCoordinator_name);
1577 }
1578 catch (const ::Ice::Exception& ex)
1579 {
1580 result->abort(ex);
1581 }
1582 return result;
1583}
1584
1585bool
1587{
1588 ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_areYouCoordinator_name);
1589 bool ret;
1590 if (!result->_waitForResponse())
1591 {
1592 try
1593 {
1594 result->_throwUserException();
1595 }
1596 catch (const ::Ice::UserException& ex)
1597 {
1598 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1599 }
1600 }
1601 ::Ice::InputStream* istr = result->_startReadParams();
1602 istr->read(ret);
1603 result->_endReadParams();
1604 return ret;
1605}
1606
1607::Ice::AsyncResultPtr
1608IceProxy::IceStormElection::Node::_iceI_begin_areYouThere(const ::std::string& iceP_gn,
1609 ::Ice::Int iceP_j,
1610 const ::Ice::Context& context,
1611 const ::IceInternal::CallbackBasePtr& del,
1612 const ::Ice::LocalObjectPtr& cookie,
1613 bool sync)
1614{
1615 _checkTwowayOnly(iceC_IceStormElection_Node_areYouThere_name, sync);
1616 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1617 this, iceC_IceStormElection_Node_areYouThere_name, del, cookie, sync);
1618 try
1619 {
1620 result->prepare(iceC_IceStormElection_Node_areYouThere_name, ::Ice::Idempotent, context);
1621 ::Ice::OutputStream* ostr = result->startWriteParams(::Ice::DefaultFormat);
1622 ostr->write(iceP_gn);
1623 ostr->write(iceP_j);
1624 result->endWriteParams();
1625 result->invoke(iceC_IceStormElection_Node_areYouThere_name);
1626 }
1627 catch (const ::Ice::Exception& ex)
1628 {
1629 result->abort(ex);
1630 }
1631 return result;
1632}
1633
1634bool
1635IceProxy::IceStormElection::Node::end_areYouThere(const ::Ice::AsyncResultPtr& result)
1636{
1637 ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_areYouThere_name);
1638 bool ret;
1639 if (!result->_waitForResponse())
1640 {
1641 try
1642 {
1643 result->_throwUserException();
1644 }
1645 catch (const ::Ice::UserException& ex)
1646 {
1647 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1648 }
1649 }
1650 ::Ice::InputStream* istr = result->_startReadParams();
1651 istr->read(ret);
1652 result->_endReadParams();
1653 return ret;
1654}
1655
1656::Ice::AsyncResultPtr
1657IceProxy::IceStormElection::Node::_iceI_begin_sync(const ::Ice::Context& context,
1658 const ::IceInternal::CallbackBasePtr& del,
1659 const ::Ice::LocalObjectPtr& cookie,
1660 bool sync)
1661{
1662 _checkTwowayOnly(iceC_IceStormElection_Node_sync_name, sync);
1663 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1664 this, iceC_IceStormElection_Node_sync_name, del, cookie, sync);
1665 try
1666 {
1667 result->prepare(iceC_IceStormElection_Node_sync_name, ::Ice::Idempotent, context);
1668 result->writeEmptyParams();
1669 result->invoke(iceC_IceStormElection_Node_sync_name);
1670 }
1671 catch (const ::Ice::Exception& ex)
1672 {
1673 result->abort(ex);
1674 }
1675 return result;
1676}
1677
1678::Ice::ObjectPrx
1679IceProxy::IceStormElection::Node::end_sync(const ::Ice::AsyncResultPtr& result)
1680{
1681 ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_sync_name);
1682 ::Ice::ObjectPrx ret;
1683 if (!result->_waitForResponse())
1684 {
1685 try
1686 {
1687 result->_throwUserException();
1688 }
1689 catch (const ::Ice::UserException& ex)
1690 {
1691 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1692 }
1693 }
1694 ::Ice::InputStream* istr = result->_startReadParams();
1695 istr->read(ret);
1696 result->_endReadParams();
1697 return ret;
1698}
1699
1700::Ice::AsyncResultPtr
1701IceProxy::IceStormElection::Node::_iceI_begin_nodes(const ::Ice::Context& context,
1702 const ::IceInternal::CallbackBasePtr& del,
1703 const ::Ice::LocalObjectPtr& cookie,
1704 bool sync)
1705{
1706 _checkTwowayOnly(iceC_IceStormElection_Node_nodes_name, sync);
1707 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1708 this, iceC_IceStormElection_Node_nodes_name, del, cookie, sync);
1709 try
1710 {
1711 result->prepare(iceC_IceStormElection_Node_nodes_name, ::Ice::Idempotent, context);
1712 result->writeEmptyParams();
1713 result->invoke(iceC_IceStormElection_Node_nodes_name);
1714 }
1715 catch (const ::Ice::Exception& ex)
1716 {
1717 result->abort(ex);
1718 }
1719 return result;
1720}
1721
1723IceProxy::IceStormElection::Node::end_nodes(const ::Ice::AsyncResultPtr& result)
1724{
1725 ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_nodes_name);
1727 if (!result->_waitForResponse())
1728 {
1729 try
1730 {
1731 result->_throwUserException();
1732 }
1733 catch (const ::Ice::UserException& ex)
1734 {
1735 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1736 }
1737 }
1738 ::Ice::InputStream* istr = result->_startReadParams();
1739 istr->read(ret);
1740 result->_endReadParams();
1741 return ret;
1742}
1743
1744::Ice::AsyncResultPtr
1745IceProxy::IceStormElection::Node::_iceI_begin_query(const ::Ice::Context& context,
1746 const ::IceInternal::CallbackBasePtr& del,
1747 const ::Ice::LocalObjectPtr& cookie,
1748 bool sync)
1749{
1750 _checkTwowayOnly(iceC_IceStormElection_Node_query_name, sync);
1751 ::IceInternal::OutgoingAsyncPtr result = new ::IceInternal::CallbackOutgoing(
1752 this, iceC_IceStormElection_Node_query_name, del, cookie, sync);
1753 try
1754 {
1755 result->prepare(iceC_IceStormElection_Node_query_name, ::Ice::Idempotent, context);
1756 result->writeEmptyParams();
1757 result->invoke(iceC_IceStormElection_Node_query_name);
1758 }
1759 catch (const ::Ice::Exception& ex)
1760 {
1761 result->abort(ex);
1762 }
1763 return result;
1764}
1765
1766::IceStormElection::QueryInfo
1767IceProxy::IceStormElection::Node::end_query(const ::Ice::AsyncResultPtr& result)
1768{
1769 ::Ice::AsyncResult::_check(result, this, iceC_IceStormElection_Node_query_name);
1771 if (!result->_waitForResponse())
1772 {
1773 try
1774 {
1775 result->_throwUserException();
1776 }
1777 catch (const ::Ice::UserException& ex)
1778 {
1779 throw ::Ice::UnknownUserException(__FILE__, __LINE__, ex.ice_id());
1780 }
1781 }
1782 ::Ice::InputStream* istr = result->_startReadParams();
1783 istr->read(ret);
1784 result->_endReadParams();
1785 return ret;
1786}
1787
1788::IceProxy::Ice::Object*
1790{
1791 return new Node;
1792}
1793
1794const ::std::string&
1796{
1797 return ::IceStormElection::Node::ice_staticId();
1798}
1799
1803
1804::Ice::Object*
1809
1810namespace
1811{
1812 const ::std::string iceC_IceStormElection_ReplicaObserver_ids[2] = {
1813 "::Ice::Object",
1814 "::IceStormElection::ReplicaObserver"};
1815
1816}
1817
1818bool
1819IceStormElection::ReplicaObserver::ice_isA(const ::std::string& s, const ::Ice::Current&) const
1820{
1821 return ::std::binary_search(iceC_IceStormElection_ReplicaObserver_ids,
1822 iceC_IceStormElection_ReplicaObserver_ids + 2,
1823 s);
1824}
1825
1826::std::vector<::std::string>
1828{
1829 return ::std::vector<::std::string>(&iceC_IceStormElection_ReplicaObserver_ids[0],
1830 &iceC_IceStormElection_ReplicaObserver_ids[2]);
1831}
1832
1833const ::std::string&
1835{
1836 return ice_staticId();
1837}
1838
1839const ::std::string&
1841{
1842#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
1843 static const ::std::string typeId = "::IceStormElection::ReplicaObserver";
1844 return typeId;
1845#else
1846 return iceC_IceStormElection_ReplicaObserver_ids[1];
1847#endif
1848}
1849
1850bool
1852 const ::Ice::Current& current)
1853{
1854 _iceCheckMode(::Ice::Normal, current.mode);
1855 ::Ice::InputStream* istr = inS.startReadParams();
1858 istr->read(iceP_llu);
1859 istr->read(iceP_content);
1860 inS.endReadParams();
1861 this->init(iceP_llu, iceP_content, current);
1862 inS.writeEmptyParams();
1863 return true;
1864}
1865
1866bool
1868 const ::Ice::Current& current)
1869{
1870 _iceCheckMode(::Ice::Normal, current.mode);
1871 ::Ice::InputStream* istr = inS.startReadParams();
1873 ::std::string iceP_name;
1874 istr->read(iceP_llu);
1875 istr->read(iceP_name);
1876 inS.endReadParams();
1877 this->createTopic(iceP_llu, iceP_name, current);
1878 inS.writeEmptyParams();
1879 return true;
1880}
1881
1882bool
1884 const ::Ice::Current& current)
1885{
1886 _iceCheckMode(::Ice::Normal, current.mode);
1887 ::Ice::InputStream* istr = inS.startReadParams();
1889 ::std::string iceP_name;
1890 istr->read(iceP_llu);
1891 istr->read(iceP_name);
1892 inS.endReadParams();
1893 this->destroyTopic(iceP_llu, iceP_name, current);
1894 inS.writeEmptyParams();
1895 return true;
1896}
1897
1898bool
1900 const ::Ice::Current& current)
1901{
1902 _iceCheckMode(::Ice::Normal, current.mode);
1903 ::Ice::InputStream* istr = inS.startReadParams();
1905 ::std::string iceP_topic;
1906 ::IceStorm::SubscriberRecord iceP_record;
1907 istr->read(iceP_llu);
1908 istr->read(iceP_topic);
1909 istr->read(iceP_record);
1910 inS.endReadParams();
1911 this->addSubscriber(iceP_llu, iceP_topic, iceP_record, current);
1912 inS.writeEmptyParams();
1913 return true;
1914}
1915
1916bool
1918 const ::Ice::Current& current)
1919{
1920 _iceCheckMode(::Ice::Normal, current.mode);
1921 ::Ice::InputStream* istr = inS.startReadParams();
1923 ::std::string iceP_topic;
1924 ::Ice::IdentitySeq iceP_subscribers;
1925 istr->read(iceP_llu);
1926 istr->read(iceP_topic);
1927 istr->read(iceP_subscribers);
1928 inS.endReadParams();
1929 this->removeSubscriber(iceP_llu, iceP_topic, iceP_subscribers, current);
1930 inS.writeEmptyParams();
1931 return true;
1932}
1933
1934namespace
1935{
1936 const ::std::string iceC_IceStormElection_ReplicaObserver_all[] = {"addSubscriber",
1937 "createTopic",
1938 "destroyTopic",
1939 "ice_id",
1940 "ice_ids",
1941 "ice_isA",
1942 "ice_ping",
1943 "init",
1944 "removeSubscriber"};
1945
1946}
1947
1948bool
1950 const ::Ice::Current& current)
1951{
1952 ::std::pair<const ::std::string*, const ::std::string*> r =
1953 ::std::equal_range(iceC_IceStormElection_ReplicaObserver_all,
1954 iceC_IceStormElection_ReplicaObserver_all + 9,
1955 current.operation);
1956 if (r.first == r.second)
1957 {
1958 throw ::Ice::OperationNotExistException(
1959 __FILE__, __LINE__, current.id, current.facet, current.operation);
1960 }
1961
1962 switch (r.first - iceC_IceStormElection_ReplicaObserver_all)
1963 {
1964 case 0:
1965 {
1966 return _iceD_addSubscriber(in, current);
1967 }
1968 case 1:
1969 {
1970 return _iceD_createTopic(in, current);
1971 }
1972 case 2:
1973 {
1974 return _iceD_destroyTopic(in, current);
1975 }
1976 case 3:
1977 {
1978 return _iceD_ice_id(in, current);
1979 }
1980 case 4:
1981 {
1982 return _iceD_ice_ids(in, current);
1983 }
1984 case 5:
1985 {
1986 return _iceD_ice_isA(in, current);
1987 }
1988 case 6:
1989 {
1990 return _iceD_ice_ping(in, current);
1991 }
1992 case 7:
1993 {
1994 return _iceD_init(in, current);
1995 }
1996 case 8:
1997 {
1998 return _iceD_removeSubscriber(in, current);
1999 }
2000 default:
2001 {
2002 assert(false);
2003 throw ::Ice::OperationNotExistException(
2004 __FILE__, __LINE__, current.id, current.facet, current.operation);
2005 }
2006 }
2007}
2008
2009void
2011{
2012 ostr->startSlice(ice_staticId(), -1, true);
2013 Ice::StreamWriter<::IceStormElection::ReplicaObserver, ::Ice::OutputStream>::write(ostr, *this);
2014 ostr->endSlice();
2015}
2016
2017void
2019{
2020 istr->startSlice();
2021 Ice::StreamReader<::IceStormElection::ReplicaObserver, ::Ice::InputStream>::read(istr, *this);
2022 istr->endSlice();
2023}
2024
2025void
2027{
2028 handle = ::IceStormElection::ReplicaObserverPtr::dynamicCast(v);
2029 if (v && !handle)
2030 {
2031 IceInternal::Ex::throwUOE(::IceStormElection::ReplicaObserver::ice_staticId(), v);
2032 }
2033}
2034
2038
2039::Ice::Object*
2044
2045namespace
2046{
2047 const ::std::string iceC_IceStormElection_TopicManagerSync_ids[2] = {
2048 "::Ice::Object",
2049 "::IceStormElection::TopicManagerSync"};
2050
2051}
2052
2053bool
2054IceStormElection::TopicManagerSync::ice_isA(const ::std::string& s, const ::Ice::Current&) const
2055{
2056 return ::std::binary_search(iceC_IceStormElection_TopicManagerSync_ids,
2057 iceC_IceStormElection_TopicManagerSync_ids + 2,
2058 s);
2059}
2060
2061::std::vector<::std::string>
2063{
2064 return ::std::vector<::std::string>(&iceC_IceStormElection_TopicManagerSync_ids[0],
2065 &iceC_IceStormElection_TopicManagerSync_ids[2]);
2066}
2067
2068const ::std::string&
2070{
2071 return ice_staticId();
2072}
2073
2074const ::std::string&
2076{
2077#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
2078 static const ::std::string typeId = "::IceStormElection::TopicManagerSync";
2079 return typeId;
2080#else
2081 return iceC_IceStormElection_TopicManagerSync_ids[1];
2082#endif
2083}
2084
2085bool
2087 const ::Ice::Current& current)
2088{
2089 _iceCheckMode(::Ice::Normal, current.mode);
2090 inS.readEmptyParams();
2093 this->getContent(iceP_llu, iceP_content, current);
2094 ::Ice::OutputStream* ostr = inS.startWriteParams();
2095 ostr->write(iceP_llu);
2096 ostr->write(iceP_content);
2097 inS.endWriteParams();
2098 return true;
2099}
2100
2101namespace
2102{
2103 const ::std::string iceC_IceStormElection_TopicManagerSync_all[] = {"getContent",
2104 "ice_id",
2105 "ice_ids",
2106 "ice_isA",
2107 "ice_ping"};
2108
2109}
2110
2111bool
2113 const ::Ice::Current& current)
2114{
2115 ::std::pair<const ::std::string*, const ::std::string*> r =
2116 ::std::equal_range(iceC_IceStormElection_TopicManagerSync_all,
2117 iceC_IceStormElection_TopicManagerSync_all + 5,
2118 current.operation);
2119 if (r.first == r.second)
2120 {
2121 throw ::Ice::OperationNotExistException(
2122 __FILE__, __LINE__, current.id, current.facet, current.operation);
2123 }
2124
2125 switch (r.first - iceC_IceStormElection_TopicManagerSync_all)
2126 {
2127 case 0:
2128 {
2129 return _iceD_getContent(in, current);
2130 }
2131 case 1:
2132 {
2133 return _iceD_ice_id(in, current);
2134 }
2135 case 2:
2136 {
2137 return _iceD_ice_ids(in, current);
2138 }
2139 case 3:
2140 {
2141 return _iceD_ice_isA(in, current);
2142 }
2143 case 4:
2144 {
2145 return _iceD_ice_ping(in, current);
2146 }
2147 default:
2148 {
2149 assert(false);
2150 throw ::Ice::OperationNotExistException(
2151 __FILE__, __LINE__, current.id, current.facet, current.operation);
2152 }
2153 }
2154}
2155
2156void
2158{
2159 ostr->startSlice(ice_staticId(), -1, true);
2160 Ice::StreamWriter<::IceStormElection::TopicManagerSync, ::Ice::OutputStream>::write(ostr,
2161 *this);
2162 ostr->endSlice();
2163}
2164
2165void
2167{
2168 istr->startSlice();
2169 Ice::StreamReader<::IceStormElection::TopicManagerSync, ::Ice::InputStream>::read(istr, *this);
2170 istr->endSlice();
2171}
2172
2173void
2175{
2176 handle = ::IceStormElection::TopicManagerSyncPtr::dynamicCast(v);
2177 if (v && !handle)
2178 {
2179 IceInternal::Ex::throwUOE(::IceStormElection::TopicManagerSync::ice_staticId(), v);
2180 }
2181}
2182
2186
2187::Ice::Object*
2192
2193namespace
2194{
2195 const ::std::string iceC_IceStormElection_Node_ids[2] = {"::Ice::Object",
2196 "::IceStormElection::Node"};
2197
2198}
2199
2200bool
2201IceStormElection::Node::ice_isA(const ::std::string& s, const ::Ice::Current&) const
2202{
2203 return ::std::binary_search(
2204 iceC_IceStormElection_Node_ids, iceC_IceStormElection_Node_ids + 2, s);
2205}
2206
2207::std::vector<::std::string>
2208IceStormElection::Node::ice_ids(const ::Ice::Current&) const
2209{
2210 return ::std::vector<::std::string>(&iceC_IceStormElection_Node_ids[0],
2211 &iceC_IceStormElection_Node_ids[2]);
2212}
2213
2214const ::std::string&
2215IceStormElection::Node::ice_id(const ::Ice::Current&) const
2216{
2217 return ice_staticId();
2218}
2219
2220const ::std::string&
2222{
2223#ifdef ICE_HAS_THREAD_SAFE_LOCAL_STATIC
2224 static const ::std::string typeId = "::IceStormElection::Node";
2225 return typeId;
2226#else
2227 return iceC_IceStormElection_Node_ids[1];
2228#endif
2229}
2230
2231bool
2232IceStormElection::Node::_iceD_invitation(::IceInternal::Incoming& inS,
2233 const ::Ice::Current& current)
2234{
2235 _iceCheckMode(::Ice::Normal, current.mode);
2236 ::Ice::InputStream* istr = inS.startReadParams();
2237 ::Ice::Int iceP_j;
2238 ::std::string iceP_gn;
2239 istr->read(iceP_j);
2240 istr->read(iceP_gn);
2241 inS.endReadParams();
2242 this->invitation(iceP_j, iceP_gn, current);
2243 inS.writeEmptyParams();
2244 return true;
2245}
2246
2247bool
2248IceStormElection::Node::_iceD_ready(::IceInternal::Incoming& inS, const ::Ice::Current& current)
2249{
2250 _iceCheckMode(::Ice::Normal, current.mode);
2251 ::Ice::InputStream* istr = inS.startReadParams();
2252 ::Ice::Int iceP_j;
2253 ::std::string iceP_gn;
2254 ::Ice::ObjectPrx iceP_coordinator;
2255 ::Ice::Int iceP_max;
2256 ::Ice::Long iceP_generation;
2257 istr->read(iceP_j);
2258 istr->read(iceP_gn);
2259 istr->read(iceP_coordinator);
2260 istr->read(iceP_max);
2261 istr->read(iceP_generation);
2262 inS.endReadParams();
2263 this->ready(iceP_j, iceP_gn, iceP_coordinator, iceP_max, iceP_generation, current);
2264 inS.writeEmptyParams();
2265 return true;
2266}
2267
2268bool
2269IceStormElection::Node::_iceD_accept(::IceInternal::Incoming& inS, const ::Ice::Current& current)
2270{
2271 _iceCheckMode(::Ice::Normal, current.mode);
2272 ::Ice::InputStream* istr = inS.startReadParams();
2273 ::Ice::Int iceP_j;
2274 ::std::string iceP_gn;
2275 ::Ice::IntSeq iceP_forwardedInvites;
2276 ::Ice::ObjectPrx iceP_observer;
2278 ::Ice::Int iceP_max;
2279 istr->read(iceP_j);
2280 istr->read(iceP_gn);
2281 istr->read(iceP_forwardedInvites);
2282 istr->read(iceP_observer);
2283 istr->read(iceP_llu);
2284 istr->read(iceP_max);
2285 inS.endReadParams();
2286 this->accept(
2287 iceP_j, iceP_gn, iceP_forwardedInvites, iceP_observer, iceP_llu, iceP_max, current);
2288 inS.writeEmptyParams();
2289 return true;
2290}
2291
2292bool
2294 const ::Ice::Current& current) const
2295{
2296 _iceCheckMode(::Ice::Idempotent, current.mode);
2297 inS.readEmptyParams();
2298 bool ret = this->areYouCoordinator(current);
2299 ::Ice::OutputStream* ostr = inS.startWriteParams();
2300 ostr->write(ret);
2301 inS.endWriteParams();
2302 return true;
2303}
2304
2305bool
2307 const ::Ice::Current& current) const
2308{
2309 _iceCheckMode(::Ice::Idempotent, current.mode);
2310 ::Ice::InputStream* istr = inS.startReadParams();
2311 ::std::string iceP_gn;
2312 ::Ice::Int iceP_j;
2313 istr->read(iceP_gn);
2314 istr->read(iceP_j);
2315 inS.endReadParams();
2316 bool ret = this->areYouThere(iceP_gn, iceP_j, current);
2317 ::Ice::OutputStream* ostr = inS.startWriteParams();
2318 ostr->write(ret);
2319 inS.endWriteParams();
2320 return true;
2321}
2322
2323bool
2324IceStormElection::Node::_iceD_sync(::IceInternal::Incoming& inS,
2325 const ::Ice::Current& current) const
2326{
2327 _iceCheckMode(::Ice::Idempotent, current.mode);
2328 inS.readEmptyParams();
2329 ::Ice::ObjectPrx ret = this->sync(current);
2330 ::Ice::OutputStream* ostr = inS.startWriteParams();
2331 ostr->write(ret);
2332 inS.endWriteParams();
2333 return true;
2334}
2335
2336bool
2337IceStormElection::Node::_iceD_nodes(::IceInternal::Incoming& inS,
2338 const ::Ice::Current& current) const
2339{
2340 _iceCheckMode(::Ice::Idempotent, current.mode);
2341 inS.readEmptyParams();
2342 ::IceStormElection::NodeInfoSeq ret = this->nodes(current);
2343 ::Ice::OutputStream* ostr = inS.startWriteParams();
2344 ostr->write(ret);
2345 inS.endWriteParams();
2346 return true;
2347}
2348
2349bool
2350IceStormElection::Node::_iceD_query(::IceInternal::Incoming& inS,
2351 const ::Ice::Current& current) const
2352{
2353 _iceCheckMode(::Ice::Idempotent, current.mode);
2354 inS.readEmptyParams();
2355 ::IceStormElection::QueryInfo ret = this->query(current);
2356 ::Ice::OutputStream* ostr = inS.startWriteParams();
2357 ostr->write(ret);
2358 inS.endWriteParams();
2359 return true;
2360}
2361
2362namespace
2363{
2364 const ::std::string iceC_IceStormElection_Node_all[] = {"accept",
2365 "areYouCoordinator",
2366 "areYouThere",
2367 "ice_id",
2368 "ice_ids",
2369 "ice_isA",
2370 "ice_ping",
2371 "invitation",
2372 "nodes",
2373 "query",
2374 "ready",
2375 "sync"};
2376
2377}
2378
2379bool
2380IceStormElection::Node::_iceDispatch(::IceInternal::Incoming& in, const ::Ice::Current& current)
2381{
2382 ::std::pair<const ::std::string*, const ::std::string*> r = ::std::equal_range(
2383 iceC_IceStormElection_Node_all, iceC_IceStormElection_Node_all + 12, current.operation);
2384 if (r.first == r.second)
2385 {
2386 throw ::Ice::OperationNotExistException(
2387 __FILE__, __LINE__, current.id, current.facet, current.operation);
2388 }
2389
2390 switch (r.first - iceC_IceStormElection_Node_all)
2391 {
2392 case 0:
2393 {
2394 return _iceD_accept(in, current);
2395 }
2396 case 1:
2397 {
2398 return _iceD_areYouCoordinator(in, current);
2399 }
2400 case 2:
2401 {
2402 return _iceD_areYouThere(in, current);
2403 }
2404 case 3:
2405 {
2406 return _iceD_ice_id(in, current);
2407 }
2408 case 4:
2409 {
2410 return _iceD_ice_ids(in, current);
2411 }
2412 case 5:
2413 {
2414 return _iceD_ice_isA(in, current);
2415 }
2416 case 6:
2417 {
2418 return _iceD_ice_ping(in, current);
2419 }
2420 case 7:
2421 {
2422 return _iceD_invitation(in, current);
2423 }
2424 case 8:
2425 {
2426 return _iceD_nodes(in, current);
2427 }
2428 case 9:
2429 {
2430 return _iceD_query(in, current);
2431 }
2432 case 10:
2433 {
2434 return _iceD_ready(in, current);
2435 }
2436 case 11:
2437 {
2438 return _iceD_sync(in, current);
2439 }
2440 default:
2441 {
2442 assert(false);
2443 throw ::Ice::OperationNotExistException(
2444 __FILE__, __LINE__, current.id, current.facet, current.operation);
2445 }
2446 }
2447}
2448
2449void
2450IceStormElection::Node::_iceWriteImpl(::Ice::OutputStream* ostr) const
2451{
2452 ostr->startSlice(ice_staticId(), -1, true);
2453 Ice::StreamWriter<::IceStormElection::Node, ::Ice::OutputStream>::write(ostr, *this);
2454 ostr->endSlice();
2455}
2456
2457void
2459{
2460 istr->startSlice();
2461 Ice::StreamReader<::IceStormElection::Node, ::Ice::InputStream>::read(istr, *this);
2462 istr->endSlice();
2463}
2464
2465void
2466IceStormElection::_icePatchObjectPtr(NodePtr& handle, const ::Ice::ObjectPtr& v)
2467{
2468 handle = ::IceStormElection::NodePtr::dynamicCast(v);
2469 if (v && !handle)
2470 {
2471 IceInternal::Ex::throwUOE(::IceStormElection::Node::ice_staticId(), v);
2472 }
2473}
2474
2475namespace Ice
2476{
2477}
2478
2479#endif
::IceStormElection::NodeInfoSeq end_nodes(const ::Ice::AsyncResultPtr &)
void end_ready(const ::Ice::AsyncResultPtr &)
void end_invitation(const ::Ice::AsyncResultPtr &)
void end_accept(const ::Ice::AsyncResultPtr &)
virtual::IceProxy::Ice::Object * _newInstance() const
::IceStormElection::QueryInfo end_query(const ::Ice::AsyncResultPtr &)
::Ice::ObjectPrx end_sync(const ::Ice::AsyncResultPtr &)
bool end_areYouThere(const ::Ice::AsyncResultPtr &)
static const ::std::string & ice_staticId()
bool end_areYouCoordinator(const ::Ice::AsyncResultPtr &)
void end_addSubscriber(const ::Ice::AsyncResultPtr &)
void end_removeSubscriber(const ::Ice::AsyncResultPtr &)
void end_destroyTopic(const ::Ice::AsyncResultPtr &)
void end_createTopic(const ::Ice::AsyncResultPtr &)
virtual::IceProxy::Ice::Object * _newInstance() const
void end_init(const ::Ice::AsyncResultPtr &)
static const ::std::string & ice_staticId()
void end_getContent(::IceStormElection::LogUpdate &iceP_llu, ::IceStormElection::TopicContentSeq &iceP_content, const ::Ice::AsyncResultPtr &)
virtual::IceProxy::Ice::Object * _newInstance() const
static const ::std::string & ice_staticId()
Thrown if an observer detects an inconsistency.
Definition Election.ice:37
string reason
The reason for the inconsistency.
Definition Election.ice:39
virtual void _writeImpl(::Ice::OutputStream *) const
virtual ObserverInconsistencyException * ice_clone() const
virtual void _readImpl(::Ice::InputStream *)
A replica node.
Definition Election.ice:204
virtual const ::std::string & ice_id(const ::Ice::Current &=::Ice::emptyCurrent) const
virtual bool _iceDispatch(::IceInternal::Incoming &, const ::Ice::Current &)
bool _iceD_query(::IceInternal::Incoming &, const ::Ice::Current &) const
bool _iceD_sync(::IceInternal::Incoming &, const ::Ice::Current &) const
bool _iceD_areYouThere(::IceInternal::Incoming &, const ::Ice::Current &) const
bool _iceD_areYouCoordinator(::IceInternal::Incoming &, const ::Ice::Current &) const
virtual void _iceWriteImpl(::Ice::OutputStream *) const
bool _iceD_accept(::IceInternal::Incoming &, const ::Ice::Current &)
bool _iceD_invitation(::IceInternal::Incoming &, const ::Ice::Current &)
bool _iceD_ready(::IceInternal::Incoming &, const ::Ice::Current &)
idempotent QueryInfo query()
Get the query information for the given node.
virtual ::std::vector<::std::string > ice_ids(const ::Ice::Current &=::Ice::emptyCurrent) const
virtual void _iceReadImpl(::Ice::InputStream *)
idempotent NodeInfoSeq nodes()
Get the replication group information.
bool _iceD_nodes(::IceInternal::Incoming &, const ::Ice::Current &) const
void invitation(int j, string gn)
Invite the node into a group with the given coordinator and group name.
void ready(int j, string gn, Object *coordinator, int max, long generation)
Call from the group coordinator to a node to inform the node that the replica group is active.
void accept(int j, string gn, Ice::IntSeq forwardedInvites, Object *observer, LogUpdate llu, int max)
Called to accept an invitation into the given group.
virtual bool ice_isA(const ::std::string &, const ::Ice::Current &=::Ice::emptyCurrent) const
idempotent bool areYouThere(string gn, int j)
Determine if the node is a member of the given group with the given coordinator.
static const ::std::string & ice_staticId()
idempotent bool areYouCoordinator()
Determine if this node is a coordinator.
The replica observer.
Definition Election.ice:44
bool _iceD_removeSubscriber(::IceInternal::Incoming &, const ::Ice::Current &)
virtual const ::std::string & ice_id(const ::Ice::Current &=::Ice::emptyCurrent) const
virtual bool _iceDispatch(::IceInternal::Incoming &, const ::Ice::Current &)
bool _iceD_init(::IceInternal::Incoming &, const ::Ice::Current &)
void destroyTopic(LogUpdate llu, string name)
Destroy the topic with the given name.
virtual void _iceWriteImpl(::Ice::OutputStream *) const
void removeSubscriber(LogUpdate llu, string topic, Ice::IdentitySeq subscribers)
Remove a subscriber from a topic.
bool _iceD_addSubscriber(::IceInternal::Incoming &, const ::Ice::Current &)
void init(LogUpdate llu, TopicContentSeq content)
Initialize the observer.
bool _iceD_destroyTopic(::IceInternal::Incoming &, const ::Ice::Current &)
virtual ::std::vector<::std::string > ice_ids(const ::Ice::Current &=::Ice::emptyCurrent) const
virtual void _iceReadImpl(::Ice::InputStream *)
void addSubscriber(LogUpdate llu, string topic, IceStorm::SubscriberRecord record)
Add a subscriber to a topic.
virtual bool ice_isA(const ::std::string &, const ::Ice::Current &=::Ice::emptyCurrent) const
bool _iceD_createTopic(::IceInternal::Incoming &, const ::Ice::Current &)
static const ::std::string & ice_staticId()
void createTopic(LogUpdate llu, string name)
Create the topic with the given name.
Interface used to sync topics.
Definition Election.ice:124
virtual const ::std::string & ice_id(const ::Ice::Current &=::Ice::emptyCurrent) const
virtual bool _iceDispatch(::IceInternal::Incoming &, const ::Ice::Current &)
bool _iceD_getContent(::IceInternal::Incoming &, const ::Ice::Current &)
void getContent(out LogUpdate llu, out TopicContentSeq content)
Retrieve the topic content.
virtual void _iceWriteImpl(::Ice::OutputStream *) const
virtual ::std::vector<::std::string > ice_ids(const ::Ice::Current &=::Ice::emptyCurrent) const
virtual void _iceReadImpl(::Ice::InputStream *)
virtual bool ice_isA(const ::std::string &, const ::Ice::Current &=::Ice::emptyCurrent) const
static const ::std::string & ice_staticId()
::IceProxy::Ice::Object * upCast(::IceProxy::IceStormElection::ReplicaObserver *)
::IceInternal::Handle<::IceStormElection::Node > NodePtr
Definition Election.h:1209
::std::vector<::IceStormElection::NodeInfo > NodeInfoSeq
A sequence of node info.
Definition Election.h:1264
::IceInternal::Handle<::IceStormElection::TopicManagerSync > TopicManagerSyncPtr
Definition Election.h:1201
void _icePatchObjectPtr(ReplicaObserverPtr &, const ::Ice::ObjectPtr &)
::std::vector<::IceStormElection::TopicContent > TopicContentSeq
A sequence of topic content.
Definition Election.h:1225
::Ice::Object * upCast(::IceStormElection::ReplicaObserver *)
::IceInternal::Handle<::IceStormElection::ReplicaObserver > ReplicaObserverPtr
Definition Election.h:1193
double v(double t, double v0, double a0, double j)
Definition CtrlUtil.h:39
A struct used for marking the last log update.
Definition LLURecord.h:103
Used to store persistent information for persistent subscribers.